ffmpeg stops reading rtsp livestream after some seconds - ffmpeg

I'm trying to save locally a rtsp livestream with ffmpeg but it stops after a few seconds. It works smooth, but suddently it just stops, more or less always after 10-15 seconds.
This is the command:
ffmpeg -rtsp_transport tcp -i rtsp://xxx.xxx.xxx.xxx:554/test.sdp -c copy test.ts
And this is the log. I tried with previous ffmpeg versions with the same result:
ffmpeg version git-2020-04-26-1128aa8 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200328
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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 43.100 / 56. 43.100
libavcodec 58. 82.100 / 58. 82.100
libavformat 58. 42.101 / 58. 42.101
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 79.100 / 7. 79.100
libswscale 5. 6.101 / 5. 6.101
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, rtsp, from 'rtsp://xxx.xxx.xxx.xxx:554/test.sdp':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p(top first), 1920x1080, 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1: Audio: aac (LC), 48000 Hz, 4.0, fltp
Output #0, mpegts, to 'test.ts':
Metadata:
encoder : Lavf58.42.101
Stream #0:0: Video: h264 (Main), yuv420p(top first), 1920x1080, q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
Stream #0:1: Audio: aac (LC), 48000 Hz, 4.0, fltp
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 387 fps= 21 q=-1.0 Lsize= 18405kB time=00:00:16.91 bitrate=8912.2kbits/s speed=0.923x
video:17295kB audio:575kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.993069%
Debug shows also "No more output streams to write to, finishing" when it stops.
Could you help me, please? I don't know what else to try... Thank you.

Related

ffmpeg At least one output file must be specified error

How can i fix this ;( help me....
it works well if i tpye only "'ffmpeg -i ' + video_path + ' -q:v 2 -f image2 ' + frame_path + '\image_%6d.jpg'" on prompt with specific path name.
but it doesn't work in .py (i used code in .py-> os.system('ffmpeg -i ' + video_path + ' -q:v 2 -f image2 ' + frame_path + '\image_%6d.jpg')
'''
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.1 (GCC) 20200726
configuration: --disable-static --enable-shared --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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
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
[mov,mp4,m4a,3gp,3g2,mj2 # 000002629ef05540] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\dataset\Videos\Arrest\Arrest007_x264.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
track : 0
artist :
album :
date : 0
genre :
lyrics :
title :
encoder : Lavf56.36.100
Duration: 00:01:44.84, start: 0.000000, bitrate: 1499 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 1387 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 105 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2: Video: png, rgb24(pc), 58x38 [SAR 304:261 DAR 16:9], 90k tbr, 90k tbn, 90k tbc (attached pic)
At least one output file must be specified
'''
Make use of helpful (& more secure) built-in packages/functions:
from os import path
import subprocess as sp
sp.run(['ffmpeg','-i', video_path,
'-q:v','2','-f','image2',
path.join(frame_path,'image_%6d.jpg')])
I suspect your call went nuts because of unescaped backslashes in the file paths. subprocess.run essentially avoids that nastiness from making a system call.

How to make ffmpeg re-encode an vp9 webm with alpha into a vp9 webm with alpha

I am trying to find optimal parameters for encoding a transparent video using ffmpeg in my scenario, and as a test, I have been re-encoding a pre-made transparent .webm (vp9 with alpha channel, made using python vidgear) like this:
$ /usr/bin/ffmpeg -i pre-made.webm pre-made-remade.webm
ffmpeg version 4.3.2-0york0~18.04 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version='0york0~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libzimg --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, matroska,webm, from 'pre-made.webm':
Metadata:
ENCODER : Lavf58.45.100
Duration: 00:01:11.04, start: 0.000000, bitrate: 1107 kb/s
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv), 1514x1910, SAR 1:1 DAR 757:955, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
Metadata:
alpha_mode : 1
ENCODER : Lavc58.91.100 libvpx-vp9
DURATION : 00:01:11.040000000
Stream mapping:
Stream #0:0 -> #0:0 (vp9 (native) -> vp9 (libvpx-vp9))
Press [q] to stop, [?] for help
[libvpx-vp9 # 0x55927254b0c0] v1.7.0
[libvpx-vp9 # 0x55927254b0c0] Neither bitrate nor constrained quality specified, using default CRF of 32
Output #0, webm, to 'pre-made-remade.webm':
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: vp9 (libvpx-vp9), yuv420p, 1514x1910 [SAR 1:1 DAR 757:955], q=-1--1, 25 fps, 1k tbn, 25 tbc (default)
Metadata:
alpha_mode : 1
DURATION : 00:01:11.040000000
encoder : Lavc58.91.100 libvpx-vp9
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 1776 fps=8.9 q=0.0 Lsize= 6159kB time=00:01:11.00 bitrate= 710.6kbits/s speed=0.354x
video:6146kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.214488%
According to the ffmpeg logs, the libvpx-vp9 is correctly being chosen, and alpha_mode is 1, which bodes well.
However, when actually viewing the video, the video is no longer trasparent.
How could I force ffmpeg to keep the alpha channel when re-encoding the video? (This also applies when trying to merge audio into the .webm)
Bonus question: what arguments do you recommend for efficient vp9 encoding? I have tried using -threads 16 -speed 4 -tile-columns 6 -frame-parallel 1 -row-mt 1 but it seems to fail at fully utilizing all my CPU cores when encoding with the alpha channel (when piping frames from my python script).
See the line
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv) ...
The yuv420p indicates that ffmpeg hasn't detected alpha in the input, else it would be yuva420p. To export alpha from VP9 streams, you need to use libvpx decoders, so
ffmpeg -c:v libvpx-vp9 -i pre-made.webm ...

how to conver a m4v(mpeg) codec raw video to a mp4 file which can be played?

I uses the following command that can extract the mpeg4 raw video file:
ffmpeg -i D:\mp4v-mp4\test\360.mov -vcodec copy -an -f rawvideo D:\mp4v-mp4\test\360CmdSplit_std.dat
but how can I convert the rawvideo file back to a playable mp4 file.
I have tried the follow cmd, but failed:
ffmpeg -y -f m4v -i D:\mp4v-mp4\test\360CmdSplit_std1.dat -vcodec copy D:\mp4v-mp4\test\tmp360.mp4
the first cmd(extract the raw mp4v video) is success,logs:
D:\install\ffmpeg-4.3.1-essentials_build\bin>ffmpeg.exe -i D:\mp4v-mp4\MOV\360(mp4v_aac).mov -vcodec copy -an -f rawvideo D:\mp4v-mp4\MOV\360mov_std.dat
ffmpeg version 4.3.1-essentials_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev1, 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-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 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 'D:\mp4v-mp4\MOV\360(mp4v_aac).mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.17.101
Duration: 00:00:52.08, start: 0.000000, bitrate: 408 kb/s
Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 360x240 [SAR 1:1 DAR 3:2], 277 kb/s, 24 fps, 24 tbr, 12288 tbn, 24 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.22.101 mpeg4
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
Output #0, rawvideo, to 'D:\mp4v-mp4\MOV\360mov_std.dat':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.45.100
Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 360x240 [SAR 1:1 DAR 3:2], q=2-31, 277 kb/s, 24 fps, 24 tbr, 24 tbn, 24 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.22.101 mpeg4
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 1250 fps=0.0 q=-1.0 Lsize= 1764kB time=00:00:52.08 bitrate= 277.5kbits/s speed=1.47e+03x
video:1764kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
convert the rawvideo file back to a playable mp4 file,failed:
D:\install\ffmpeg-4.3.1-essentials_build\bin>ffmpeg -y -f m4v -i D:\mp4v-mp4\MOV\360mov_std.dat -vcodec copy D:\mp4v-mp4\MOV\tmp360.mp4
ffmpeg version 4.3.1-essentials_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev1, 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-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 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
[mpeg4 # 00000214e53d47c0] time_increment_bits 0 is invalid in relation to the current bitstream, this is likely caused by a missing VOL header
[mpeg4 # 00000214e53d47c0] time_increment_bits set to 5 bits, based on bitstream analysis
[mpeg4 # 00000214e53d47c0] time_increment_bits 4 is invalid in relation to the current bitstream, this is likely caused by a missing VOL header
[mpeg4 # 00000214e53d47c0] time_increment_bits set to 5 bits, based on bitstream analysis
[mpeg4 # 00000214e53d47c0] looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[m4v # 00000214e53cab40] decoding for stream 0 failed
[m4v # 00000214e53cab40] Could not find codec parameters for stream 0 (Video: mpeg4, yuv420p): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, m4v, from 'D:\mp4v-mp4\MOV\360mov_std.dat':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mpeg4, yuv420p, 25 fps, 25 tbr, 1200k tbn, 25 tbc
[mp4 # 00000214e543a840] dimensions not set
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Last message repeated 1 times

FFMPEG refuses to reencode vp9 via h264_nvenc

Using Windows, FFMPEG throws an error when reencoding vp9/opus .webm video into h264_nvenc/aac.
The issue is within trying to reencode via h264_nvenc, as using libx264 works just fine.
h264_nvenc works just fine when reencoding h264.
PS C:\Users\Уруру2\Videos> ffmpeg -i soad.webm -c:a aac -c:v h264_nvenc soad.mp4
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.1 (GCC) 20200726
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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
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, matroska,webm, from 'soad.webm':
Metadata:
ENCODER : Lavf58.29.100
Duration: 00:05:07.70, start: -0.007000, bitrate: 14732 kb/s
Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709), 7372x3024, SAR 1:1 DAR 1843:756, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
Metadata:
DURATION : 00:05:07.682000000
Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Metadata:
DURATION : 00:05:07.701000000
File 'soad.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (vp9 (native) -> h264 (h264_nvenc))
Stream #0:1 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
[h264_nvenc # 0000029fd34e3400] Width 7372 exceeds 4096
[h264_nvenc # 0000029fd34e3400] No capable devices found
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
[aac # 0000029fd34e4b40] Qavg: 12400.245
[aac # 0000029fd34e4b40] 2 frames left in the queue on closing
Conversion failed!
The error happened not because of vp9, but rather the width of the video.
h264_nvenc does not support width or height above 4096. My solution was to scale the video down from the original 7372x3024 to 3686x1512 using -vf parameter.
The final command is
ffmpeg -i soad.webm -c:a aac -c:v h264_nvenc -vf scale=3686:1512,setsar=1:1 soad.mp4

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