Fastest way to extract frames using ffmpeg?

If the JPEG encoding step is too performance intensive, you could always store the frames uncompressed as BMP images: ffmpeg -i file.mpg -r 1/1 $filename%03d.bmp This also has the advantage of not incurring more quality loss through quantization by transcoding to JPEG. (PNG is also lossless but tends to take much longer than JPEG to … Read more

HTML 5 Video stretch

I have tested by using object-fit: fill in CSS Works good. video { object-fit: fill; } From MDN (https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit): The object-fit CSS property specifies how the contents of a replaced element should be fitted to the box established by its used height and width. Value: fill The replaced content is sized to fill the element’s … Read more

FFmpeg splitting large files

Use the segment muxer to break the input into segments: ffmpeg -i testfile.mp4 -c copy -f segment -segment_time 1200 testfile_piece_%02d.mp4 This will split the source at keyframes, so segments may not be exactly 1200 seconds long. And the timestamps aren’t reset, so some players will fail to play the 2nd and latter segments. If playability … Read more

Getting video dimension / resolution / width x height from ffmpeg

Use ffprobe Example 1: With keys / variable names ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1 input.mp4 width=1280 height=720 Example 2: Just width x height ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x input.m4v 1280×720 Example 3: JSON ffprobe -v error -select_streams v -show_entries stream=width,height -of json input.mkv { “programs”: [ ], “streams”: [ … Read more