FFmpeg saving rtmp live stream cuts off after 3 minutes - ffmpeg

I was playing with ffmpeg and was able to save a live stream to a file. The command to do so is:
ffmpeg -re -i "rtmp://<ip addr>/livestream live=1" -f h264 test.flv
However, I have tested this twice, and both times ffmpeg stops after grabbing 3:28 worth of live video.
The entire output is here:
bash-4.2$ ffmpeg -re -i "rtmp://<ip addr>/livestream live=1" -vcodec libx264 -f h264 test.flv
WARNING: gnome-keyring:: couldn't connect to: /home/me/.cache/keyring-bpajcJ/pkcs11: No such file or directory
ffmpeg version 0.10.4 Copyright (c) 2000-2012 the FFmpeg developers
built on Jul 20 2012 22:01:52 with gcc 4.7.0 20120507 (Red Hat 4.7.0-5)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib --mandir=/usr/share/man --arch=i686 --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib --cpu=i686 --enable-runtime-cpudetect
libavutil 51. 35.100 / 51. 35.100
libavcodec 53. 61.100 / 53. 61.100
libavformat 53. 32.100 / 53. 32.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 61.100 / 2. 61.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
WARNING: gnome-keyring:: couldn't connect to: /home/me/.cache/keyring-bpajcJ/pkcs11: No such file or directory
Metadata:
videocodecid avc1
width 320.00
height 240.00
frameWidth 320.00
frameHeight 240.00
displayWidth 320.00
displayHeight 240.00
framerate 29.97
trackinfo:
timescale 90000.00
language eng
sampledescription:
sampletype H264
type video
profile-level-id 42e00c
sprop-parameter-sets Z0LgDNoFB+wEQAAC7sAAr8gh,aM4zyA==
description {H264CodecConfigInfo: profile: "Baseline", level: 1.2, frameSize: 320x240, displaySize: 320x240, PAR: 1:1, frameRate: 29.97}
rtpsessioninfo:
name H264 Stream 1
origin - 1486490083 118668671 IN IP4 10.93.183.3
timing 0 0
protocolversion 0
attributes:
range npt=now-
[flv # 0x9578ee0] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'rtmp://<ip addr>/livestream live=1':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 14.99 tbr, 1k tbn, 59.94 tbc
[buffer # 0x99ee900] w:320 h:240 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[libx264 # 0x9584540] using SAR=1/1
[libx264 # 0x9584540] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
[libx264 # 0x9584540] profile High, level 1.2
Output #0, h264, to 'test.flv':
Metadata:
encoder : Lavf53.32.100
Stream #0:0: Video: h264, yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=-1--1, 90k tbn, 14.99 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> libx264)
Press [q] to stop, [?] for help
RTMP_ReadPacket, failed to read RTMP packet body. len: 16582bitrate= 212.1kbits/s
frame= 3111 fps= 15 q=-2.0 Lsize= 5385kB time=00:03:27.47 bitrate= 212.6kbits/s
video:5385kB audio:0kB global headers:0kB muxing overhead 0.000000%
[libx264 # 0x9584540] frame I:13 Avg QP:18.70 size: 31866
[libx264 # 0x9584540] frame P:1908 Avg QP:22.29 size: 2392
[libx264 # 0x9584540] frame B:1190 Avg QP:29.24 size: 451
[libx264 # 0x9584540] consecutive B-frames: 39.5% 24.0% 13.0% 23.4%
[libx264 # 0x9584540] mb I I16..4: 0.2% 1.2% 98.6%
[libx264 # 0x9584540] mb P I16..4: 0.0% 0.0% 0.7% P16..4: 22.0% 3.5% 2.6% 0.0% 0.0% skip:71.2%
[libx264 # 0x9584540] mb B I16..4: 0.0% 0.0% 0.2% B16..8: 15.6% 2.8% 1.1% direct: 1.3% skip:78.9% L0:47.0% L1:42.2% BI:10.8%
[libx264 # 0x9584540] 8x8 transform intra:2.2% inter:8.5%
[libx264 # 0x9584540] coded y,uvDC,uvAC intra: 98.0% 94.9% 73.9% inter: 14.5% 16.0% 11.3%
[libx264 # 0x9584540] i16 v,h,dc,p: 0% 50% 17% 33%
[libx264 # 0x9584540] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 7% 21% 11% 3% 13% 6% 21% 4% 14%
[libx264 # 0x9584540] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 21% 14% 5% 11% 7% 14% 5% 12%
[libx264 # 0x9584540] i8c dc,h,v,p: 65% 15% 10% 10%
[libx264 # 0x9584540] Weighted P-Frames: Y:0.5% UV:0.1%
[libx264 # 0x9584540] ref P L0: 80.8% 10.4% 7.6% 1.2% 0.0%
[libx264 # 0x9584540] ref B L0: 94.9% 4.8% 0.2%
[libx264 # 0x9584540] ref B L1: 96.4% 3.6%
[libx264 # 0x9584540] kb/s:212.48
Although I don't see any errors. It just looks like ffmpeg thought the stream had ended? But that's not possible since it's a live stream.

This is most likely related to swf verification being performed on the server side (see 'swfVfy' flag). You could try something as follows and see if the stream gets further.
ffmpeg -i "rtmp:///livestream live=1 swfVfy=1 swfUrl=url_to_the flash_player_here" -y test.flv
Unfortunately though, in my case I could not get ffmpeg's swfVfy to work, and have exapmles of the same streams working fine with rtmpdump.

Related

Download M3U8 That Is Playable

I am trying to download a livestream from this traffic camera source: https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/playlist.m3u8
The ffmpeg I am using is:
ffmpeg -i https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/playlist.m3u8 -preset slow -codec:a libfdk_aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 4500k -minrate 4500k -maxrate 9000k -bufsize 9000k -vf scale=-1:720 test.mp4
And here are the logs when I quit the recording:
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with Apple clang version 13.1.6 (clang-1316.0.21.2)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
libavutil 57. 17.100 / 57. 17.100
libavcodec 59. 18.100 / 59. 18.100
libavformat 59. 16.100 / 59. 16.100
libavdevice 59. 4.100 / 59. 4.100
libavfilter 8. 24.100 / 8. 24.100
libswscale 6. 4.100 / 6. 4.100
libswresample 4. 3.100 / 4. 3.100
libpostproc 56. 3.100 / 56. 3.100
[hls # 0x1417050e0] Skip ('#EXT-X-VERSION:3')
[hls # 0x1417050e0] Opening 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/chunklist_w259023283.m3u8' for reading
[hls # 0x1417050e0] Skip ('#EXT-X-VERSION:3')
[hls # 0x1417050e0] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[hls # 0x1417050e0] Opening 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/media_w259023283_61526.ts' for reading
[hls # 0x1417050e0] Opening 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/media_w259023283_61527.ts' for reading
Input #0, hls, from 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/playlist.m3u8':
Duration: N/A, start: 65276.905822, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 142637
Stream #0:0: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 142637
Stream #0:1: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709), 480x270 [SAR 1:1 DAR 16:9], 15 fps, 15 tbr, 90k tbn
Metadata:
variant_bitrate : 142637
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler # 0x120248000] [swscaler # 0x120258000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x120278000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x120288000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x120298000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x1202a8000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x1202b8000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x1202c8000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x1202d8000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x1202e8000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x1202f8000] deprecated pixel format used, make sure you did set range correctly
[swscaler # 0x120248000] [swscaler # 0x120308000] deprecated pixel format used, make sure you did set range correctly
[libx264 # 0x14169ff30] using SAR=1/1
[libx264 # 0x14169ff30] using cpu capabilities: ARMv8 NEON
[libx264 # 0x14169ff30] profile High, level 3.1, 4:2:0, 8-bit
[libx264 # 0x14169ff30] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=15 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=15 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=4500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=9000 vbv_bufsize=9000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test.mp4':
Metadata:
encoder : Lavf59.16.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 4500 kb/s, 15 fps, 15360 tbn
Metadata:
variant_bitrate : 142637
encoder : Lavc59.18.100 libx264
Side data:
cpb: bitrate max/min/avg: 9000000/0/4500000 buffer size: 9000000 vbv_delay: N/A
[https # 0x13201ce00] Opening 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/media_w259023283_61528.ts' for reading
[https # 0x131814200] Opening 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/chunklist_w259023283.m3u8' for reading
[hls # 0x1417050e0] Skip ('#EXT-X-VERSION:3')
[hls # 0x1417050e0] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[https # 0x131814200] Opening 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/chunklist_w259023283.m3u8' for reading
[hls # 0x1417050e0] Skip ('#EXT-X-VERSION:3')
[hls # 0x1417050e0] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[https # 0x13201ce00] Opening 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/media_w259023283_61529.ts' for reading
[tls # 0x131606060] Error in the pull function.
[tls # 0x131606060] IO error: End of file
[hls # 0x1417050e0] Opening 'https://vss1live.dot.ga.gov/lo/alph-cam-002.stream/media_w259023283_61529.ts' for reading
^Cav_interleaved_write_frame(): Immediate exit requested93 bitrate=4697.0kbits/s speed=1.77x
Error writing trailer of test.mp4: Immediate exit requested
frame= 610 fps= 23 q=4.0 Lsize= 20224kB time=00:00:36.13 bitrate=4585.1kbits/s speed=1.35x
video:20500kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Error closing file test.mp4: Immediate exit requested
[libx264 # 0x14169ff30] frame I:3 Avg QP: 2.13 size:192240
[libx264 # 0x14169ff30] frame P:156 Avg QP: 0.44 size: 66488
[libx264 # 0x14169ff30] frame B:451 Avg QP: 1.32 size: 28629
[libx264 # 0x14169ff30] consecutive B-frames: 1.1% 0.3% 1.5% 97.0%
[libx264 # 0x14169ff30] mb I I16..4: 21.7% 26.6% 51.7%
[libx264 # 0x14169ff30] mb P I16..4: 2.9% 3.1% 11.0% P16..4: 9.3% 4.1% 3.4% 0.0% 0.0% skip:66.1%
[libx264 # 0x14169ff30] mb B I16..4: 0.1% 0.4% 1.6% B16..8: 14.6% 4.0% 2.1% direct: 3.2% skip:73.9% L0:53.1% L1:41.6% BI: 5.3%
[libx264 # 0x14169ff30] final ratefactor: -0.00
[libx264 # 0x14169ff30] 8x8 transform intra:19.0% inter:11.1%
[libx264 # 0x14169ff30] direct mvs spatial:98.2% temporal:1.8%
[libx264 # 0x14169ff30] coded y,uvDC,uvAC intra: 91.5% 77.2% 76.6% inter: 11.8% 12.2% 11.9%
[libx264 # 0x14169ff30] i16 v,h,dc,p: 17% 54% 10% 19%
[libx264 # 0x14169ff30] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 42% 15% 3% 5% 3% 7% 3% 6%
[libx264 # 0x14169ff30] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 32% 13% 5% 9% 5% 9% 4% 7%
[libx264 # 0x14169ff30] i8c dc,h,v,p: 38% 44% 13% 5%
[libx264 # 0x14169ff30] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x14169ff30] ref P L0: 83.7% 3.3% 8.8% 2.4% 1.8% 0.0%
[libx264 # 0x14169ff30] ref B L0: 79.9% 19.0% 0.8% 0.3%
[libx264 # 0x14169ff30] ref B L1: 99.0% 1.0%
[libx264 # 0x14169ff30] kb/s:4693.84
Exiting normally, received signal 2.
Except the video doesn't seem to be playable by VLC or Quicktime. Given that the stream can end at any moment thus ending the file, how do I make the file actually playable?

ffmpeg convert cdg/mp3 to mp4 but cdg track is always sped up by a second

I've tried this:
"C:\Program Files\ffmpeg-4.2.1-win64-static\bin\ffmpeg" -i %1 -i %2 -b:v 1M -y -speed 2 "%~dpn1.mp4"
"C:\Program Files\ffmpeg-4.2.1-win64-static\bin\ffmpeg" -i %1 -i %2 -pix_fmt yuv420p -vcodec libx264 -async 1 -speed 2 "%~dpn1.mp4"
Always same result. The file and quality are great, but obv since its karaoke... the lyrics need to match the timing and the converted files lyrics track is always about a full second or so ahead from when I play the original in a Karaoke program. Any ideas on what settings I could play with to help with this?
Both the original and the converted have the same play length at the end though. so the mp3 track seems to be ok.
EDIT: Added cmd output
"C:\Program Files\ffmpeg-4.2.1-win64-static\bin\ffmpeg" -i "A:\25 Karaoke\English\Linkin Park - In The End [SF Karaoke].cdg" -i "A:\25 Karaoke\English\Linkin Park - In The End [SF Karaoke].mp3" -b:v 1M -y -speed 2 "LP_inTheEnd.mp4"
ffmpeg version 4.2.1 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. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, cdg, from 'A:\25 Karaoke\English\Linkin Park - In The End [SF Karaoke].cdg':
Duration: 00:03:56.21, start: 0.480000, bitrate: 57 kb/s
Stream #0:0: Video: cdgraphics, pal8, 300x216, 300 fps, 300 tbr, 300 tbn, 300 tbc
[mp3 # 000001bb3c14bb40] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from 'A:\25 Karaoke\English\Linkin Park - In The End [SF Karaoke].mp3':
Metadata:
title : In The End [SF Karaoke]
artist : Linkin Park
comment : http://www.otslabs.com/
Duration: 00:03:56.26, start: 0.000000, bitrate: 128 kb/s
Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Codec AVOption speed () specified for output file #0 (LP_inTheEnd.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
Stream #0:0 -> #0:0 (cdgraphics (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 000001bb3c13bc00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 000001bb3c13bc00] profile High 4:4:4 Predictive, level 3.1, 4:4:4, 8-bit
[libx264 # 000001bb3c13bc00] 264 - core 158 r2984 3759fcb - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=7 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=1000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'LP_inTheEnd.mp4':
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p(progressive), 300x216, q=-1--1, 1000 kb/s, 300 fps, 19200 tbn, 300 tbc
Metadata:
encoder : Lavc58.54.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/1000000 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc58.54.100 aac
More than 1000 frames duplicated
More than 10000 frames duplicated 2048kB time=00:00:42.16 bitrate= 397.9kbits/s dup=9625 drop=0 speed=11.5x
frame=59170 fps=3226 q=-1.0 Lsize= 11887kB time=00:03:56.26 bitrate= 412.2kbits/s dup=43525 drop=0 speed=12.9x
video:7749kB audio:3340kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.203599%
[libx264 # 000001bb3c13bc00] frame I:242 Avg QP: 0.26 size: 17214
[libx264 # 000001bb3c13bc00] frame P:16651 Avg QP: 0.14 size: 164
[libx264 # 000001bb3c13bc00] frame B:42277 Avg QP: 0.25 size: 25
[libx264 # 000001bb3c13bc00] consecutive B-frames: 2.7% 4.9% 3.8% 88.6%
[libx264 # 000001bb3c13bc00] mb I I16..4: 73.7% 1.6% 24.7%
[libx264 # 000001bb3c13bc00] mb P I16..4: 0.1% 0.0% 0.1% P16..4: 0.4% 0.0% 0.0% 0.0% 0.0% skip:99.4%
[libx264 # 000001bb3c13bc00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.3% 0.0% 0.0% direct: 0.0% skip:99.7% L0:44.2% L1:55.6% BI: 0.2%
[libx264 # 000001bb3c13bc00] final ratefactor: -19.48
[libx264 # 000001bb3c13bc00] 8x8 transform intra:1.5% inter:14.0%
[libx264 # 000001bb3c13bc00] coded y,u,v intra: 14.1% 14.8% 14.9% inter: 0.0% 0.0% 0.0%
[libx264 # 000001bb3c13bc00] i16 v,h,dc,p: 90% 0% 9% 0%
[libx264 # 000001bb3c13bc00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 14% 63% 0% 0% 0% 0% 0% 1%
[libx264 # 000001bb3c13bc00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 55% 15% 16% 1% 2% 3% 3% 2% 2%
[libx264 # 000001bb3c13bc00] Weighted P-Frames: Y:0.2% UV:0.2%
[libx264 # 000001bb3c13bc00] ref P L0: 97.9% 0.9% 1.0% 0.2%
[libx264 # 000001bb3c13bc00] ref B L0: 99.6% 0.4% 0.0%
[libx264 # 000001bb3c13bc00] ref B L1: 99.9% 0.1%
[libx264 # 000001bb3c13bc00] kb/s:321.80
[aac # 000001bb3c172e40] Qavg: 6813.878
try:
ffmpeg -itsoffset 1 -i "Linkin Park - In The End [SF Karaoke].cdg" -itsoffset 0 -i "Linkin Park - In The End [SF Karaoke].mp3" -b:v 1M -y -speed 2 "LP_inTheEnd.mp4"
that's your original command (though without the windows-specific bits) adjusted with a timestamp offset of 1 on the video and zero on the audio, so that the video should delay one second but the audio should not.

FFmpeg Time Lapse from Sources with Long Frozen Tail End

My source for inputs into FFmpeg is either one AVI file or a concat of many of them. Either way my resulting timelapse file has a long tail of frames that are a repeat of a single frame. It's like a very long freeze frame is resulting on the end of my output file.
I'm on an older Mac Pro so I can't update my FFmpeg. I have a laptop that has a newer version and I get the same there as well. I'm not sure if it's because my source files are AVI or not.
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags=-I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/ --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[avi # 0x7fa82080c800] sample size (1) != block align (2)
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'concat:16460001.AVI|16460002.AVI|16460003.AVI|16460004.AVI|16460005.AVI|16460006.AVI|16460007.AVI|16460008.AVI|16460009.AVI|16460010.AVI|16460011.AVI|16460012.AVI|16460013.AVI|16460014.AVI|16460015.AVI|16460016.AVI|16460017.AVI|16460018.AVI|16460019.AVI|16460020.AVI|16460021.AVI':
Duration: 00:10:02.00, start: 0.000000, bitrate: 365923 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p(pc, bt470bg/unknown/unknown), 1280x720, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 32000 Hz, mono, s16, 512 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 0x7fa82082cc00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
[libx264 # 0x7fa82082cc00] profile High, level 3.1
[libx264 # 0x7fa82082cc00] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=16 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc, progressive), 1280x720, q=-1--1, 16 fps, 16384 tbn, 16 tbc
Metadata:
encoder : Lavc58.35.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 69 kb/s
Metadata:
encoder : Lavc58.35.100 aac
frame= 1962 fps=1.2 q=-1.0 Lsize= 136725kB time=03:24:07.00 bitrate= 91.5kbits/s dup=0 drop=365448 speed=7.41x
video:31548kB audio:103624kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.149437%
[libx264 # 0x7fa82082cc00] frame I:10 Avg QP:18.74 size: 62176
[libx264 # 0x7fa82082cc00] frame P:514 Avg QP:21.24 size: 30528
[libx264 # 0x7fa82082cc00] frame B:1438 Avg QP:22.74 size: 11121
[libx264 # 0x7fa82082cc00] consecutive B-frames: 1.4% 2.0% 2.0% 94.6%
[libx264 # 0x7fa82082cc00] mb I I16..4: 2.1% 97.2% 0.7%
[libx264 # 0x7fa82082cc00] mb P I16..4: 2.0% 33.3% 0.1% P16..4: 37.7% 12.0% 10.4% 0.0% 0.0% skip: 4.5%
[libx264 # 0x7fa82082cc00] mb B I16..4: 0.7% 11.5% 0.0% B16..8: 29.1% 4.8% 1.3% direct:12.0% skip:40.6% L0:47.5% L1:42.9% BI: 9.6%
[libx264 # 0x7fa82082cc00] 8x8 transform intra:94.3% inter:83.0%
[libx264 # 0x7fa82082cc00] coded y,uvDC,uvAC intra: 73.4% 66.7% 8.5% inter: 25.9% 46.8% 2.2%
[libx264 # 0x7fa82082cc00] i16 v,h,dc,p: 17% 33% 26% 24%
[libx264 # 0x7fa82082cc00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 23% 51% 1% 2% 1% 4% 1% 2%
[libx264 # 0x7fa82082cc00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 21% 19% 5% 8% 7% 13% 5% 5%
[libx264 # 0x7fa82082cc00] i8c dc,h,v,p: 46% 29% 23% 2%
[libx264 # 0x7fa82082cc00] Weighted P-Frames: Y:47.5% UV:19.3%
[libx264 # 0x7fa82082cc00] ref P L0: 45.0% 13.8% 20.6% 15.7% 5.0%
[libx264 # 0x7fa82082cc00] ref B L0: 61.1% 30.4% 8.5%
[libx264 # 0x7fa82082cc00] ref B L1: 85.8% 14.2%
[libx264 # 0x7fa82082cc00] kb/s:2107.54
[aac # 0x7fa82081ea00] Qavg: 130.084
I've read this thread and tried to follow it:
Create time lapse video from other video
Here are some trials I've attempted before, all with the same output:
# ffmpeg -y -i $mov -vf framestep=10,setpts=N/FRAME_RATE/TB,fps=2 -r 30 $out
# ffmpeg -y -i $mov -vf framestep=10,setpts=.01*PTS -r 30 $out
# ffmpeg -y -i $mov -vf framestep=10,setpts=.1*PTS -r 30 $out
# ffmpeg -y -i "concat:16460001.AVI|16460002.AVI|16460003.AVI|16460004.AVI|16460005.AVI|16460006.AVI|16460007.AVI|16460008.AVI|16460009.AVI|16460010.AVI|16460011.AVI|16460012.AVI|16460013.AVI|16460014.AVI|16460015.AVI|16460016.AVI|16460017.AVI|16460018.AVI|16460019.AVI|16460020.AVI|16460021.AVI" -vf framestep=10,setpts=.05*PTS -r 30 $out
ffmpeg -y -i "concat:16460001.AVI|16460002.AVI|16460003.AVI|16460004.AVI|16460005.AVI|16460006.AVI|16460007.AVI|16460008.AVI|16460009.AVI|16460010.AVI|16460011.AVI|16460012.AVI|16460013.AVI|16460014.AVI|16460015.AVI|16460016.AVI|16460017.AVI|16460018.AVI|16460019.AVI|16460020.AVI|16460021.AVI" -r 16 -filter:v "setpts=0.01*PTS" out.mp4
Am I overlooking something? I'm trying to speed up the inputs into a single file to quickly review incoming security footage. How can I do this without the super long useless tail at the end?
Use
ffmpeg -i 16460021.AVI -vf framestep=15,setpts=N/30/TB -r 30 -an out.mp4
I get an output 1/15th the length of the original. When using framestep=X, setpts should be of the form N/X/TB if you wish to avoid frame duplication. Don't use fps when compressing video duration as it uses old stream duration from before compression (a bug). Skip audio, since that will result in original length.

FFMPEG: create movie from timestamped images

Im trying to make a small movie file from a folder with webcam images.
They are named like this:
00-00-38.jpg
00-05-37.jpg
00-10-37.jpg
00-15-37.jpg
H-M-S.jpg format
Although i tried patterntype glob and simpler commands i cannot get it to work.
This is what i tried:
ffmpeg -r 1 -pattern_type glob -i '*.jpg' -scale=720:-1 -c:v libx264 out.mp4
(got only one image)
ffmpeg -r 25 -i *.jpg -vf "scale=720:-1" output.mp4
(same size as a jpg file but no video)
Console output:
ffmpeg -framerate 1 -pattern_type glob -i "*.jpg" -vf scale=720:-1 -c:v libx264 -pix_fmt yuv420p out.mp4
ffmpeg version 1.0.10 Copyright (c) 2000-2014 the FFmpeg developers built on Jul 25 2014 07:50:40 with gcc 4.7 (Debian 4.7.2-5)
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security '
--extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis
--enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-li
bopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --
enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --
enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64
-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enabl
e-libopus --enable-fontconfig --enable-libfdk-aac --enable-libdc1394 --disable-altivec --dis
libavutil 51. 73.101 / 51. 73.101
libavcodec 54. 59.100 / 54. 59.100
libavformat 54. 29.104 / 54. 29.104
libavdevice 54. 2.101 / 54. 2.101
libavfilter 3. 17.100 / 3. 17.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[image2 # 0x1d53f00] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from '*.jpg':
Duration: 00:04:48.00, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p, 800x593 [SAR 96:96 DAR 800:593], 1 fps, 1 tbr, 1 tbn, 1 tbc
[libx264 # 0x1d35bc0] using SAR=1780/1779
[libx264 # 0x1d35bc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA4 FMA3 SSEMisalign LZCNT BMI1
[libx264 # 0x1d35bc0] profile High, level 2.2
[libx264 # 0x1d35bc0] 264 - core 132 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: ca
bac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dc
t=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=
0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 key
int_min=1 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=
1:1.00
Output #0, mp4, to 'out.mp4':
Metadata:
encoder : Lavf54.29.104
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x534 [SAR 1780:1779 DAR 800:593], q=-1--1, 1 tbn, 1 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libx264)
Press [q] to stop, [?] for help
frame= 288 fps=145 q=32763.0 Lsize= 349kB time=00:04:46.00 bitrate= 10.0kbits/s
video:345kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.208469%
[libx264 # 0x1d35bc0] frame I:2 Avg QP: 2.80 size:130328
[libx264 # 0x1d35bc0] frame P:73 Avg QP: 4.70 size: 1167
[libx264 # 0x1d35bc0] frame B:213 Avg QP:17.33 size: 30
[libx264 # 0x1d35bc0] consecutive B-frames: 1.4% 0.0% 0.0% 98.6%
[libx264 # 0x1d35bc0] mb I I16..4: 20.2% 24.9% 55.0%
[libx264 # 0x1d35bc0] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 4.3% 0.1% 0.2% 0.0% 0.0% skip:95.5%
[libx264 # 0x1d35bc0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.8% 0.0% 0.0% direct: 0.0% skip:99.2% L0: 5.4% L1:94.5% BI: 0.0
%
[libx264 # 0x1d35bc0] 8x8 transform intra:24.9% inter:51.5%
[libx264 # 0x1d35bc0] coded y,uvDC,uvAC intra: 99.4% 0.0% 0.0% inter: 0.6% 0.0% 0.0%
[libx264 # 0x1d35bc0] i16 v,h,dc,p: 5% 19% 52% 25%
[libx264 # 0x1d35bc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 28% 21% 4% 6% 4% 8% 5% 15%
[libx264 # 0x1d35bc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 27% 13% 6% 8% 5% 9% 6% 12%
[libx264 # 0x1d35bc0] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 # 0x1d35bc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x1d35bc0] ref P L0: 98.1% 0.0% 1.7% 0.2%
[libx264 # 0x1d35bc0] ref B L0: 52.0% 48.0%
[libx264 # 0x1d35bc0] ref B L1: 73.0% 27.0%
[libx264 # 0x1d35bc0] kb/s:9.78
The video is 364KB without any video.
Try this:
ffmpeg -framerate 1 -pattern_type glob -i "*.jpg" -vf scale=720:-1 -c:v libx264 -pix_fmt yuv420p out.mp4
If that doesn't work for you, include the exact command you used and the full console output indicating what is wrong.
I've always done something along the lines of:
a=0
for i in *.jpg; do
new=$(printf "/home/Movies/jpgs/%04d.jpg" "$a")
cp -f "$i" "$new"
let a=a+1
done
to get the files in the right order, anything else breaks the encoding as soon as the input numbers are non-monotonic.

Copy mp3 with ffmpeg not playable by QuickTime

I am trying to create a video out of one image and copy audio on top. Following this (last section), I tried:
$ ffmpeg -loop 1 -i img.jpg -i audio.mp3 -c:v libx264 -c:a copy -shortest h264.mp4
ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Feb 23 2015 10:29:52 with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.5.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-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 ' --enable-nonfree --enable-vda
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.102 / 56. 15.102
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
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, image2, from 'img.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 123986 kb/s
Stream #0:0: Video: mjpeg, yuvj440p(pc, bt470bg/unknown/unknown), 1440x900 [SAR 72:72 DAR 8:5], 25 fps, 25 tbr, 25 tbn, 25 tbc
[mp3 # 0x7f94d2034600] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from 'audio.mp3':
Metadata:
genre : Other
Duration: 00:00:03.25, start: 0.000000, bitrate: 130 kb/s
Stream #1:0: Audio: mp3, 44100 Hz, mono, s16p, 128 kb/s
[swscaler # 0x7f94d2800000] deprecated pixel format used, make sure you did set range correctly
No pixel format specified, yuvj444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 # 0x7f94d281b200] using SAR=1/1
[libx264 # 0x7f94d281b200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
[libx264 # 0x7f94d281b200] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[libx264 # 0x7f94d281b200] 264 - core 142 r2455 021c0dc - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'h264.mp4':
Metadata:
encoder : Lavf56.15.102
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj444p(pc), 1440x900 [SAR 1:1 DAR 8:5], q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc56.13.100 libx264
Stream #0:1: Audio: mp3 (i[0][0][0] / 0x0069), 44100 Hz, mono, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 64 fps= 30 q=28.0 size= 332kB time=00:00:00.48 bitrate=5670.9kbits/frame= 80 fps= 30 q=28.0 size= 344kB time=00:00:01.12 bitrate=2514.2kbits/frame= 96 fps= 30 q=28.0 size= 356kB time=00:00:01.76 bitrate=1655.1kbits/frame= 112 fps= 30 q=28.0 size= 367kB time=00:00:02.40 bitrate=1252.1kbits/frame= 129 fps= 31 q=28.0 size= 378kB time=00:00:03.08 bitrate=1006.5kbits/frame= 134 fps= 26 q=-1.0 Lsize= 386kB time=00:00:03.28 bitrate= 963.5kbits/s
video:331kB audio:51kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.120110%
[libx264 # 0x7f94d281b200] frame I:1 Avg QP:19.84 size:329471
[libx264 # 0x7f94d281b200] frame P:34 Avg QP:16.64 size: 189
[libx264 # 0x7f94d281b200] frame B:99 Avg QP:25.33 size: 48
[libx264 # 0x7f94d281b200] consecutive B-frames: 1.5% 0.0% 0.0% 98.5%
[libx264 # 0x7f94d281b200] mb I I16..4: 2.8% 70.0% 27.3%
[libx264 # 0x7f94d281b200] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 1.2% 0.0% 0.0% 0.0% 0.0% skip:98.8%
[libx264 # 0x7f94d281b200] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.0% 0.0% 0.0% direct: 0.0% skip:100.0% L0: 1.6% L1:98.4% BI: 0.0%
[libx264 # 0x7f94d281b200] 8x8 transform intra:70.0% inter:95.0%
[libx264 # 0x7f94d281b200] coded y,u,v intra: 96.4% 73.8% 72.9% inter: 0.0% 0.0% 0.0%
[libx264 # 0x7f94d281b200] i16 v,h,dc,p: 37% 4% 1% 58%
[libx264 # 0x7f94d281b200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 27% 8% 3% 5% 5% 8% 4% 9%
[libx264 # 0x7f94d281b200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 18% 5% 3% 7% 7% 10% 5% 7%
[libx264 # 0x7f94d281b200] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x7f94d281b200] ref P L0: 20.0% 0.4% 42.4% 37.2%
[libx264 # 0x7f94d281b200] ref B L0: 0.0% 100.0%
[libx264 # 0x7f94d281b200] ref B L1: 90.9% 9.1%
[libx264 # 0x7f94d281b200] kb/s:508.50
But I get a video with no audio in QuickTime. I think its a problem of the output container (mp4) not supporting mp3. What output container might be best? Due to quality loss, I am reluctant to convert the mp3 to another format. If my audio is mp3, what might I change about this ffmpeg command?
The final destination is YouTube.
Because YouTube is the final location you can ignore the other players:
Most non-FFmpeg based players can't decode yuvj444p. If you want the video in these other players to work, then add -pix_fmt yuv420p as an output option as mentioned in the console output.
Some players have trouble decoding MP3 in MP4 such as QuickTime and WMP with certain audio rates. If you need it to work in these players you'll need to re-encode to AAC audio by changing -c:a copy to -c:a aac.
Since the input is a single image you can reduce your frame rate for a much faster encoding by adding -framerate 1 as an input option. Again, some players may not be able to decode this frame rate.
YouTube can handle these potential issues, so feel free to upload it. See FFmpeg Wiki: YouTube for more info.

Resources