I am using fluent ffmpeg with ffmpeg v4.1.3 for HLS mukti bitrate streaming but I m not able to use -var_stream_map config it says option, not found but running this command outside fluent-ffmpeg works fine
Here is my code
const stream = ffmpeg(filePath);
stream.outputOptions([
'-preset slow',
'-g 48',
'-map 0:0',
'-q:a:0 64k',
'-q:a:1 128k',
'-var_stream_map a:0 a:1',
'-hls_time 6',
'-f hls',
'-hls_list_size 0',
'-master_pl_name /tmp/master.m3u8',
"-hls_segment_filename /tmp/v%v/fileSequence%d.t",
"/tmp/v%v/prog_index.m3u8"
])
.output('./master.m3u8')
.on('progress', function(progress) {
console.log('Processing: ' + progress.percent + '% done')
})
Here is the output
ffmpeg version 4.1.3-tessus https://evermeet.cx/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.1 (clang-1001.0.46.3)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Unrecognized option 'var_stream_map a:0 a:1'.
Error splitting the argument list: Option not found
Can someone tell me how can I pass it correctly?
On command line it is recommended put the var_stream_map
value between quotation marks.
'-var_stream_map', '"a:0 a:1"'
Also the -map
parameter adds only one stream (stream 0:0
). If you want to have two audio streams you must also add the -map
parameter two times:
-map 0:0 -map 0:0
Here the same input stream 0:0
is added two times for the output processing.
I also face the same problem and solve that by putting the 'var_stream_map' in another outputOption().
stream.outputOptions([
'-preset slow',
'-g 48',
'-map 0:v', '-map 0:v',
'-map 0:a', '-map 0:a',
'-q:a:0 64k',
'-q:a:1 128k',
'-hls_time 6',
'-f hls',
'-hls_list_size 0',
'-master_pl_name /tmp/master.m3u8',
"-hls_segment_filename /tmp/v%v/fileSequence%d.t",
"/tmp/v%v/prog_index.m3u8"
])
.outputOption('-var_stream_map', 'v:0,a:0 v:1,a:1')
.output('./master.m3u8')
.on('progress', function(progress) {
console.log('Processing: ' + progress.percent + '% done')
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.