bare-ffmpeg 1.0.0-18 → 1.0.0-19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/binding.cc +220 -0
- package/lib/codec-parameters.d.ts +6 -1
- package/lib/codec-parameters.js +40 -0
- package/lib/constants.d.ts +9 -0
- package/lib/constants.js +27 -0
- package/package.json +1 -1
- package/prebuilds/android-arm/bare-ffmpeg.bare +0 -0
- package/prebuilds/android-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/android-ia32/bare-ffmpeg.bare +0 -0
- package/prebuilds/android-x64/bare-ffmpeg.bare +0 -0
- package/prebuilds/darwin-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/darwin-x64/bare-ffmpeg.bare +0 -0
- package/prebuilds/ios-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-ffmpeg.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-ffmpeg.bare +0 -0
- package/prebuilds/linux-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/linux-x64/bare-ffmpeg.bare +0 -0
- package/prebuilds/win32-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/win32-x64/bare-ffmpeg.bare +0 -0
package/README.md
CHANGED
|
@@ -315,6 +315,24 @@ const params = stream.codecParameters // Get from stream
|
|
|
315
315
|
|
|
316
316
|
#### Properties
|
|
317
317
|
|
|
318
|
+
##### `CodecParameters.codecType`
|
|
319
|
+
|
|
320
|
+
General type of the encoded data.
|
|
321
|
+
|
|
322
|
+
**Returns**: `number`
|
|
323
|
+
|
|
324
|
+
##### `CodecParameters.codecId`
|
|
325
|
+
|
|
326
|
+
Specific type of the encoded data (the codec used).
|
|
327
|
+
|
|
328
|
+
**Returns**: `number`
|
|
329
|
+
|
|
330
|
+
##### `CodecParameters.codecTag`
|
|
331
|
+
|
|
332
|
+
Additional information about the codec (corresponds to the AVI FOURCC).
|
|
333
|
+
|
|
334
|
+
**Returns**: `number`
|
|
335
|
+
|
|
318
336
|
##### `CodecParameters.bitRate`
|
|
319
337
|
|
|
320
338
|
Gets the bit rate.
|
|
@@ -345,6 +363,25 @@ Out-of-band global headers that may be used by some codecs.
|
|
|
345
363
|
|
|
346
364
|
**Returns**: `Buffer`
|
|
347
365
|
|
|
366
|
+
##### `CodecParameters.codecProfile`
|
|
367
|
+
|
|
368
|
+
Codec-specific bitstream restrictions that the stream conforms to.
|
|
369
|
+
|
|
370
|
+
**Returns**: `number`
|
|
371
|
+
|
|
372
|
+
##### `CodecParameters.codecLevel`
|
|
373
|
+
|
|
374
|
+
Codec-specific bitstream restrictions that the stream conforms to.
|
|
375
|
+
|
|
376
|
+
**Returns**: `number`
|
|
377
|
+
|
|
378
|
+
##### `CodecParameters.codecFormat`
|
|
379
|
+
|
|
380
|
+
Video: the pixel format, the value corresponds to AVPixelFormat.
|
|
381
|
+
Audio: the sample format, the value corresponds to AVSampleFormat.
|
|
382
|
+
|
|
383
|
+
**Returns**: `number`
|
|
384
|
+
|
|
348
385
|
#### Methods
|
|
349
386
|
|
|
350
387
|
##### `CodecParameters.fromContext(context)`
|
package/binding.cc
CHANGED
|
@@ -1271,6 +1271,35 @@ bare_ffmpeg_codec_parameters_get_codec_type(
|
|
|
1271
1271
|
return parameters->handle->codec_type;
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
1274
|
+
static void
|
|
1275
|
+
bare_ffmpeg_codec_parameters_set_codec_type(
|
|
1276
|
+
js_env_t *env,
|
|
1277
|
+
js_receiver_t,
|
|
1278
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters,
|
|
1279
|
+
int type
|
|
1280
|
+
) {
|
|
1281
|
+
parameters->handle->codec_type = static_cast<AVMediaType>(type);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
static uint32_t
|
|
1285
|
+
bare_ffmpeg_codec_parameters_get_codec_tag(
|
|
1286
|
+
js_env_t *env,
|
|
1287
|
+
js_receiver_t,
|
|
1288
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters
|
|
1289
|
+
) {
|
|
1290
|
+
return parameters->handle->codec_tag;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
static void
|
|
1294
|
+
bare_ffmpeg_codec_parameters_set_codec_tag(
|
|
1295
|
+
js_env_t *env,
|
|
1296
|
+
js_receiver_t,
|
|
1297
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters,
|
|
1298
|
+
uint32_t codec_tag
|
|
1299
|
+
) {
|
|
1300
|
+
parameters->handle->codec_tag = codec_tag;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1274
1303
|
static int32_t
|
|
1275
1304
|
bare_ffmpeg_codec_parameters_get_codec_id(
|
|
1276
1305
|
js_env_t *env,
|
|
@@ -1280,6 +1309,73 @@ bare_ffmpeg_codec_parameters_get_codec_id(
|
|
|
1280
1309
|
return parameters->handle->codec_id;
|
|
1281
1310
|
}
|
|
1282
1311
|
|
|
1312
|
+
static void
|
|
1313
|
+
bare_ffmpeg_codec_parameters_set_codec_id(
|
|
1314
|
+
js_env_t *env,
|
|
1315
|
+
js_receiver_t,
|
|
1316
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters,
|
|
1317
|
+
uint32_t codec_id
|
|
1318
|
+
) {
|
|
1319
|
+
parameters->handle->codec_id = static_cast<AVCodecID>(codec_id);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
static int
|
|
1323
|
+
bare_ffmpeg_codec_parameters_get_codec_level(
|
|
1324
|
+
js_env_t *env,
|
|
1325
|
+
js_receiver_t,
|
|
1326
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters
|
|
1327
|
+
) {
|
|
1328
|
+
return parameters->handle->level;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
static void
|
|
1332
|
+
bare_ffmpeg_codec_parameters_set_codec_level(
|
|
1333
|
+
js_env_t *env,
|
|
1334
|
+
js_receiver_t,
|
|
1335
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters,
|
|
1336
|
+
int level
|
|
1337
|
+
) {
|
|
1338
|
+
parameters->handle->level = level;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
static int
|
|
1342
|
+
bare_ffmpeg_codec_parameters_get_codec_profile(
|
|
1343
|
+
js_env_t *env,
|
|
1344
|
+
js_receiver_t,
|
|
1345
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters
|
|
1346
|
+
) {
|
|
1347
|
+
return parameters->handle->profile;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
static void
|
|
1351
|
+
bare_ffmpeg_codec_parameters_set_codec_profile(
|
|
1352
|
+
js_env_t *env,
|
|
1353
|
+
js_receiver_t,
|
|
1354
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters,
|
|
1355
|
+
int profile
|
|
1356
|
+
) {
|
|
1357
|
+
parameters->handle->profile = profile;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
static int
|
|
1361
|
+
bare_ffmpeg_codec_parameters_get_codec_format(
|
|
1362
|
+
js_env_t *env,
|
|
1363
|
+
js_receiver_t,
|
|
1364
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters
|
|
1365
|
+
) {
|
|
1366
|
+
return parameters->handle->format;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
static void
|
|
1370
|
+
bare_ffmpeg_codec_parameters_set_codec_format(
|
|
1371
|
+
js_env_t *env,
|
|
1372
|
+
js_receiver_t,
|
|
1373
|
+
js_arraybuffer_span_of_t<bare_ffmpeg_codec_parameters_t, 1> parameters,
|
|
1374
|
+
int format
|
|
1375
|
+
) {
|
|
1376
|
+
parameters->handle->format = format;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1283
1379
|
static js_arraybuffer_t
|
|
1284
1380
|
bare_ffmpeg_codec_parameters_get_channel_layout(
|
|
1285
1381
|
js_env_t *env,
|
|
@@ -2624,7 +2720,17 @@ bare_ffmpeg_exports(js_env_t *env, js_value_t *exports) {
|
|
|
2624
2720
|
V("getCodecParametersSampleRate", bare_ffmpeg_codec_parameters_get_sample_rate)
|
|
2625
2721
|
V("getCodecParametersNbChannels", bare_ffmpeg_codec_parameters_get_nb_channels)
|
|
2626
2722
|
V("getCodecParametersCodecType", bare_ffmpeg_codec_parameters_get_codec_type)
|
|
2723
|
+
V("setCodecParametersCodecType", bare_ffmpeg_codec_parameters_set_codec_type)
|
|
2724
|
+
V("getCodecParametersCodecTag", bare_ffmpeg_codec_parameters_get_codec_tag)
|
|
2725
|
+
V("setCodecParametersCodecTag", bare_ffmpeg_codec_parameters_set_codec_tag)
|
|
2627
2726
|
V("getCodecParametersCodecId", bare_ffmpeg_codec_parameters_get_codec_id)
|
|
2727
|
+
V("setCodecParametersCodecId", bare_ffmpeg_codec_parameters_set_codec_id)
|
|
2728
|
+
V("getCodecParametersCodecLevel", bare_ffmpeg_codec_parameters_get_codec_level)
|
|
2729
|
+
V("setCodecParametersCodecLevel", bare_ffmpeg_codec_parameters_set_codec_level)
|
|
2730
|
+
V("getCodecParametersCodecProfile", bare_ffmpeg_codec_parameters_get_codec_profile)
|
|
2731
|
+
V("setCodecParametersCodecProfile", bare_ffmpeg_codec_parameters_set_codec_profile)
|
|
2732
|
+
V("getCodecParametersCodecFormat", bare_ffmpeg_codec_parameters_get_codec_format)
|
|
2733
|
+
V("setCodecParametersCodecFormat", bare_ffmpeg_codec_parameters_set_codec_format)
|
|
2628
2734
|
V("getCodecParametersChannelLayout", bare_ffmpeg_codec_parameters_get_channel_layout)
|
|
2629
2735
|
V("getCodecParametersWidth", bare_ffmpeg_codec_parameters_get_width)
|
|
2630
2736
|
V("getCodecParametersHeight", bare_ffmpeg_codec_parameters_get_height)
|
|
@@ -2828,6 +2934,120 @@ bare_ffmpeg_exports(js_env_t *env, js_value_t *exports) {
|
|
|
2828
2934
|
V(AVFMT_NEEDNUMBER)
|
|
2829
2935
|
V(AVFMT_NOTIMESTAMPS)
|
|
2830
2936
|
|
|
2937
|
+
// Profile
|
|
2938
|
+
V(AV_PROFILE_UNKNOWN)
|
|
2939
|
+
V(AV_PROFILE_RESERVED)
|
|
2940
|
+
V(AV_PROFILE_AAC_MAIN)
|
|
2941
|
+
V(AV_PROFILE_AAC_LOW)
|
|
2942
|
+
V(AV_PROFILE_AAC_SSR)
|
|
2943
|
+
V(AV_PROFILE_AAC_LTP)
|
|
2944
|
+
V(AV_PROFILE_AAC_HE)
|
|
2945
|
+
V(AV_PROFILE_AAC_HE_V2)
|
|
2946
|
+
V(AV_PROFILE_AAC_LD)
|
|
2947
|
+
V(AV_PROFILE_AAC_ELD)
|
|
2948
|
+
V(AV_PROFILE_AAC_USAC)
|
|
2949
|
+
V(AV_PROFILE_MPEG2_AAC_LOW)
|
|
2950
|
+
V(AV_PROFILE_MPEG2_AAC_HE)
|
|
2951
|
+
V(AV_PROFILE_DNXHD)
|
|
2952
|
+
V(AV_PROFILE_DNXHR_LB)
|
|
2953
|
+
V(AV_PROFILE_DNXHR_SQ)
|
|
2954
|
+
V(AV_PROFILE_DNXHR_HQ)
|
|
2955
|
+
V(AV_PROFILE_DNXHR_HQX)
|
|
2956
|
+
V(AV_PROFILE_DNXHR_444)
|
|
2957
|
+
V(AV_PROFILE_DTS)
|
|
2958
|
+
V(AV_PROFILE_DTS_ES)
|
|
2959
|
+
V(AV_PROFILE_DTS_96_24)
|
|
2960
|
+
V(AV_PROFILE_DTS_HD_HRA)
|
|
2961
|
+
V(AV_PROFILE_DTS_HD_MA)
|
|
2962
|
+
V(AV_PROFILE_DTS_EXPRESS)
|
|
2963
|
+
V(AV_PROFILE_DTS_HD_MA_X)
|
|
2964
|
+
V(AV_PROFILE_DTS_HD_MA_X_IMAX)
|
|
2965
|
+
V(AV_PROFILE_EAC3_DDP_ATMOS)
|
|
2966
|
+
V(AV_PROFILE_TRUEHD_ATMOS)
|
|
2967
|
+
V(AV_PROFILE_MPEG2_422)
|
|
2968
|
+
V(AV_PROFILE_MPEG2_HIGH)
|
|
2969
|
+
V(AV_PROFILE_MPEG2_SS)
|
|
2970
|
+
V(AV_PROFILE_MPEG2_SNR_SCALABLE)
|
|
2971
|
+
V(AV_PROFILE_MPEG2_MAIN)
|
|
2972
|
+
V(AV_PROFILE_MPEG2_SIMPLE)
|
|
2973
|
+
V(AV_PROFILE_H264_CONSTRAINED)
|
|
2974
|
+
V(AV_PROFILE_H264_INTRA)
|
|
2975
|
+
V(AV_PROFILE_H264_BASELINE)
|
|
2976
|
+
V(AV_PROFILE_H264_CONSTRAINED_BASELINE)
|
|
2977
|
+
V(AV_PROFILE_H264_MAIN)
|
|
2978
|
+
V(AV_PROFILE_H264_EXTENDED)
|
|
2979
|
+
V(AV_PROFILE_H264_HIGH)
|
|
2980
|
+
V(AV_PROFILE_H264_HIGH_10)
|
|
2981
|
+
V(AV_PROFILE_H264_HIGH_10_INTRA)
|
|
2982
|
+
V(AV_PROFILE_H264_MULTIVIEW_HIGH)
|
|
2983
|
+
V(AV_PROFILE_H264_HIGH_422)
|
|
2984
|
+
V(AV_PROFILE_H264_HIGH_422_INTRA)
|
|
2985
|
+
V(AV_PROFILE_H264_STEREO_HIGH)
|
|
2986
|
+
V(AV_PROFILE_H264_HIGH_444)
|
|
2987
|
+
V(AV_PROFILE_H264_HIGH_444_PREDICTIVE)
|
|
2988
|
+
V(AV_PROFILE_H264_HIGH_444_INTRA)
|
|
2989
|
+
V(AV_PROFILE_H264_CAVLC_444)
|
|
2990
|
+
V(AV_PROFILE_VC1_SIMPLE)
|
|
2991
|
+
V(AV_PROFILE_VC1_MAIN)
|
|
2992
|
+
V(AV_PROFILE_VC1_COMPLEX)
|
|
2993
|
+
V(AV_PROFILE_VC1_ADVANCED)
|
|
2994
|
+
V(AV_PROFILE_MPEG4_SIMPLE)
|
|
2995
|
+
V(AV_PROFILE_MPEG4_SIMPLE_SCALABLE)
|
|
2996
|
+
V(AV_PROFILE_MPEG4_CORE)
|
|
2997
|
+
V(AV_PROFILE_MPEG4_MAIN)
|
|
2998
|
+
V(AV_PROFILE_MPEG4_N_BIT)
|
|
2999
|
+
V(AV_PROFILE_MPEG4_SCALABLE_TEXTURE)
|
|
3000
|
+
V(AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION)
|
|
3001
|
+
V(AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE)
|
|
3002
|
+
V(AV_PROFILE_MPEG4_HYBRID)
|
|
3003
|
+
V(AV_PROFILE_MPEG4_ADVANCED_REAL_TIME)
|
|
3004
|
+
V(AV_PROFILE_MPEG4_CORE_SCALABLE)
|
|
3005
|
+
V(AV_PROFILE_MPEG4_ADVANCED_CODING)
|
|
3006
|
+
V(AV_PROFILE_MPEG4_ADVANCED_CORE)
|
|
3007
|
+
V(AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE)
|
|
3008
|
+
V(AV_PROFILE_MPEG4_SIMPLE_STUDIO)
|
|
3009
|
+
V(AV_PROFILE_MPEG4_ADVANCED_SIMPLE)
|
|
3010
|
+
V(AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0)
|
|
3011
|
+
V(AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1)
|
|
3012
|
+
V(AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION)
|
|
3013
|
+
V(AV_PROFILE_JPEG2000_DCINEMA_2K)
|
|
3014
|
+
V(AV_PROFILE_JPEG2000_DCINEMA_4K)
|
|
3015
|
+
V(AV_PROFILE_VP9_0)
|
|
3016
|
+
V(AV_PROFILE_VP9_1)
|
|
3017
|
+
V(AV_PROFILE_VP9_2)
|
|
3018
|
+
V(AV_PROFILE_VP9_3)
|
|
3019
|
+
V(AV_PROFILE_HEVC_MAIN)
|
|
3020
|
+
V(AV_PROFILE_HEVC_MAIN_10)
|
|
3021
|
+
V(AV_PROFILE_HEVC_MAIN_STILL_PICTURE)
|
|
3022
|
+
V(AV_PROFILE_HEVC_REXT)
|
|
3023
|
+
V(AV_PROFILE_HEVC_MULTIVIEW_MAIN)
|
|
3024
|
+
V(AV_PROFILE_HEVC_SCC)
|
|
3025
|
+
V(AV_PROFILE_VVC_MAIN_10)
|
|
3026
|
+
V(AV_PROFILE_VVC_MAIN_10_444)
|
|
3027
|
+
V(AV_PROFILE_AV1_MAIN)
|
|
3028
|
+
V(AV_PROFILE_AV1_HIGH)
|
|
3029
|
+
V(AV_PROFILE_AV1_PROFESSIONAL)
|
|
3030
|
+
V(AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT)
|
|
3031
|
+
V(AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT)
|
|
3032
|
+
V(AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT)
|
|
3033
|
+
V(AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS)
|
|
3034
|
+
V(AV_PROFILE_MJPEG_JPEG_LS)
|
|
3035
|
+
V(AV_PROFILE_SBC_MSBC)
|
|
3036
|
+
V(AV_PROFILE_PRORES_PROXY)
|
|
3037
|
+
V(AV_PROFILE_PRORES_LT)
|
|
3038
|
+
V(AV_PROFILE_PRORES_STANDARD)
|
|
3039
|
+
V(AV_PROFILE_PRORES_HQ)
|
|
3040
|
+
V(AV_PROFILE_PRORES_4444)
|
|
3041
|
+
V(AV_PROFILE_PRORES_XQ)
|
|
3042
|
+
V(AV_PROFILE_ARIB_PROFILE_A)
|
|
3043
|
+
V(AV_PROFILE_ARIB_PROFILE_C)
|
|
3044
|
+
V(AV_PROFILE_KLVA_SYNC)
|
|
3045
|
+
V(AV_PROFILE_KLVA_ASYNC)
|
|
3046
|
+
V(AV_PROFILE_EVC_BASELINE)
|
|
3047
|
+
V(AV_PROFILE_EVC_MAIN)
|
|
3048
|
+
|
|
3049
|
+
// Levels
|
|
3050
|
+
V(AV_LEVEL_UNKNOWN)
|
|
2831
3051
|
#undef V
|
|
2832
3052
|
|
|
2833
3053
|
return exports;
|
|
@@ -8,7 +8,12 @@ declare class FFmpegCodecParameters {
|
|
|
8
8
|
readonly format: number
|
|
9
9
|
readonly sampleRate: number
|
|
10
10
|
readonly nbChannels: number
|
|
11
|
-
|
|
11
|
+
codecType: number
|
|
12
|
+
codecTag: number
|
|
13
|
+
codecId: number
|
|
14
|
+
codecProfile: number
|
|
15
|
+
codecLevel: number
|
|
16
|
+
codecFormat: number
|
|
12
17
|
readonly channelLayout: FFmpegChannelLayout
|
|
13
18
|
extraData: Buffer
|
|
14
19
|
|
package/lib/codec-parameters.js
CHANGED
|
@@ -42,10 +42,50 @@ module.exports = class FFmpegCodecParameters {
|
|
|
42
42
|
return binding.getCodecParametersCodecType(this._handle)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
set codecType(type) {
|
|
46
|
+
return binding.setCodecParametersCodecType(this._handle, type)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get codecTag() {
|
|
50
|
+
return binding.getCodecParametersCodecTag(this._handle)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
set codecTag(tag) {
|
|
54
|
+
return binding.setCodecParametersCodecTag(this._handle, tag)
|
|
55
|
+
}
|
|
56
|
+
|
|
45
57
|
get codecId() {
|
|
46
58
|
return binding.getCodecParametersCodecId(this._handle)
|
|
47
59
|
}
|
|
48
60
|
|
|
61
|
+
set codecId(id) {
|
|
62
|
+
return binding.setCodecParametersCodecId(this._handle, id)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
get codecLevel() {
|
|
66
|
+
return binding.getCodecParametersCodecLevel(this._handle)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set codecLevel(level) {
|
|
70
|
+
return binding.setCodecParametersCodecLevel(this._handle, level)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get codecProfile() {
|
|
74
|
+
return binding.getCodecParametersCodecProfile(this._handle)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
set codecProfile(profile) {
|
|
78
|
+
return binding.setCodecParametersCodecProfile(this._handle, profile)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
get codecFormat() {
|
|
82
|
+
return binding.getCodecParametersCodecFormat(this._handle)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
set codecFormat(format) {
|
|
86
|
+
return binding.setCodecParametersCodecFormat(this._handle, format)
|
|
87
|
+
}
|
|
88
|
+
|
|
49
89
|
get channelLayout() {
|
|
50
90
|
return new ChannelLayout(
|
|
51
91
|
binding.getCodecParametersChannelLayout(this._handle)
|
package/lib/constants.d.ts
CHANGED
package/lib/constants.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
const binding = require('../binding')
|
|
2
2
|
const errors = require('./errors')
|
|
3
3
|
|
|
4
|
+
// Helpers
|
|
5
|
+
function makeTag(a, b, c, d) {
|
|
6
|
+
return (
|
|
7
|
+
a.charCodeAt(0) |
|
|
8
|
+
(b.charCodeAt(0) << 8) |
|
|
9
|
+
(c.charCodeAt(0) << 16) |
|
|
10
|
+
(d.charCodeAt(0) << 24)
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
4
14
|
module.exports = exports = {
|
|
5
15
|
codecs: {
|
|
6
16
|
MJPEG: binding.AV_CODEC_ID_MJPEG,
|
|
@@ -11,6 +21,23 @@ module.exports = exports = {
|
|
|
11
21
|
FLAC: binding.AV_CODEC_ID_FLAC,
|
|
12
22
|
MP3: binding.AV_CODEC_ID_MP3
|
|
13
23
|
},
|
|
24
|
+
tags: {
|
|
25
|
+
// Source Ref:
|
|
26
|
+
// https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/riff.c#L36
|
|
27
|
+
// https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/riff.c#L530
|
|
28
|
+
MJPEG: makeTag('M', 'J', 'P', 'G'),
|
|
29
|
+
H264: makeTag('H', '2', '6', '4'),
|
|
30
|
+
AV1: makeTag('A', 'V', '0', '1'),
|
|
31
|
+
AAC: 0x00ff,
|
|
32
|
+
FLAC: 0xf1ac,
|
|
33
|
+
MP3: 0x0055
|
|
34
|
+
},
|
|
35
|
+
profiles: {
|
|
36
|
+
H264_MAIN: binding.AV_PROFILE_H264_MAIN
|
|
37
|
+
},
|
|
38
|
+
levels: {
|
|
39
|
+
UNKNOWN: binding.AV_LEVEL_UNKNOWN
|
|
40
|
+
},
|
|
14
41
|
pixelFormats: {
|
|
15
42
|
RGBA: binding.AV_PIX_FMT_RGBA,
|
|
16
43
|
RGB24: binding.AV_PIX_FMT_RGB24,
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|