FFMPEG Metadata Extraction Fails - ffmpeg

I have a little issue with FFMPEG on Windows:
ffmpeg version 4.4-full_build-www_gyan_dev Copyright (c) 2000-2021 the FFmpeg developers
I Have got a video and a zip file to embed in the container as metadata
I encoded source files with the command
.\ffmpeg.exe -y -i D:\TestVideo3_T0.mkv -map 0 -attach .\TestVideo3_Merged_Meta.zip -metadata:s:t mimetype=application/zip -c:v copy D:\TestVideo3_Merged.mkv
Result of encoded data:
Input #0, matroska,webm, from 'D:\TestVideo3_T0.mkv':
Metadata:
ENCODER : Lavf58.76.100
Duration: 00:00:02.00, start: 0.000000, bitrate: 4461 kb/s
Stream #0:0: Video: hevc (Rext), gbrp(pc, gbr/unknown/unknown, progressive), 2048x1536, 10 fps, 10 tbr, 1k tbn, 10 tbc (default)
Metadata:
ENCODER : Lavc58.134.100 libx265
DURATION : 00:00:02.000000000
Output #0, matroska, to 'D:\TestVideo3_Merged.mkv':
Metadata:
encoder : Lavf58.76.100
Stream #0:0: Video: hevc (Rext), gbrp(pc, gbr/unknown/unknown, progressive), 2048x1536, q=2-31, 10 fps, 10 tbr, 1k tbn, 1k tbc (default)
Metadata:
ENCODER : Lavc58.134.100 libx265
DURATION : 00:00:02.000000000
Stream #0:1: Attachment: none
Metadata:
filename : .\TestVideo3_Merged_Meta.zip
mimetype : application/zip
Stream mapping:
Stream #0:0 -> #0:0 (copy)
File .\TestVideo3_Merged_Meta.zip -> Stream #0:1
Press [q] to stop, [?] for help
frame= 20 fps=0.0 q=-1.0 Lsize= 3473kB time=00:00:01.70 bitrate=16727.1kbits/s speed= 554x
video:1086kB audio:0kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 219.801529%
When I analyze the output file I can find the zip file embedded on the mkv video.
Deconding the file seems not working. (I tries -dump_attacment:s :s:t :t, ecc...)
.\ffmpeg -y -i .\TestVideo3_Merged.mkv -dump_attachment:t .\Meta.zip
ffmpeg version 4.4-full_build-www_gyan_dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, 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-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --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-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Trailing option(s) found in the command: may be ignored.
[matroska,webm # 0000023ddd5cf880] Could not find codec parameters for stream 1 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, matroska,webm, from '.\TestVideo3_Merged.mkv':
Metadata:
ENCODER : Lavf58.76.100
Duration: 00:00:02.00, start: 0.000000, bitrate: 14226 kb/s
Stream #0:0: Video: hevc (Rext), gbrp(pc, gbr/unknown/unknown, progressive), 2048x1536, 10 fps, 10 tbr, 1k tbn, 10 tbc (default)
Metadata:
ENCODER : Lavc58.134.100 libx265
DURATION : 00:00:02.000000000
Stream #0:1: Attachment: none
Metadata:
filename : .\TestVideo3_Merged_Meta.zip
mimetype : application/zip
At least one output file must be specified
PS D:\> .\ffmpeg -y -i .\TestVideo3_Merged.mkv -dump_attachment:s:t .\Meta.zip
ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, 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-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --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-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Trailing option(s) found in the command: may be ignored.
[matroska,webm # 000002492afef7c0] Could not find codec parameters for stream 1 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, matroska,webm, from '.\TestVideo3_Merged.mkv':
Metadata:
ENCODER : Lavf58.76.100
Duration: 00:00:02.00, start: 0.000000, bitrate: 14226 kb/s
Stream #0:0: Video: hevc (Rext), gbrp(pc, gbr/unknown/unknown, progressive), 2048x1536, 10 fps, 10 tbr, 1k tbn, 10 tbc (default)
Metadata:
ENCODER : Lavc58.134.100 libx265
DURATION : 00:00:02.000000000
Stream #0:1: Attachment: none
Metadata:
filename : .\TestVideo3_Merged_Meta.zip
mimetype : application/zip
At least one output file must be specified
Can anyone give a hint to solve this problem?
Thanks in advance

-dump_attachment goes before the input with the attachment.
ffmpeg -y -dump_attachment:t .\Meta.zip -i .\TestVideo3_Merged.mkv

Related

How to decode two Dolby E audio streams simultaneously with ffmpeg?

I'm trying to decode 2 Dolby-E audio streams simultaneously.
ffmpeg -non_pcm_mode copy -i C:\vlc-record.ts -map 0:3 -map 0:4 -c:a pcm_s24le -f s24le - | ffplay -
Using -map 0:3 it works for one at a time but when I add the second one -map 0:4 it only process the first one and there is just one stream on my dolby_e output pipe.
Is there a way to create a two streams multicanal non-pcm output from 2 Dolbys PCM streams ?
I tried to find a solution with named pipe but it seems like windows command line doesn't accept this. I also tried to merge the PCM streams but then it says Invalid data found when processing input.
I can't make it with 2 pass because I'll be using it with udp live video streams.
ffmpeg version 2022-03-07-git-e645a1ddb9-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (Rev7, 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-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --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-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 57. 22.100 / 57. 22.100
libavcodec 59. 22.100 / 59. 22.100
libavformat 59. 17.103 / 59. 17.103
libavdevice 59. 5.100 / 59. 5.100
libavfilter 8. 27.100 / 8. 27.100
libswscale 6. 5.100 / 6. 5.100
libswresample 4. 4.100 / 4. 4.100
libpostproc 56. 4.100 / 56. 4.100
ffplay version 2022-03-07-git-e645a1ddb9-full_build-www.gyan.dev Copyright (c) 2003-2022 the FFmpeg developers
built with gcc 11.2.0 (Rev7, 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-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --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-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 57. 22.100 / 57. 22.100
libavcodec 59. 22.100 / 59. 22.100
libavformat 59. 17.103 / 59. 17.103
libavdevice 59. 5.100 / 59. 5.100
libavfilter 8. 27.100 / 8. 27.100
libswscale 6. 5.100 / 6. 5.100
libswresample 4. 4.100 / 4. 4.100
libpostproc 56. 4.100 / 56. 4.100
Input #0, mpegts, from 'C:\vlc-record.ts':
Duration: 00:00:15.76, start: 42530.445511, bitrate: 31505 kb/s
Program 1
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn
Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 256 kb/s
Stream #0:2: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 256 kb/s
Stream #0:3: Audio: s302m (BSSD / 0x44535342), stereo, s32 (20 bit), 2304 kb/s
Stream #0:4: Audio: s302m (BSSD / 0x44535342), stereo, s32 (20 bit), 2304 kb/s
Stream mapping:
Stream #0:3 -> #0:0 (s302m (native) -> pcm_s24le (native))
Press [q] to stop, [?] for help
Output #0, s24le, to 'pipe:':
Metadata:
encoder : Lavf59.17.103
Stream #0:0: Audio: pcm_s24le, 48000 Hz, stereo, s32 (20 bit), 2304 kb/s
Metadata:
encoder : Lavc59.22.100 pcm_s24le
[dolby_e # 0000026b16da0640] Stream has 2 programs (configuration 0), channels will be output in native order.
Input #0, s337m, from 'pipe:':
Duration: N/A, bitrate: N/A
Stream #0:0: Audio: dolby_e, 44800 Hz, 7.1, fltp
[dolby_e # 0000026b16d7ca80] Stream has 2 programs (configuration 0), channels will be output in native order.
1.25 M-A: 0.000 fd= 0 aq= 292KB vq= 0KB sq= 0B f=0/0
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
size= 1451kB time=00:00:05.20 bitrate=2286.3kbits/s speed=3.07x
video:0kB audio:1462kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Error closing file pipe:: Broken pipe
Conversion failed!

Why did i get an error when using this ffmpeg command for 2 pass?

F:\Project>ffmpeg -y -i 2.mp4 -b:v 18M -pass 1 -an -f null NUL && ^
More? ffmpeg -i 2.mp4 -b:v 18M -pass 2 -c:a aac -b:a 128k brdown1.mp4
Used this command and got the following error. Why? any help please
ffmpeg version 4.3.2-2021-02-02-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, 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-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --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-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.45.100
Duration: 10:00:36.00, start: 0.000000, bitrate: 40408 kb/s
Stream #0:0(eng): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 3840x2160, 40405 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)
Metadata:
handler_name : ?Mainconcept Video Media Handler
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, null, to 'NUL':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.45.100
Stream #0:0(eng): Video: wrapped_avframe, yuv420p, 3840x2160, q=2-31, 18000 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
Metadata:
handler_name : ?Mainconcept Video Media Handler
encoder : Lavc58.91.100 wrapped_avframe
frame=1080000 fps= 36 q=-0.0 Lsize=N/A time=10:00:36.00 bitrate=N/A speed=1.19x
video:565312kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
ffmpeg version 4.3.2-2021-02-02-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, 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-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --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-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.45.100
Duration: 10:00:36.00, start: 0.000000, bitrate: 40408 kb/s
Stream #0:0(eng): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 3840x2160, 40405 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)
Metadata:
handler_name : ?Mainconcept Video Media Handler
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 # 000002831478e040] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 000002831478e040] ratecontrol_init: can't open stats file
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
If you use the null muxer, you have to specify the encoder, since the default encoder of null muxer won't match that of the MP4 muxer.
ffmpeg -y -i 2.mp4 -c:v libx264 -b:v 18M -pass 1 -an -f null NUL
Alternatively, use the MP4 muxer but make sure to keep directing the output to NUL.
ffmpeg -y -i 2.mp4 -b:v 18M -pass 1 -an -f mp4 NUL

How to transfer video as rtp stream with least delay by FFmpeg

I use AXIS M1045-LW supporting rtsp/http access, and my Windows 10 PC can access to the camera through LAN.
I would like to transfer the video as rtp with keeping H.264 codec which is supported by the camera.
Image
[Camera] == (rtsp or http) ==> [FFmpeg on Win10] == (rtp) ==>
When I accessed the camera through Google Chrome on my Win10 PC, there is only 1 or 2 sec delay.
However, when I tried access by the following command, I found over 10 sec delay.
How could I reduce the delay as much as possible?
[Windows Command Prompt A ] (sender)
C:\Users\xxxx\ffmpeg-4.3.1-2020-11-19-full_build\bin>ffmpeg -re -i rtsp://xxx:xxx#xxx.xxx.xxx.xxx/axis-media/media.amp -codec:v copy -f rtp rtp://localhost:30002 -sdp_file stream.sdp
ffmpeg version 4.3.1-2020-11-19-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.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-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --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-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, rtsp, from 'rtsp://xxx:xxx#xxx.xxx.xxx.xxx/axis-media/media.amp':
Metadata:
title : Session streamed with GStreamer
comment : rtsp-server
Duration: N/A, start: 2.979633, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709, progressive), 320x240 [SAR 1:1 DAR 4:3], 2 fps, 25 tbr, 90k tbn, 4 tbc
Output #0, rtp, to 'rtp://localhost:30002':
Metadata:
title : Session streamed with GStreamer
comment : rtsp-server
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709, progressive), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 2 fps, 25 tbr, 90k tbn, 2 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[rtp # 000002da44da33c0] Non-monotonous DTS in output stream 0:0; previous: 0, current: -224986; changing to 0. This may result in incorrect timestamps in the output file.
[rtp # 000002da44da33c0] Non-monotonous DTS in output stream 0:0; previous: 0, current: -178194; changing to 0. This may result in incorrect timestamps in the output file.
[rtp # 000002da44da33c0] Non-monotonous DTS in output stream 0:0; previous: 0, current: -134998; changing to 0. This may result in incorrect timestamps in the output file.
[rtp # 000002da44da33c0] Non-monotonous DTS in output stream 0:0; previous: 0, current: -88201; changing to 0. This may result in incorrect timestamps in the output file.
[rtp # 000002da44da33c0] Non-monotonous DTS in output stream 0:0; previous: 0, current: -45002; changing to 0. This may result in incorrect timestamps in the output file.
frame= 89 fps=2.1 q=-1.0 size= 142kB time=00:00:43.01 bitrate= 27.0kbits/s speed= 1x
[Windows Command Prompt B ] (receiver)
C:\Users\xxx\ffmpeg-4.3.1-2020-11-19-full_build\bin>ffplay -protocol_whitelist "file,udp,rtp" stream.sdp
ffplay version 4.3.1-2020-11-19-full_build-www.gyan.dev Copyright (c) 2003-2020 the FFmpeg developers
built with gcc 10.2.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-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --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-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[sdp # 000001832f4ecec0] decoding for stream 0 failed 0B f=0/0
Input #0, sdp, from 'stream.sdp':
Metadata:
title : Session streamed with GStreamer
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709, progressive), 320x240 [SAR 1:1 DAR 4:3], 2 fps, 2 tbr, 90k tbn, 4 tbc
[swscaler # 0000018336868d00] deprecated pixel format used, make sure you did set range correctly
127.52 M-V: -0.021 fd= 12 aq= 0KB vq= 11KB sq= 0B f=0/0

FFmpeg: How can I loop a single frame of video to cover the length of audio track

I have a VOB file holding an MPEG-2 video track with an AC-3 audio track. The video track of that VOB file consists of a single frame, which when played in a DVD player, holds that still frame until the audio track has finished.
How can I (with FFMPEG ideally), loop that frame to make a "normal" video track that lasts for the length of the audio track, rather than just a single frame?
ffmpeg version N-91999-g148a21611d Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20180813
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. 19.101 / 56. 19.101
libavcodec 58. 30.100 / 58. 30.100
libavformat 58. 18.102 / 58. 18.102
libavdevice 58. 4.103 / 58. 4.103
libavfilter 7. 32.100 / 7. 32.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, mpeg, from '.\SINGLEFRAME.VOB':
Duration: 00:00:47.94, start: 0.336711, bitrate: 439 kb/s
Stream #0:0: Data: dvd_nav_packet
Stream #0:1: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], 8000 kb/s, 25 tbr, 90k tbn, 50 tbc
Stream #0:2: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s

FFMpeg is dropping video track when clipping an mpg video

I am extracting a clip from an mpg video using the following command.
ffmpeg.exe -i 271b.mpg -ss 00:00:05.000 -t 00:00:03.200 -c copy out_271b.mpg
I am using the copy parameter to avoid reencoding the clip.
The resulting mpg file only has the audio track, no video.
The following is the FFMpeg screen dump.
C:\ffmpeg-20170615\bin>ffmpeg.exe -i 271b.mpg -ss 00:00:05.000 -t 00:00:03.200 -c copy out_271b.mpg
ffmpeg version N-86482-gbc40674 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 66.100 / 55. 66.100
libavcodec 57. 99.100 / 57. 99.100
libavformat 57. 73.100 / 57. 73.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 92.100 / 6. 92.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mpeg, from '271b.mpg':
Duration: 00:01:11.44, start: 0.460000, bitrate: 2154 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg, progressive), 640x480 [SAR 1:1 DAR 4:3], 2000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
[mpeg # 0000000000666aa0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'out_271b.mpg':
Metadata:
encoder : Lavf57.73.100
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt470bg, progressive), 640x480 [SAR 1:1 DAR 4:3], q=2-31, 2000 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 74 fps=0.0 q=-1.0 Lsize= 786kB time=00:00:03.17 bitrate=2027.2kbits/s speed= 198x
video:730kB audio:50kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.843343%
Thanks
Addition: I tried to open the generated clip file with ffplay and got the following results. Note that ffplay was able to open and play the original mpg file.
ffplay.exe out_271b.mpg
ffplay version N-86482-gbc40674 Copyright (c) 2003-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 66.100 / 55. 66.100
libavcodec 57. 99.100 / 57. 99.100
libavformat 57. 73.100 / 57. 73.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 92.100 / 6. 92.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
[mpeg # 00000000023cde80] probed stream 2 failedB sq= 0B f=0/0
[mpeg # 00000000023cde80] start time for stream 0 is not set in estimate_timings_from_pts
[mpeg # 00000000023cde80] Could not find codec parameters for stream 2 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpeg, from 'out_271bb.mpg':
Duration: 00:00:03.22, start: 0.500000, bitrate: 2068 kb/s
Stream #0:0[0x1bf]: Data: dvd_nav_packet 0KB sq= 0B f=0/0
Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
Stream #0:2[0x1e0]: Video: none, none, 25 fps, 25 tbr, 90k tbn
SDL_OpenAudio (1 channels, 44100 Hz): DirectSoundCreate: No audio device found
No more combinations to try, audio open failed
No codec could be found with id 0
Failed to open file 'out_271b.mpg' or configure filtergraph

Resources