I can't seem to figure out how to do this. I've been staring at these commands:
https://trac.ffmpeg.org/wiki/AudioChannelManipulation
But to no avail. It's a tad above my level, sadly. Here's the ffmpeg -i output for the video in question:
ffmpeg version N-64012-g61df081 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 16 2014 22:01:59 with gcc 4.8.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex--enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
libavutil 52. 89.100 / 52. 89.100
libavcodec 55. 67.100 / 55. 67.100
libavformat 55. 43.100 / 55. 43.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 8.100 / 4. 8.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, matroska,webm, from '[Coalgirls]_Spirited_Away_(1920x1038_Blu-ray_FLAC)_[92372194].mkv':
Metadata:
title : Spirited Away
encoder : libebml v1.3.0 + libmatroska v1.4.0
creation_time : 2014-07-03 01:32:13
Duration: 02:04:32.29, start: 0.000000, bitrate: 15972 kb/s
Chapter #0.0: start 0.000000, end 99.099000
Metadata:
title : 00:00:00.000
Chapter #0.1: start 99.099000, end 196.238000
Metadata:
title : 00:01:39.099
Chapter #0.2: start 196.238000, end 443.526000
Metadata:
title : 00:03:16.238
Chapter #0.3: start 443.526000, end 645.395000
Metadata:
title : 00:07:23.526
Chapter #0.4: start 645.395000, end 1023.022000
Metadata:
title : 00:10:45.395
Chapter #0.5: start 1023.022000, end 1368.534000
Metadata:
title : 00:17:03.022
Chapter #0.6: start 1368.534000, end 1716.048000
Metadata:
title : 00:22:48.534
Chapter #0.7: start 1716.048000, end 2008.173000
Metadata:
title : 00:28:36.048
Chapter #0.8: start 2008.173000, end 2301.674000
Metadata:
title : 00:33:28.173
Chapter #0.9: start 2301.674000, end 2651.816000
Metadata:
title : 00:38:21.674
Chapter #0.10: start 2651.816000, end 2906.821000
Metadata:
title : 00:44:11.816
Chapter #0.11: start 2906.821000, end 3271.351000
Metadata:
title : 00:48:26.821
Chapter #0.12: start 3271.351000, end 3729.017000
Metadata:
title : 00:54:31.351
Chapter #0.13: start 3729.017000, end 4091.587000
Metadata:
title : 01:02:09.017
Chapter #0.14: start 4091.587000, end 4476.847000
Metadata:
title : 01:08:11.587
Chapter #0.15: start 4476.847000, end 4750.579000
Metadata:
title : 01:14:36.847
Chapter #0.16: start 4750.579000, end 5139.760000
Metadata:
title : 01:19:10.579
Chapter #0.17: start 5139.760000, end 5478.890000
Metadata:
title : 01:25:39.760
Chapter #0.18: start 5478.890000, end 5853.806000
Metadata:
title : 01:31:18.890
Chapter #0.19: start 5853.806000, end 6318.937000
Metadata:
title : 01:37:33.806
Chapter #0.20: start 6318.937000, end 6625.118000
Metadata:
title : 01:45:18.937
Chapter #0.21: start 6625.118000, end 6771.098000
Metadata:
title : 01:50:25.118
Chapter #0.22: start 6771.098000, end 6914.199000
Metadata:
title : 01:52:51.098
Chapter #0.23: start 6914.199000, end 7253.580000
Metadata:
title : 01:55:14.199
Chapter #0.24: start 7253.580000, end 7472.288000
Metadata:
title : 02:00:53.580
Stream #0:0: Video: h264 (High 10), yuv420p10le(tv, bt709), 1920x1038, SAR 1:1 DAR 320:173, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
title : Spirited Away
Stream #0:1(jpn): Audio: flac, 48000 Hz, 6.1, s32 (default)
Metadata:
title : 6.1 FLAC
Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : 5.1 AC3
Stream #0:3(fre): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : 5.1 AC3
Stream #0:4(ger): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : 5.1 AC3
Stream #0:5(fin): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Metadata:
title : 2.0 AC3
Stream #0:6(kor): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : 5.1 AC3
Stream #0:7(chi): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : 5.1 AC3
Stream #0:8(chi): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : 5.1 AC3
Stream #0:9(eng): Subtitle: ssa (default)
Metadata:
title : English
Stream #0:10(fre): Subtitle: ssa
Metadata:
title : French
Stream #0:11(ger): Subtitle: ssa
Metadata:
title : German
Stream #0:12(eng): Subtitle: ssa
Metadata:
title : Songs + Signs
Stream #0:13: Attachment: ttf
Metadata:
filename : MyriadPro-Regular.otf
mimetype : application/x-truetype-font
Stream #0:14: Attachment: ttf
Metadata:
filename : MyriadPro-SemiboldIt.otf
mimetype : application/x-truetype-font
Stream #0:15: Attachment: ttf
Metadata:
filename : Vesta-Bold.otf
mimetype : application/x-truetype-font
Stream #0:16: Attachment: ttf
Metadata:
filename : Vesta-Bold_2.otf
mimetype : application/x-truetype-font
Stream #0:17: Attachment: ttf
Metadata:
filename : AR CENA_0.TTF
mimetype : application/x-truetype-font
Stream #0:18: Attachment: ttf
Metadata:
filename : tahomabd.ttf
mimetype : application/x-truetype-font
Stream #0:19: Attachment: ttf
Metadata:
filename : palai.ttf
mimetype : application/x-truetype-font
Stream #0:20: Attachment: ttf
Metadata:
filename : pala.ttf
mimetype : application/x-truetype-font
As you can see, one of the streams is a FLAC 6.1 stream. I wanted to convert that to AAC, and I know how to do that, basically like this:
ffmpeg -i "input.mkv" -codec:v copy -codec:a aac -strict -2 -b:a 320k -f matroska "output.mkv"
But apparently AAC doesn't support 6.1 audio:
...
[aac # 03b26860] Unsupported number of channels: 7
Output #0, matroska, to 'd:\Movies\[Coalgirls]_Spirited_Away_(1920x1038_Blu-ray_FLAC)_[92372194].aac.mkv':
Stream #0:0(jpn): Video: h264, yuv420p10le, 1920x1038 [SAR 1:1 DAR 320:173], q=2-31, 23.98 fps, 90k tbn, 1k tbc (default)
Stream #0:1(jpn): Audio: aac, 0 channels, 128 kb/s (default)
Metadata:
encoder : Lavc55.67.100 aac
Stream #0:2(eng): Subtitle: ssa, 128 kb/s (default)
Metadata:
encoder : Lavc55.67.100 ssa
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (flac (native) -> aac (aac))
Stream #0:9 -> #0:2 (ssa (native) -> ssa (native))
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
That's fine, so I wanted to downmix it to 5.1 and encode as AAC. But I can't seem to work out how to. Any advice?
Last I heard, the aac encoder for ffmpeg was considered experimental. It's usually recommended to either :
Compile your own ffmpeg with the inclusion of libfdk_aac, which is the best AAC encoder for ffmpeg but isn't included due to licensing reasons (https://trac.ffmpeg.org/wiki/Encode/AAC)
Use NeroAacCodec, a free high quality aac encoder by nero. You can use ffmpeg to extract the FLAC track, convert it to wav and send it to NeroAacCodec
I can't guarantee you that either will support 6.1 in/5.1 out, but there's a big chance it'll work better than ffmpeg's built-in aac encoder.
Related
Is this a bug, or expected behaviour? When converting materials from PAL to NTSC I invoke atempo as follows:
-map 0:a:? -af atempo=24000/25025 ^
-c:a pcm_s24le
I use this in a windows batch file (hence the caret) as a catch-all for all files that need to be converted, not having to deal with how many audio channels might be present or in what order.
However, when my input was a broadcast MXF with 10channel mono audio (1 per stream) it introduced wild phasing between the tracks.
Merging the tracks into a single stream to be processed by atempo resulted in no phasing.
-filter_complex "[0:a:0][0:a:1][0:a:2][0:a:3][0:a:4][0:a:5][0:a:6][0:a:7][0:a:8][0:a:9] amerge=inputs=10, atempo=24000/25025[FRC]" ^
-map "[FRC]" -c:a pcm_s24le
Is this expected behaviour? I can't see any documentation detailing the need to first use amerge before invoking atempo.
If indeed this step is necessary, is there a way to "wildcard" the amerge operation so that I don't have to manually enter all the audio channels, and then the "inputs="? This would allow me to make it more universal.
This is my first question on stack overflow, so please be gentle. I've come here to find so many answers to my FFMPEG questions in the past--but this seems to be an edge case I can't get much detail on.
Thanks!
EDIT:
This output using the wildcard produces phasing:
C:\Windows>ffmpeg -ss 00:05:13.0 -r 24000/1001 -i "\\bdfs11\array21\Eps101_1920x1080_20_51_DV_CC_25fps_20210622.mov" -t 00:00:22.0 -map 0:v:0 -c:v mpeg2video -profile:v 0 -level:v 2 -b:v 50000k -minrate 50000k -maxrate 50000k -pix_fmt yuv422p -vtag xd5d -force_key_frames "expr:gte(t,n_forced*1)" -streamid 0:481 -streamid 1:129 -map 0:a:? -af atempo=24000/25025 -c:a pcm_s24le "R:\2_SERIES\%~n1_25to23976_works.%Container%" -y
ffmpeg version N-94566-gddd92ba2c6 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
[mov,mp4,m4a,3gp,3g2,mj2 # 06ea4cc0] Could not find codec parameters for stream 12 (Subtitle: none (c708 / 0x38303763), 1920x1080, 21 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Guessed Channel Layout for Input Stream #0.5 : mono
Guessed Channel Layout for Input Stream #0.6 : mono
Guessed Channel Layout for Input Stream #0.7 : mono
Guessed Channel Layout for Input Stream #0.8 : mono
Guessed Channel Layout for Input Stream #0.9 : mono
Guessed Channel Layout for Input Stream #0.10 : mono
Guessed Channel Layout for Input Stream #0.11 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\\bdfs11\array21\Eps101_1920x1080_20_51_DV_CC_25fps_20210622.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2021-06-22T17:39:50.000000Z
Duration: 00:59:08.16, start: 0.000000, bitrate: 217983 kb/s
Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709, progressive), 1920x1080, 206438 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Video Media Handler
encoder : Apple ProRes 422 HQ
timecode : 00:59:59:00
Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
rotate : 0
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Time Code Media Handler
reel_name : untitled
timecode : 00:59:59:00
Stream #0:2(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:3(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:4(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:5(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:6(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:7(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:8(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:9(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:10(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:11(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:12(eng): Subtitle: none (c708 / 0x38303763), 1920x1080, 21 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Closed Caption Media Handler
Stream mapping:
Stream #0:0 -> #0:0 (prores (native) -> mpeg2video (native))
Stream #0:2 -> #0:1 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:3 -> #0:2 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:4 -> #0:3 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:5 -> #0:4 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:6 -> #0:5 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:7 -> #0:6 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:8 -> #0:7 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:9 -> #0:8 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:10 -> #0:9 (pcm_s24le (native) -> pcm_s24le (native))
Stream #0:11 -> #0:10 (pcm_s24le (native) -> pcm_s24le (native))
Press [q] to stop, [?] for help
[mpeg2video # 06f8aa40] Automatically choosing VBV buffer size of 746 kbyte
Output #0, mxf, to 'R:\2_SERIES\Eps101_1920x1080_20_51_DV_CC_25fps_20210622_25to23976_works.mxf':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
encoder : Lavf58.30.100
Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5d / 0x64356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 50000 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Video Media Handler
timecode : 00:59:59:00
encoder : Lavc58.55.100 mpeg2video
Side data:
cpb: bitrate max/min/avg: 50000000/50000000/50000000 buffer size: 6111232 vbv_delay: 18446744073709551615
Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:2(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:3(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:4(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:5(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:6(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:7(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:8(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:9(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
Stream #0:10(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
encoder : Lavc58.55.100 pcm_s24le
frame= 527 fps= 52 q=2.0 Lsize= 166106kB time=00:00:22.00 bitrate=61851.7kbits/s speed=2.19x
video:133971kB audio:30938kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.726204%
This is the output that produces no phasing
C:\Windows>ffmpeg -ss 00:05:13.0 -r 24000/1001 -i "\\bdfs11\array21\Eps101_1920x1080_20_51_DV_CC_25fps_20210622.mov" -t 00:00:22.0 -map 0:v:0 -c:v mpeg2video -profile:v 0 -level:v 2 -b:v 50000k -minrate 50000k -maxrate 50000k -pix_fmt yuv422p -vtag xd5d -force_key_frames "expr:gte(t,n_forced*1)" -streamid 0:481 -streamid 1:129 -filter_complex "[0:a:0][0:a:1][0:a:2][0:a:3][0:a:4][0:a:5][0:a:6][0:a:7][0:a:8][0:a:9] amerge=inputs=10, atempo=24000/25025[FRC]" -map "[FRC]" -c:a pcm_s24le "R:\2_SERIES\Eps101_1920x1080_20_51_DV_CC_25fps_20210622_25to23976_works.mxf" -y
ffmpeg version N-94566-gddd92ba2c6 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
[mov,mp4,m4a,3gp,3g2,mj2 # 064f5580] Could not find codec parameters for stream 12 (Subtitle: none (c708 / 0x38303763), 1920x1080, 21 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Guessed Channel Layout for Input Stream #0.5 : mono
Guessed Channel Layout for Input Stream #0.6 : mono
Guessed Channel Layout for Input Stream #0.7 : mono
Guessed Channel Layout for Input Stream #0.8 : mono
Guessed Channel Layout for Input Stream #0.9 : mono
Guessed Channel Layout for Input Stream #0.10 : mono
Guessed Channel Layout for Input Stream #0.11 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\\bdfs11\array21\Eps101_1920x1080_20_51_DV_CC_25fps_20210622.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2021-06-22T17:39:50.000000Z
Duration: 00:59:08.16, start: 0.000000, bitrate: 217983 kb/s
Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709, progressive), 1920x1080, 206438 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Video Media Handler
encoder : Apple ProRes 422 HQ
timecode : 00:59:59:00
Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
rotate : 0
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Time Code Media Handler
reel_name : untitled
timecode : 00:59:59:00
Stream #0:2(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:3(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:4(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:5(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:6(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:7(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:8(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:9(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:10(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:11(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Sound Media Handler
Stream #0:12(eng): Subtitle: none (c708 / 0x38303763), 1920x1080, 21 kb/s (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Closed Caption Media Handler
Stream mapping:
Stream #0:2 (pcm_s24le) -> amerge:in0 (graph 0)
Stream #0:3 (pcm_s24le) -> amerge:in1 (graph 0)
Stream #0:4 (pcm_s24le) -> amerge:in2 (graph 0)
Stream #0:5 (pcm_s24le) -> amerge:in3 (graph 0)
Stream #0:6 (pcm_s24le) -> amerge:in4 (graph 0)
Stream #0:7 (pcm_s24le) -> amerge:in5 (graph 0)
Stream #0:8 (pcm_s24le) -> amerge:in6 (graph 0)
Stream #0:9 (pcm_s24le) -> amerge:in7 (graph 0)
Stream #0:10 (pcm_s24le) -> amerge:in8 (graph 0)
Stream #0:11 (pcm_s24le) -> amerge:in9 (graph 0)
Stream #0:0 -> #0:0 (prores (native) -> mpeg2video (native))
atempo (graph 0) -> Stream #0:1 (pcm_s24le)
Press [q] to stop, [?] for help
[Parsed_amerge_0 # 06e18dc0] No channel layout for input 1
[Parsed_amerge_0 # 06e18dc0] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
[mpeg2video # 06dea000] Automatically choosing VBV buffer size of 746 kbyte
Output #0, mxf, to 'R:\2_SERIES\Eps101_1920x1080_20_51_DV_CC_25fps_20210622_25to23976_works.mxf':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
encoder : Lavf58.30.100
Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5d / 0x64356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 50000 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
Metadata:
creation_time : 2021-06-22T17:39:50.000000Z
handler_name : Apple Video Media Handler
timecode : 00:59:59:00
encoder : Lavc58.55.100 mpeg2video
Side data:
cpb: bitrate max/min/avg: 50000000/50000000/50000000 buffer size: 6111232 vbv_delay: 18446744073709551615
Stream #0:1: Audio: pcm_s24le, 48000 Hz, 10 channels (FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL), s32, 11520 kb/s (default)
Metadata:
encoder : Lavc58.55.100 pcm_s24le
frame= 527 fps= 61 q=2.0 Lsize= 165571kB time=00:00:22.00 bitrate=61652.6kbits/s speed=2.56x
video:133971kB audio:30938kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.402084%
Let me know if you need more detail than what I've provided.
EDIT2:
This thread seems like it might hold the solution to my problem:
How do I use ffmpeg to merge all audio streams (in a video file) into one audio channel?
But I don't have enough reputation to respond there in the comments.
When adding the call to ffprobe in a batch file I can't seem to call %~1, %~n1 or %~fn1.
Batch file:
#echo off
SETLOCAL
SET "Container=mov"
:hugly
if "%~1" EQU "" goto mugly
SET "FFREPORT=file=%~n1%~x1.%container%.log:level=32"
ffmpeg -ss 00:10:13.0 -r 24000/1001 -i "%~1" -t 00:00:22.0 ^
-filter_complex "[0:v]scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[video];[0:a]amerge=inputs=$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 "%~1" | wc -l),atempo=24000/24024[audio]" ^
-map [video] -c:v prores_ks ^
-profile:v 3 ^
-vendor apl0 ^
-pix_fmt yuv422p10le ^
-map [audio] -c:a pcm_s24le "G:\%~n1_25to23976_test44.%Container%" -y
shift
goto hugly
:mugly
PAUSE
FFMPEG output:
ffmpeg started on 2021-10-05 at 11:59:00
Report written to "29000_Giant Bear_Film - Candy Hansel [24].mp4.mov.log"
Log level: 32
Command line:
ffmpeg -ss 00:10:13.0 -r 24000/1001 -i "R:\\9_FESTIVALS\\2021\\Blood in the Snow 2021\\Trailers\\Shorts\\29000_Giant Bear_Film - Candy Hansel [24].mp4" -t 00:00:22.0 -filter_complex "[0:v]scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[video];[0:a]amerge=inputs=\$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 R:\\9_FESTIVALS\\2021\\Blood" in the Snow "2021\\Trailers\\Shorts\\29000_Giant" Bear_Film - Candy Hansel "[24].mp4 | wc -l),atempo=24000/24024[audio]" -map "[video]" -c:v prores_ks -profile:v 3 -vendor apl0 -pix_fmt yuv422p10le -map "[audio]" -c:a pcm_s24le "G:\\29000_Giant Bear_Film - Candy Hansel [24]_25to23976_test44.mov" -y
ffmpeg version 2021-09-27-git-b786bc7433-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.3.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 57. 7.100 / 57. 7.100
libavcodec 59. 9.101 / 59. 9.101
libavformat 59. 5.100 / 59. 5.100
libavdevice 59. 0.101 / 59. 0.101
libavfilter 8. 9.100 / 8. 9.100
libswscale 6. 1.100 / 6. 1.100
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'R:\9_FESTIVALS\2021\Blood in the Snow 2021\Trailers\Shorts\29000_Giant Bear_Film - Candy Hansel [24].mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41isomavc1
creation_time : 2019-03-18T17:41:46.000000Z
Duration: 00:12:00.64, start: 0.000000, bitrate: 2310 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x816, 2169 kb/s, 24 fps, 24 tbr, 24 tbn (default)
Metadata:
creation_time : 2019-03-18T17:41:46.000000Z
handler_name : L-SMASH Video Handler
vendor_id : [0][0][0][0]
encoder : AVC Coding
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 137 kb/s (default)
Metadata:
creation_time : 2019-03-18T17:41:46.000000Z
handler_name : L-SMASH Audio Handler
vendor_id : [0][0][0][0]
[amerge # 0000022701950940] [Eval # 0000005b3f3fe4d0] Undefined constant or missing '(' in 'ffprobe-loglevelerror-select_streamsa-show_entriesstream=codec_type-ofcsv=p=0R'
[amerge # 0000022701950940] Unable to parse option value "$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 R"
[Parsed_amerge_2 # 0000022701950840] No option name near '9_FESTIVALS2021Blood'
[AVFilterGraph # 000002277ff3f700] Error initializing filter 'amerge' with args 'inputs=$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 R:9_FESTIVALS2021Blood'
Error initializing complex filters.
Invalid argument
EDIT 3
the following command line outside of a batch file returns the same errors:
ffmpeg -ss 00:10:13.0 -r 24000/1001 -i test.mp4 -t 00:00:22.0 -filter_complex "[0:v]scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[video];[0:a]amerge=inputs=$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 test.mp4 | wc -l),atempo=24000/24024[audio]" -map "[video]" -c:v prores_ks -profile:v 3 -vendor apl0 -pix_fmt yuv422p10le -map "[audio]" -c:a pcm_s24le "G:\%~n1_25to23976_test44.mov" -y
I'm going through the ffprobe commandline entry by entry but I'm uncertain what function the "| wc -l" is performing as the ffprobe manual doesn't have an entry for "wc".
It seems this is a counting function within linux. This is likely why my command is failing!
I am trying to concatenate 3 videos of different resolutions and overlaying 2 videos as transition effects(though the chroma key color removal is not yet implemented) between videos using below command:
ffmpeg
-i input1.mp4
-i input2.mp4
-i input3.mp4
-i transition1.mp4
-i transition2.mp4
-filter_complex
"[0:v]pad=width=1080:height=1920:x=(1080-iw)*0.5:y=(1920-ih)*0.5:color=black[video0];
[1:v]pad=width=1080:height=1920:x=(1080-iw)*0.5:y=(1920-ih)*0.5:color=black[video1];
[2:v]pad=width=1080:height=1920:x=(1080-iw)*0.5:y=(1920-ih)*0.5:color=black[video2];
[video0][video1][video2]concat=n=3:v=1:a=0[outv];
[3:v]scale=w=1080:h=1920[t0];
[4:v]scale=w=1080:h=1920[t1];
[outv][t0]overlay=enable='between(t,6.6045,9.6335)'[out0];
[out0][t1]overlay=enable='between(t,12.5655,15.6165)'[out1];
[0:a][1:a][2:a]concat=n=3:v=0:a=1[audio]"
-c:v libx264 -pix_fmt yuv420p -map [out1] -map [audio] -preset ultrafast output.mp4
I get success only with few videos. Most of the times the command execution never stops. It keeps on appending something to the output video file even for hours. Here is the output from console:
ffmpeg version v4.4-dev-416
Copyright (c) 2000-2020 the FFmpeg developers
built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --extra-libs='-L/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec
libavutil 56. 55.100 / 56. 55.100
libavcodec 58. 96.100 / 58. 96.100
libavformat 58. 48.100 / 58. 48.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input1.mp4':
Metadata:
major_brand :
mp42
minor_version :
0
compatible_brands:
isommp42
creation_time :
2020-08-12T17:21:49.000000Z
com.android.version:
9
Duration:
00:00:08.12
, start:
0.000000
, bitrate:
17298 kb/s
Stream #0:0
(eng)
: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 16309 kb/s
, SAR 1:1 DAR 16:9
,
28.70 fps,
29.50 tbr,
90k tbn,
60 tbc
(default)
Metadata:
rotate :
90
creation_time :
handler_name :
VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1
(eng)
: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s
(default)
Metadata:
creation_time :
2020-08-12T17:21:49.000000Z
handler_name :
SoundHandle
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'input2.mp4':
Metadata:
major_brand :
isom
minor_version :
512
compatible_brands:
isomiso2avc1mp41
encoder :
Lavf57.25.100
Duration:
00:00:05.97
, start:
0.000000
, bitrate:
770 kb/s
Stream #1:0
(und)
: Audio: aac (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 128 kb/s
(default)
Metadata:
handler_name :
SoundHandler
Stream #1:1
(und)
: Video: h264 (avc1 / 0x31637661), yuv420p, 368x480, 608 kb/s
,
27.29 fps,
120 tbr,
12k tbn,
60 tbc
(default)
Metadata:
handler_name :
VideoHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'input3.mp4':
Metadata:
major_brand :
isom
minor_version :
512
compatible_brands:
isomiso2avc1mp41
encoder :
Lavf55.19.104
Duration:
00:00:13.05
, start:
0.000000
, bitrate:
2453 kb/s
Chapter #2:0:
start 0.000000,
end 13.033000
Metadata:
title :
Stream #2:0
(und)
: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
(default)
Metadata:
handler_name :
SoundHandler
Stream #2:1
(und)
: Video: h264 (avc1 / 0x31637661), yuv420p, 640x480, 2320 kb/s
,
25 fps,
25 tbr,
1200k tbn,
50 tbc
(default)
Metadata:
handler_name :
VideoHandler
Stream #2:2
(eng)
: Data: bin_data (text / 0x74786574), 0 kb/s
Metadata:
handler_name :
SubtitleHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'transition1.mp4':
Metadata:
major_brand :
mp42
minor_version :
0
compatible_brands:
mp41isom
creation_time :
2020-08-17T09:31:23.000000Z
Duration:
00:00:03.03
, start:
0.000000
, bitrate:
6263 kb/s
Stream #3:0
(und)
: Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 6307 kb/s
,
30 fps,
30 tbr,
30k tbn,
60 tbc
(default)
Metadata:
creation_time :
handler_name :
VideoHandler
encoder :
AVC Coding
Stream #3:1
(und)
: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 79 kb/s
(default)
Metadata:
creation_time :
2020-08-17T09:31:23.000000Z
handler_name :
SoundHandler
Input #4, mov,mp4,m4a,3gp,3g2,mj2, from 'transition2.mp4':
Metadata:
major_brand :
mp42
minor_version : 0
compatible_brands:
mp41isom
creation_time :
2020-08-17T09:30:33.000000Z
Duration:
00:00:03.05
, start:
0.000000
, bitrate:
7828 kb/s
Stream #4:0
(und)
: Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 7873 kb/s
,
30 fps,
30 tbr,
30k tbn,
60 tbc
(default)
Metadata:
creation_time :
2020-08-17T09:30:33.000000Z
handler_name :
VideoHandler
encoder :
AVC Coding
Stream #4:1
(und)
: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 79 kb/s
(default)
Metadata:
creation_time :
2020-08-17T09:30:33.000000Z
handler_name :
SoundHandler
Stream mapping:
Stream #0:0 (h264) -> pad
Stream #0:1 (aac) -> concat:in0:a0
Stream #1:0 (aac) -> concat:in1:a0
Stream #1:1 (h264) -> pad
Stream #2:0 (aac) -> concat:in2:a0
Stream #2:1 (h264) -> pad
Stream #3:0 (h264) -> scale
Stream #4:0 (h264) -> scale
overlay
-> Stream #0:0 (libx264)
concat
-> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 # 0x733a19a900] sws_param option is deprecated and ignored
[graph 0 input from stream 1:1 # 0x733a19aa80] sws_param option is deprecated and ignored
[graph 0 input from stream 2:1 # 0x733a19ab40] sws_param option is deprecated and ignored
[graph 0 input from stream 3:0 # 0x733a19ac00] sws_param option is deprecated and ignored
[graph 0 input from stream 4:0 # 0x733a19acc0] sws_param option is deprecated and ignored
[mp4 # 0x733a679400] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
[libx264 # 0x733a1b0600] using SAR=1/1
[libx264 # 0x733a1b0600] MB rate (8160000000) > level limit (16711680)
[libx264 # 0x733a1b0600] using cpu capabilities: ARMv8 NEON
[libx264 # 0x733a1b0600] profile Constrained Baseline, level 6.2, 4:2:0, 8-bit
[libx264 # 0x733a1b0600] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand :
mp42
minor_version :
0
compatible_brands:
isommp42
com.android.version:
9
encoder :
Lavf58.48.100
Chapter #0:0:
start 0.000000,
end 13.033000
Metadata:
title :
Stream #0:0
: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1080x1920 [SAR 1:1 DAR 9:16], q=-1--1
,
1000k tbn,
1000k tbc
(default)
Metadata:
encoder :
Lavc58.96.100 libx264
Side data:
cpb:
bitrate max/min/avg: 0/0/0 buffer size: 0
vbv_delay: N/A
Stream #0:1
: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
(default)
Metadata:
encoder :
Lavc58.96.100 aac
E/Progress: Progress: 3.6918316
D/mobile-ffmpeg: Progress: frame: 1, time: 1002, Pct: 0.036918
frame= 1 fps=0.0 q=0.0 size= 0kB time=00:00:01.00 bitrate= 0.5kbits/s speed=1.79x
More than 1000 frames duplicated
I even tried command without overlay and audio parts but result was same. I am working on Android app and using below ffmpeg wrapper library:
https://github.com/tanersener/mobile-ffmpeg
The concat filter can reset the frame rate of the output video stream to the stream time base. This can cause mass frame duplication, which will slow down ffmpeg a lot, making it look like ffmpeg is stuck.
Add -vsync 0 to prevent frame duplication.
I have 5 mp4 input videos (audio+video) that I want to 'join' into a single output video with a crossfade effect in between each pair of videos.
I want to 'crossfade' both the audio and the video, with a transition of 0.4s.
(Not an actual crossfade, more like video-2 fades in over video-1, video-1 does not need to fade out, but this is not the problem)
I'm using ffmpeg-4.1.3-win64-static
I have followed many tutorials and answers from here, but there are so many different ways to do it...
Each one of the 5 videos is 1.024s long, duration obtained with ffprobe
ffprobe.exe -i "0.mp4" -show_entries format=duration -v quiet -of csv="p=0"
This is the command for both audio and video:
(I've reformatted the command so it is easier to read, it is issued as a single line in the command prompt)
ffmpeg.exe -y -i "0.mp4" -i "1.mp4" -i "2.mp4" -i "3.mp4" -i "4.mp4"
-filter_complex "
[0:v]setpts=PTS-STARTPTS[v1];
[1:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(0.6/TB)[v2];
[2:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(1.2/TB)[v3];
[3:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(1.8/TB)[v4];
[4:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(2.4/TB)[v5];
[v1][v2]overlay[u1];[u1][v3]overlay[u2];[u2][v4]overlay[u3];[u3][v5]overlay,format=yuv420p[v];
[0][1]acrossfade=d=0.4[a0];
[a0][2]acrossfade=d=0.4[a1];
[a1][3]acrossfade=d=0.4[a2];
[a2][4]acrossfade=d=0.4[a]
" -map [v] -map [a] "output.mp4"
When I do both audio and video into a single output file, output.mp4 can not be played on VLC, this is the vlc log:
main debug: `file:///C:/project/input-videos/output.mp4' gives access `file' demux `any' path `/C:project/input-videos/output.mp4'
main debug: creating demux: access='file' demux='any' location='/C:/project/input-videos/output.mp4' file='C:\project\input-videos\output.mp4'
main debug: looking for access_demux module matching "file": 15 candidates
main debug: no access_demux modules matched
main debug: creating access: file:///C:/project/input-videos/output.mp4
main debug: (path: C:\project\input-videos\output.mp4)
main debug: looking for access module matching "file": 26 candidates
main debug: using access module "filesystem"
main debug: looking for stream_filter module matching "prefetch,cache_read": 24 candidates
cache_read debug: Using stream method for AStream*
cache_read debug: starting pre-buffering
cache_read error: cannot pre fill buffer
main debug: looking for meta fetcher module matching "any": 1 candidates
main debug: no stream_filter modules matched
main warning: cannot insert stream filter prefetch,cache_read
main debug: looking for stream_filter module matching "any": 24 candidates
playlist debug: not enough data
...
This is the output from ffmpeg:
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.3.1 (GCC) 20190414
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '0.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
location-eng : +52.6899-001.8293/
location : +52.6899-001.8293/
Duration: 00:00:01.02, start: 0.000000, bitrate: 13821 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 14002 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : SoundHandle
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
location-eng : +53.4256-001.3580/
location : +53.4256-001.3580/
Duration: 00:00:01.02, start: 0.000000, bitrate: 7094 kb/s
Stream #1:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 7113 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandle
Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : SoundHandle
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
location-eng : +53.3927-001.5044/
location : +53.3927-001.5044/
Duration: 00:00:01.02, start: 0.000000, bitrate: 7367 kb/s
Stream #2:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 7394 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandle
Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)
Metadata:
handler_name : SoundHandle
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '3.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
location-eng : +53.3927-001.5044/
location : +53.3927-001.5044/
Duration: 00:00:01.02, start: 0.000000, bitrate: 8145 kb/s
Stream #3:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 8192 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandle
Stream #3:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandle
Input #4, mov,mp4,m4a,3gp,3g2,mj2, from '4.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
location-eng : +53.3927-001.5044/
location : +53.3927-001.5044/
Duration: 00:00:01.02, start: 0.000000, bitrate: 6241 kb/s
Stream #4:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2224x1080 [SAR 1:1 DAR 278:135], 6241 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandle
Stream #4:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)
Metadata:
handler_name : SoundHandle
Stream mapping:
Stream #0:0 (h264) -> setpts
Stream #0:1 (aac) -> acrossfade:crossfade0
Stream #1:0 (h264) -> format
Stream #1:1 (aac) -> acrossfade:crossfade1
Stream #2:0 (h264) -> format
Stream #2:1 (aac) -> acrossfade:crossfade1
Stream #3:0 (h264) -> format
Stream #3:1 (aac) -> acrossfade:crossfade1
Stream #4:0 (h264) -> format
Stream #4:1 (aac) -> acrossfade:crossfade1
format -> Stream #0:0 (libx264)
acrossfade -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
When I do the video only it is fine. The duration of the output.mp4 file generated for video-only is 3.4s
When I do the audio only it is also fine. The duration of the output.mp4 file generated for audio-only is 3.435s
This is the command for video only:
ffmpeg.exe -y -i "0.mp4" -i "1.mp4" -i "2.mp4" -i "3.mp4" -i "4.mp4"
-filter_complex "
[0:v]setpts=PTS-STARTPTS[v1];
[1:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(0.6/TB)[v2];
[2:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(1.2/TB)[v3];
[3:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(1.8/TB)[v4];
[4:v]format=yuva420p,fade=in:st=0:d=0.4:alpha=1,setpts=PTS-STARTPTS+(2.4/TB)[v5];
[v1][v2]overlay[u1];[u1][v3]overlay[u2];[u2][v4]overlay[u3];[u3][v5]overlay,format=yuv420p[v]
" -map [v] "output.mp4"
This is the command for audio only:
ffmpeg.exe -y -i "0.mp4" -i "1.mp4" -i "2.mp4" -i "3.mp4" -i "4.mp4"
-filter_complex "
[0][1]acrossfade=d=0.4[a0];
[a0][2]acrossfade=d=0.4[a1];
[a1][3]acrossfade=d=0.4[a2];
[a2][4]acrossfade=d=0.4[a]
" -map [a] "output.mp4"
What am I missing in order to generate one output file with both audio and video content?
Edit: Here's the full ffmpeg command + result for audio and video combined with "-loglevel debug" added. (Too big to add directly here, so I've added it to Pastebin)
https://pastebin.com/NLBc7Abb
Work Around
Not a solution, but I found a work around:
Create video only output using command above, output to video.mp4
Create audio only output using command above, output to audio.mp4
Merge both video.mp4 and audio.mp4 into output.mp4 using the following command:
ffmpeg.exe -y -i "video.mp4" -i "audio.mp4" -c:v copy -c:a aac output.mp4
If anyone has any ideas as to why the combined audio+video command does not work, please let me know. :)
I use Skype Call Recorder to record Skype interviews. The app saves files in .mov format, with 2 audio channels.
When I submit these files for transcription, they always come back with just one channel transcribed.
I need to 1.) merge the tracks, and 2.) convert the .mov file to .mp3 format.
Right now the command I'm working with is:
ffmpeg -i input.mov -map 0:a output.mp3
I get the following errors:
Invalid audio stream. Exactly one MP3 audio stream is required.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
What am I missing?
Here's the full console output, if it helps:
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2019-05-18 15:00:59
Duration: 00:11:41.82, start: 0.000000, bitrate: 120 kb/s
Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 58 kb/s (default)
Metadata:
creation_time : 2019-05-18 15:00:59
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 58 kb/s (default)
Metadata:
creation_time : 2019-05-18 15:00:59
handler_name : Apple Alias Data Handler
[mp3 # 0x7fd8b1003c00] Invalid audio stream. Exactly one MP3 audio stream is required.
Output #0, mp3, to 'output.mp3':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
encoder : Lavf56.25.101
Stream #0:0(eng): Audio: mp3 (libmp3lame), 44100 Hz, mono, fltp (default)
Metadata:
creation_time : 2019-05-18 15:00:59
handler_name : Apple Alias Data Handler
encoder : Lavc56.26.100 libmp3lame
Stream #0:1(eng): Audio: mp3 (libmp3lame), 44100 Hz, mono, fltp (default)
Metadata:
creation_time : 2019-05-18 15:00:59
handler_name : Apple Alias Data Handler
encoder : Lavc56.26.100 libmp3lame
Stream mapping:
Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))
Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Two mono streams to mono
Use the amix filter:
ffmpeg -i input.mov -filter_complex "[0:a]amix=inputs=2" output.mp3
Two mono streams to stereo
Use the join or amerge filters:
ffmpeg -i input.mov -filter_complex "[0:a]join=inputs=2:channel_layout=stereo" output.mp3
Also see FFmpeg Wiki: Audio Channel Manipulation.
I'm trying to stream avideo file to localhost http stream.
my ffmpeg version details:
ffmpeg version N-64307-g8657612 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 29 2014 22:09:38 with gcc 4.8.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-
libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libope
njpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsox
r --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab -
-enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-
libxavs --enable-libxvid --enable-decklink --enable-zlib
libavutil 52. 90.101 / 52. 90.101
libavcodec 55. 68.100 / 55. 68.100
libavformat 55. 44.100 / 55. 44.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 9.100 / 4. 9.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfi
le}...
when I use:
C:\Users\USER>ffmpeg -re -i myfile.mp4 -f flv udp://localhost:1234
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myfile.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.44.100
compilation : 0
Duration: 00:00:04.17, start: 0.036281, bitrate: 268 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [
SAR 1:1 DAR 4:3], 132 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 12
8 kb/s (default)
Metadata:
handler_name : SoundHandler
[flv # 00000000003fc780] Using AVStream.codec.time_base as a timebase hint to th
e muxer is deprecated. Set AVStream.time_base instead.
Last message repeated 1 times
Output #0, flv, to 'udp://localhost:1234':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
compilation : 0
encoder : Lavf55.44.100
Stream #0:0(und): Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 640x48
0 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc55.68.100 flv
Stream #0:1(und): Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz,
stereo, fltp (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc55.68.100 libmp3lame
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> flv1 (flv))
Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
frame= 5 fps=0.0 q=2.0 size= 32kB time=00:00:00.44 bitrate= 591.6kbits/s
frame= 18 fps= 18 q=3.6 size= 77kB time=00:00:00.94 bitrate= 668.8kbits/s
frame= 30 fps= 20 q=8.4 size= 115kB time=00:00:01.46 bitrate= 642.5kbits/s
its working.
but when I use http:
C:\Users\USER>ffmpeg -re -i myfile.mp4 -f flv http://localhost:1234
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myfile.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.44.100
compilation : 0
Duration: 00:00:04.17, start: 0.036281, bitrate: 268 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [
SAR 1:1 DAR 4:3], 132 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 12
8 kb/s (default)
Metadata:
handler_name : SoundHandler
http://localhost:1234: Input/output error
I get Input/output error.
in linux its working with ffserver.
but in windows I get this exception.
You are using two different protocols (udp and http) so the outcome of the command is different.
Like Ross said in the comments : "UDP doesn't know or care if there is anything to receive the packets. If there's nothing there ffmpeg won't know and so won't complain".
FFserver is a different command to FFmpeg hence the different outputs.
Linux will behave differently according to distribution. Windows will also behave differently.
It would be easier for us to answer the question if you added a question mark to your question with a phrase summarising what you want to know.