(on Wikipedia)
https://ffmpeg.org/
A suite of tools to diddle with multimedia stuff and things.
It's mandatory to have in my toolkit.
- Convert an image into a video, using FFmpeg
- Force commandline application non-interactivity for FFmpeg, so that you can paste a large script with multiple instances of FFmpeg and not have your script halt on the first FFmpeg it sees. 2009-03-27 - Tested and works.
- Resize a video for YouTube, using FFmpeg
- Merging audio and video, using FFmpeg
-
Hard-code subtitles with
-newsubtitle
- 2019-04-21 - 7:3.2.12-1~deb9u1 on Windows Subsystem for Linux (Debian, 4.4.0-17763-Microsoft)
-
2018-04-09 - (version not recorded) - on Devuan 1.0.0
- Switched from Libav 6:11.12-1~deb8u1 on Devuan-1.0.0-jessie-i386-DVD.
- 2018-04-15 - 3.4 on Windows 10
-
2016-03-26 on (distribution not recorded)
- FFmpeg was deprecated, and replaced with Libav, but I have notes added here which have not been ported.
- 2018-04-15 update: Apparently it wasn't deprecated, it was just a claim that was thrown around, and I got suckered.
-
(earlier version and distribution history not recorded)
2018-04-09 - (version not recorded) - ∞
I went through hell to try to work around a Devuan 1.0.0 avconv crash (Devuan).
2018-04-15 - 3.4 ∞
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7.2.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --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-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100
This sort of thing works:
Success:
ffmpeg -r 1 -i *.jpg -i *.ogg -vcodec mpeg4 output.avi
error ∞
This might be the same issue I was having with avconv. See Devuan 1.0.0 avconv crash.
ffmpeg -r 1 -i *.jpg -i *.ogg -vcodec h264 output.avi
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7.2.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --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-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 [mjpeg @ 00000175d47f4600] EOI missing, emulating Input #0, image2, from '__.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 7162 kb/s Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 96:96 DAR 16:9], 25 tbr, 25 tbn, 25 tbc Input #1, ogg, from 'Audio Track.ogg': Duration: 00:00:10.31, start: 0.000000, bitrate: 112 kb/s Stream #1:0: Audio: vorbis, 44100 Hz, mono, fltp, 140 kb/s Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264)) Stream #1:0 -> #0:1 (vorbis (native) -> mp3 (libmp3lame)) Press [q] to stop, [?] for help [libx264 @ 00000175d47f24e0] using SAR=1/1 [libx264 @ 00000175d47f24e0] using cpu capabilities: MMX2 SSE2Fast LZCNT [libx264 @ 00000175d47f24e0] profile High, level 4.0 Output #0, avi, to 'output.avi': Metadata: ISFT : Lavf57.83.100 Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuvj420p(pc, progressive), 1920x1080 [SAR 96:96 DAR 16:9], q=-1--1, 1 fps, 1 tbn, 1 tbc Metadata: encoder : Lavc57.107.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1 Stream #0:1: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 44100 Hz, mono, fltp Metadata: encoder : Lavc57.107.100 libmp3lame frame= 1 fps=0.0 q=17.0 Lsize= 102kB time=00:00:10.34 bitrate= 80.5kbits/s speed=14.8x video:1kB audio:81kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 23.738424% [libx264 @ 00000175d47f24e0] frame I:1 Avg QP: 2.00 size: 1157 [libx264 @ 00000175d47f24e0] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 00000175d47f24e0] 8x8 transform intra:0.0% [libx264 @ 00000175d47f24e0] coded y,uvDC,uvAC intra: 0.0% 0.0% 0.0% [libx264 @ 00000175d47f24e0] i16 v,h,dc,p: 99% 0% 1% 0% [libx264 @ 00000175d47f24e0] i8c dc,h,v,p: 100% 0% 0% 0% [libx264 @ 00000175d47f24e0] kb/s:9.26
Usage and troubleshooting ∞
converting a movie into images ∞
~2016-03-26
ffmpeg -i filename.ogg filename-images%d.png
Btw, you can convert the images back to a movie with:
ffmpeg -f image2 -i filename-images%d.png filename.ogg
for YouTube videos ∞
~2016-03-26
ffmpeg -i filename.mpg -ar 22050 filename.flv
correcting bad audio sync ∞
~2016-03-26
www.ffmpeg.org/ffmpeg-doc.html#SEC15 (not really archived [ 2 ] )
ffmpeg -i filename.mpg -ar 22050 -async 1 filename.flv
Tested and works on 2009-01 on PCLinuxOS 2007
Remuxing to rebuild a file ∞
This might repair a video.
ffmpeg -i input.mp4 -c copy output.mp4
Rebuilding keyframes ∞
ffmpeg -i input.mp4 -c:v libx264 -preset medium -crf 23 -g 250 output.mp4
Notes ∞
Last updated 2023-09-25 at 21:57:45
Footnotes
(on Wikipedia)
https://ffmpeg.org/A suite of tools to diddle with multimedia stuff and things.
It's mandatory to have in my toolkit.
- Convert an image into a video, using FFmpeg
- Force commandline application non-interactivity for FFmpeg, so that you can paste a large script with multiple instances of FFmpeg and not have your script halt on the first FFmpeg it sees. 2009-03-27 - Tested and works.
- Resize a video for YouTube, using FFmpeg
- Merging audio and video, using FFmpeg
-
Hard-code subtitles with
-newsubtitle
- 2019-04-21 - 7:3.2.12-1~deb9u1 on Windows Subsystem for Linux (Debian, 4.4.0-17763-Microsoft)
-
2018-04-09 - (version not recorded) - on Devuan 1.0.0
- Switched from Libav 6:11.12-1~deb8u1 on Devuan-1.0.0-jessie-i386-DVD.
- 2018-04-15 - 3.4 on Windows 10
-
2016-03-26 on (distribution not recorded)
- FFmpeg was deprecated, and replaced with Libav, but I have notes added here which have not been ported.
- 2018-04-15 update: Apparently it wasn't deprecated, it was just a claim that was thrown around, and I got suckered.
-
(earlier version and distribution history not recorded)
Table of Contents [hide]2018-04-09 - (version not recorded) - ∞
I went through hell to try to work around a Devuan 1.0.0 avconv crash (Devuan).
2018-04-15 - 3.4 ∞
build informationffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7.2.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --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-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100
This sort of thing works:
Success:
ffmpeg -r 1 -i *.jpg -i *.ogg -vcodec mpeg4 output.avi
error ∞
This might be the same issue I was having with avconv. See Devuan 1.0.0 avconv crash.
ffmpeg -r 1 -i *.jpg -i *.ogg -vcodec h264 output.avi
outputffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7.2.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --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-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 [mjpeg @ 00000175d47f4600] EOI missing, emulating Input #0, image2, from '__.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 7162 kb/s Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 96:96 DAR 16:9], 25 tbr, 25 tbn, 25 tbc Input #1, ogg, from 'Audio Track.ogg': Duration: 00:00:10.31, start: 0.000000, bitrate: 112 kb/s Stream #1:0: Audio: vorbis, 44100 Hz, mono, fltp, 140 kb/s Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264- [ _↩_ ]
- try https://ffmpeg.org/ffmpeg.html- [ _↩_ ]