Show video file information
#Show attached video input devices (cameras)
> ffmpeg -list_devices true -f dshow -i dummy
# Convert input video to output video limiting frame-rate (fps) to 30fps
>ffmpeg -i input-video-filename.mp4 -r 30 output-video-filename.mp4
Cumulus example
# This is an example command found in the logs file of Cumulus self hosted video app. We note that the video is first uploaded to the server, before becoming processed. We also note that we have been uploading video (mp4) files in a relatively low resolution of 640x360 (or thereabouts).
#
# H.264 Encoding Command: /home/bdl/video.tamertemel.net/cc-core/system/bin/ffmpeg-64-bit/ffmpeg -i /home/bdl/video.tamertemel.net/cc-content/uploads/temp/6yTYjEi7MUobKQRvkX0f.mp4 -vcodec libx264 -vf "scale=min(640\,iw):trunc(ow/a/2)*2" -vb 800k -acodec aac -ab 96k -ar 44100 -f mp4 /home/bdl/video.tamertemel.net/cc-content/uploads/h264/6yTYjEi7MUobKQRvkX0f_temp.mp4 >> /home/bdl/video.tamertemel.net/cc-core/logs/6yTYjEi7MUobKQRvkX0f.log 2>&1
#
# excluding the (long) filename and location), that command becomes;
# Note that the command includes a request to generate a LOG file.
#
# H.264 Encoding Command:
ffmpeg -i 6yTYjEi7MUobKQRvkX0f.mp4 -vcodec libx264 -vf "scale=min(640\,iw):trunc(ow/a/2)*2" -vb 800k -acodec aac -ab 96k -ar 44100 -f mp4 6yTYjEi7MUobKQRvkX0f_temp.mp4 >> 6yTYjEi7MUobKQRvkX0f.log 2>&1
Convert format to High Definition
#convert to HD720
>ffmpeg -i VID_20240501_142950.mp4 -s hd720 -r 30 AylaDrivingLesson20240501.mp4
# get info about video
ffmpeg -i VIDEO-filename.mp4
#convert video file to HD1080
>ffmpeg -i VID_20240501_142950.mp4 -s hd1080 -r 30 DrivingLesson20240501.mp4
Split a video
# Split video (ex. at 00:30:26 at 00 Hour, 36 Minutes and 26 Seconds
# Ref. https://www.youtube.com/watch?v=GrLQQVL4aKE
>skeleton -i input-video-filename.mp4 -ss(time-of start-of-split) -t(time end of video in Seconds) output-video-filename.mp4
>ffmpeg -i video-to-be-split-filename.mp4 -ss 0 -t 1806 output-video-filename.mp4
VIDEO
#complete process example
#
C:\SeaTemp>ffmpeg -i VID_20240501_141403.mp4 -r 30 AylaCollectingHerFirstCar20240501.mp4
ffmpeg version N-115847-gab8f7030bc-20240617 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 13.2.0 (crosstool-NG 1.26.0.65_ecc5e41)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --extra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20240617
libavutil 59. 22.100 / 59. 22.100
libavcodec 61. 8.100 / 61. 8.100
libavformat 61. 3.104 / 61. 3.104
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20240501_141403.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2024-05-01T13:15:20.000000Z
location : +41.0645+028.8073/
location-eng : +41.0645+028.8073/
com.android.version: 14
Duration: 00:01:13.77, start: 0.000000, bitrate: 32959 kb/s
Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m, progressive), 1920x1080, 32986 kb/s, 30.04 fps, 30 tbr, 90k tbn (default)
Metadata:
creation_time : 2024-05-01T13:15:20.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 96 kb/s (default)
Metadata:
creation_time : 2024-05-01T13:15:20.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000222ced5aa00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000222ced5aa00] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 00000222ced5aa00] 264 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2024 - 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=30 lookahead_threads=5 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 'AylaCollectingHerFirstCar20240501.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
com.android.version: 14
location : +41.0645+028.8073/
location-eng : +41.0645+028.8073/
encoder : Lavf61.3.104
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m, progressive), 1080x1920, q=2-31, 30 fps, 15360 tbn (default)
Metadata:
creation_time : 2024-05-01T13:15:20.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
encoder : Lavc61.8.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s (default)
Metadata:
creation_time : 2024-05-01T13:15:20.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
encoder : Lavc61.8.100 aac
frame= 10 fps=9.8 q=29.0 size= 512KiB time=00:00:00.26 bitrate=15730.1kbits/s dup=3 drop=0 speed=0.261x frame= 41 fps= 27 q=29.0 size= 1792KiB time=00:00:01.30 bitrate=11292.7kbits/s dup=3 drop=0 speed=0.845x frame= 75 fps= 37 q=29.0 size= 3072KiB time=00:00:02.43 bitrate=10342.3kbits/s dup=3 drop=0 speed=1.18x frame= 110 fps= 43 q=29.0 size= 4096KiB time=00:00:03.60 bitrate=9320.8kbits/s dup=3 drop=0 speed= 1.4x frame= 146 fps= 47 q=29.0 size= 5376KiB time=00:00:04.80 bitrate=9175.1kbits/s dup=3 drop=0 speed=1.56x frame= 185 fps= 51 q=29.0 size= 6400KiB time=00:00:06.10 bitrate=8594.9kbits/s dup=3 drop=0 speed=1.69x frame= 212 fps= 51 q=29.0 size= 7424KiB time=00:00:07.00 bitrate=8688.3kbits/s dup=3 drop=0 speed= 1.7x frame= 239 fps= 52 q=29.0 size= 8704KiB time=00:00:07.90 bitrate=9025.8kbits/s dup=3 drop=0 speed= 1.7x frame= 271 fps= 52 q=29.0 size= 10496KiB time=00:00:08.96 bitrate=9589.3kbits/s dup=3 drop=0 speed=1.74x frame= 301 fps= 53 q=29.0 size= 11520KiB time=00:00:09.93 bitrate=9500.6kbits/s dup=3 drop=0 speed=1.75x frame= 329 fps= 53 q=29.0 size= 12800KiB time=00:00:10.90 bitrate=9620.0kbits/s dup=3 drop=0 speed=1.75x frame= 358 fps= 53 q=29.0 size= 14080KiB time=00:00:11.86 bitrate=9720.0kbits/s dup=3 drop=0 speed=1.76x frame= 391 fps= 54 q=29.0 size= 15360KiB time=00:00:12.90 bitrate=9754.2kbits/s dup=3 drop=0 speed=1.78x frame= 422 fps= 54 q=29.0 size= 16896KiB time=00:00:14.00 bitrate=9886.6kbits/s dup=3 drop=0 speed= 1.8x frame= 451 fps= 54 q=29.0 size= 18176KiB time=00:00:14.96 bitrate=9948.7kbits/s dup=3 drop=0 speed= 1.8x frame= 482 fps= 55 q=29.0 size= 19712KiB time=00:00:16.00 bitrate=10092.6kbits/s dup=3 drop=0 speed=1.81x frame= 517 fps= 55 q=29.0 size= 21760KiB time=00:00:17.16 bitrate=10384.0kbits/s dup=3 drop=0 speed=1.84x frame= 554 fps= 56 q=29.0 size= 23040KiB time=00:00:18.40 bitrate=10257.8kbits/s dup=3 drop=0 speed=1.86x frame= 588 fps= 57 q=29.0 size= 24064KiB time=00:00:19.53 bitrate=10092.1kbits/s dup=3 drop=0 speed=1.88x frame= 623 fps= 57 q=29.0 size= 25088KiB time=00:00:20.70 bitrate=9928.6kbits/s dup=3 drop=0 speed= 1.9x frame= 653 fps= 57 q=29.0 size= 26112KiB time=00:00:21.70 bitrate=9857.6kbits/s dup=3 drop=0 speed= 1.9x frame= 680 fps= 57 q=29.0 size= 27136KiB time=00:00:22.60 bitrate=9836.2kbits/s dup=3 drop=0 speed=1.89x frame= 709 fps= 57 q=29.0 size= 28928KiB time=00:00:23.56 bitrate=10055.7kbits/s dup=3 drop=0 speed=1.89x frame= 741 fps= 57 q=29.0 size= 30464KiB time=00:00:24.63 bitrate=10131.0kbits/s dup=3 drop=0 speed= 1.9x frame= 776 fps= 58 q=29.0 size= 31232KiB time=00:00:25.80 bitrate=9916.8kbits/s dup=3 drop=0 speed=1.91x frame= 804 fps= 57 q=29.0 size= 32512KiB time=00:00:26.73 bitrate=9962.8kbits/s dup=3 drop=0 speed=1.91x frame= 831 fps= 57 q=29.0 size= 35072KiB time=00:00:27.63 bitrate=10397.2kbits/s dup=3 drop=0 speed= 1.9x frame= 861 fps= 57 q=29.0 size= 35840KiB time=00:00:28.63 bitrate=10253.8kbits/s dup=3 drop=0 speed= 1.9x frame= 895 fps= 58 q=29.0 size= 36864KiB time=00:00:29.76 bitrate=10145.2kbits/s dup=3 drop=1 speed=1.91x frame= 923 fps= 57 q=29.0 size= 37888KiB time=00:00:30.70 bitrate=10110.1kbits/s dup=3 drop=1 speed=1.91x frame= 953 fps= 57 q=29.0 size= 38912KiB time=00:00:31.70 bitrate=10055.8kbits/s dup=3 drop=1 speed=1.91x frame= 983 fps= 57 q=29.0 size= 40448KiB time=00:00:32.66 bitrate=10143.4kbits/s dup=3 drop=1 speed=1.91x frame= 1009 fps= 57 q=29.0 size= 41472KiB time=00:00:33.56 bitrate=10121.3kbits/s dup=3 drop=1 speed=1.91x frame= 1037 fps= 57 q=29.0 size= 43008KiB time=00:00:34.50 bitrate=10212.2kbits/s dup=3 drop=1 speed= 1.9x frame= 1055 fps= 57 q=29.0 size= 44032KiB time=00:00:35.10 bitrate=10276.7kbits/s dup=3 drop=1 speed=1.88x frame= 1087 fps= 57 q=29.0 size= 46080KiB time=00:00:36.16 bitrate=10437.4kbits/s dup=3 drop=1 speed=1.89x frame= 1112 fps= 56 q=29.0 size= 47616KiB time=00:00:37.00 bitrate=10542.5kbits/s dup=3 drop=1 speed=1.88x frame= 1137 fps= 56 q=29.0 size= 48896KiB time=00:00:37.83 bitrate=10587.4kbits/s dup=3 drop=1 speed=1.87x frame= 1166 fps= 56 q=29.0 size= 50176KiB time=00:00:38.80 bitrate=10593.9kbits/s dup=3 drop=1 speed=1.87x frame= 1196 fps= 56 q=29.0 size= 51456KiB time=00:00:39.80 bitrate=10591.2kbits/s dup=3 drop=1 speed=1.88x frame= 1226 fps= 56 q=29.0 size= 52736KiB time=00:00:40.80 bitrate=10588.6kbits/s dup=3 drop=1 speed=1.88x frame= 1252 fps= 56 q=29.0 size= 54016KiB time=00:00:41.66 bitrate=10620.0kbits/s dup=3 drop=1 speed=1.87x frame= 1277 fps= 56 q=29.0 size= 55296KiB time=00:00:42.50 bitrate=10658.5kbits/s dup=3 drop=1 speed=1.86x frame= 1306 fps= 56 q=29.0 size= 56576KiB time=00:00:43.46 bitrate=10662.7kbits/s dup=3 drop=1 speed=1.87x frame= 1331 fps= 56 q=29.0 size= 57600KiB time=00:00:44.30 bitrate=10651.5kbits/s dup=3 drop=1 speed=1.86x frame= 1361 fps= 56 q=29.0 size= 59136KiB time=00:00:45.30 bitrate=10694.1kbits/s dup=3 drop=1 speed=1.86x frame= 1386 fps= 56 q=29.0 size= 60672KiB time=00:00:46.13 bitrate=10773.7kbits/s dup=3 drop=2 speed=1.86x frame= 1413 fps= 56 q=29.0 size= 61696KiB time=00:00:47.03 bitrate=10745.9kbits/s dup=3 drop=2 speed=1.85x frame= 1436 fps= 55 q=26.0 size= 63232KiB time=00:00:47.80 bitrate=10836.8kbits/s dup=3 drop=2 speed=1.85x frame= 1460 fps= 55 q=29.0 size= 64512KiB time=00:00:48.60 bitrate=10874.1kbits/s dup=3 drop=2 speed=1.84x frame= 1492 fps= 55 q=29.0 size= 66048KiB time=00:00:49.66 bitrate=10893.9kbits/s dup=3 drop=2 speed=1.85x frame= 1534 fps= 56 q=29.0 size= 67328KiB time=00:00:51.06 bitrate=10800.6kbits/s dup=3 drop=2 speed=1.86x frame= 1571 fps= 56 q=29.0 size= 67840KiB time=00:00:52.30 bitrate=10626.1kbits/s dup=3 drop=2 speed=1.87x frame= 1599 fps= 56 q=29.0 size= 68864KiB time=00:00:53.23 bitrate=10597.4kbits/s dup=3 drop=2 speed=1.87x frame= 1635 fps= 56 q=29.0 size= 69888KiB time=00:00:54.43 bitrate=10517.9kbits/s dup=3 drop=2 speed=1.88x frame= 1665 fps= 56 q=29.0 size= 71168KiB time=00:00:55.43 bitrate=10517.3kbits/s dup=3 drop=2 speed=1.88x frame= 1692 fps= 56 q=29.0 size= 72448KiB time=00:00:56.33 bitrate=10535.4kbits/s dup=3 drop=2 speed=1.88x frame= 1716 fps= 56 q=29.0 size= 73472KiB time=00:00:57.13 bitrate=10534.7kbits/s dup=3 drop=2 speed=1.87x frame= 1746 fps= 56 q=29.0 size= 75264KiB time=00:00:58.13 bitrate=10606.0kbits/s dup=3 drop=2 speed=1.87x frame= 1772 fps= 56 q=29.0 size= 76288KiB time=00:00:59.00 bitrate=10592.4kbits/s dup=3 drop=2 speed=1.87x frame= 1799 fps= 56 q=29.0 size= 77568KiB time=00:00:59.90 bitrate=10608.3kbits/s dup=3 drop=2 speed=1.87x frame= 1828 fps= 56 q=29.0 size= 79360KiB time=00:01:00.86 bitrate=10681.0kbits/s dup=3 drop=3 speed=1.87x frame= 1860 fps= 56 q=29.0 size= 80640KiB time=00:01:01.83 bitrate=10683.6kbits/s dup=3 drop=3 speed=1.87x frame= 1885 fps= 56 q=29.0 size= 81664KiB time=00:01:02.76 bitrate=10658.4kbits/s dup=3 drop=3 speed=1.87x frame= 1921 fps= 56 q=29.0 size= 82944KiB time=00:01:03.96 bitrate=10622.4kbits/s dup=3 drop=3 speed=1.87x frame= 1949 fps= 56 q=29.0 size= 83968KiB time=00:01:04.90 bitrate=10598.9kbits/s dup=3 drop=3 speed=1.87x frame= 1983 fps= 56 q=29.0 size= 85248KiB time=00:01:06.03 bitrate=10575.7kbits/s dup=3 drop=3 speed=1.88x frame= 2012 fps= 56 q=29.0 size= 86272KiB time=00:01:07.00 bitrate=10548.4kbits/s dup=3 drop=3 speed=1.88x frame= 2046 fps= 56 q=29.0 size= 87296KiB time=00:01:08.13 bitrate=10496.0kbits/s dup=3 drop=3 speed=1.88x frame= 2073 fps= 56 q=29.0 size= 88320KiB time=00:01:09.00 bitrate=10485.8kbits/s dup=3 drop=3 speed=1.88x frame= 2105 fps= 56 q=29.0 size= 89344KiB time=00:01:10.10 bitrate=10440.9kbits/s dup=3 drop=3 speed=1.88x [out#0/mp4 @ 00000222ced24840] video:94139KiB audio:627KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.080032%
frame= 2205 fps= 57 q=-1.0 Lsize= 94842KiB time=00:01:13.43 bitrate=10580.3kbits/s dup=3 drop=3 speed= 1.9x
[libx264 @ 00000222ced5aa00] frame I:24 Avg QP:23.24 size:126932
[libx264 @ 00000222ced5aa00] frame P:1099 Avg QP:25.80 size: 58074
[libx264 @ 00000222ced5aa00] frame B:1082 Avg QP:26.93 size: 27290
[libx264 @ 00000222ced5aa00] consecutive B-frames: 29.2% 12.5% 10.7% 47.5%
[libx264 @ 00000222ced5aa00] mb I I16..4: 11.2% 75.5% 13.4%
[libx264 @ 00000222ced5aa00] mb P I16..4: 7.7% 23.7% 2.8% P16..4: 33.8% 14.6% 8.0% 0.0% 0.0% skip: 9.4%
[libx264 @ 00000222ced5aa00] mb B I16..4: 1.5% 6.0% 0.6% B16..8: 38.7% 7.0% 1.6% direct: 7.4% skip:37.2% L0:44.8% L1:43.8% BI:11.4%
[libx264 @ 00000222ced5aa00] 8x8 transform intra:70.5% inter:68.4%
[libx264 @ 00000222ced5aa00] coded y,uvDC,uvAC intra: 52.8% 45.9% 5.1% inter: 28.6% 23.9% 0.4%
[libx264 @ 00000222ced5aa00] i16 v,h,dc,p: 21% 37% 10% 33%
[libx264 @ 00000222ced5aa00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 18% 28% 6% 5% 5% 5% 7% 6%
[libx264 @ 00000222ced5aa00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 20% 14% 7% 8% 7% 7% 8% 6%
[libx264 @ 00000222ced5aa00] i8c dc,h,v,p: 64% 18% 16% 2%
[libx264 @ 00000222ced5aa00] Weighted P-Frames: Y:28.8% UV:12.6%
[libx264 @ 00000222ced5aa00] ref P L0: 67.9% 20.2% 9.2% 2.3% 0.4%
[libx264 @ 00000222ced5aa00] ref B L0: 94.7% 4.3% 1.0%
[libx264 @ 00000222ced5aa00] ref B L1: 98.6% 1.4%
[libx264 @ 00000222ced5aa00] kb/s:10492.31
[aac @ 00000222d0d65500] Qavg: 290.498
Post navigation