How to use ffmpeg to encode mp4 to mov

I used to do a lot of this stuff when i worked in the industry, I used mencoder personally (which I then wrapped into a VB.NET app to poll the directory for new files and auto encode them when they were delivered) but FFMPEG is the most popular. MP4 and MOV are just containers that … Read more

Is there a way to use ffmpeg to determine the encoding of a file before transcoding?

Use ffprobe Example command $ ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=nokey=1:noprint_wrappers=1 input.mp4 Result h264 Option descriptions -v error Omit extra information except for fatal errors. -select_streams v:0 Select only the first video stream. Otherwise the codec_name for all other streams in the file, such as audio, will be shown as well. -show_entries … Read more

Checking keyframe interval?

You can display the timestamp for each frame with ffprobe with awk to only output key frame info. Works in Linux and macOS. ffprobe -loglevel error -select_streams v:0 -show_entries packet=pts_time,flags -of csv=print_section=0 input.mp4 | awk -F’,’ ‘/K/ {print $1}’ Or a slower method that works on any OS and does not require awk or similar … Read more

Extracting frames from MP4/FLV?

The command ffmpeg -ss 00:00:25 -t 00:00:00.04 -i YOURMOVIE.MP4 -r 25.0 YOURIMAGE%4d.jpg will extract frames beginning at second 25 [-ss 00:00:25] stopping after 0.04 second [-t 00:00:00.04] reading from input file YOURMOVIE.MP4 using only 25.0 frames per second, i. e. one frame every 1/25 seconds [-r 25.0] as JPEG images with the names YOURIMAGE%04d.jpg, where … Read more

What steps are needed to stream RTSP from FFmpeg?

You can use FFserver to stream a video using RTSP. Just change console syntax to something like this: ffmpeg -i space.mp4 -vcodec libx264 -tune zerolatency -crf 18 http://localhost:1234/feed1.ffm Create a ffserver.config file (sample) where you declare HTTPPort, RTSPPort and SDP stream. Your config file could look like this (some important stuff might be missing): HTTPPort … Read more