ffmpeg video compression / specific file size

if you are targeting a certain output file size the best way is to use H.264 and Two-Pass encoding. There is a great example here but it’s too large to copy-paste: https://trac.ffmpeg.org/wiki/Encode/H.264#twopass You calculate your target bitrate using bitrate = target size / duration and you launch ffmpeg two times: one pass analyzes the media … Read more

Framerate vs r vs Filter fps

-framerate is an input per-file option. It is meant for input formats which don’t have a framerate or PTS defined, image sequences being an example. -r can be either an input or output option. As an input option, it retimes input frames at that rate. As an output option, it will duplicate or drop frames … Read more

ffmpeg vs mencoder

You are right, mencoder uses ffmpeg. Mencoder is actually a universal interface to a number of different codecs or codec libraries like ffmpeg. So, beyond ffmpeg, mencoder can be compiled with support to x264, xvid, lame mp3 and various others that I haven’t used. The point is that if you have the correct mplayer/mencoder binary … Read more

How to change keyframe interval?

You’ll need to reencode. Set x264’s keyint parameter to 5*fps and disable scenecut. If your fps is 24 for example : ffmpeg -i <input> -vcodec libx264 -x264-params keyint=120:scenecut=0 -acodec copy out.mp4 This is obviously not optimal for quality but it’ll match your demand. Edited to change no-scenecut to scenecut=0, as per sigh-boy suggestion.

Why does ffmpeg ignore protocol_whitelist flag when converting https m3u8 stream?

protocol_whitelist is a parameter only on the input file (in your case, MIE.m3u8), so it must be specified before the input in your command. Specify -protocol_whitelist file,http,https,tcp,tls prior to -i and it’ll work as you expect: ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i MIE.m3u8 -c copy -bsf:a aac_adtstoasc MIE.mp4 You can a similar case on a Debian Bugs … Read more

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

Post processing in ffmpeg to move ‘moov atom’ in MP4 files (qt-faststart)

Seems like faststart support has been included in ffmpeg. FFmpeg Formats Documentation: -movflags faststart Run a second pass moving the moov atom on top of the file. This operation can take a while, and will not work in various situations such as fragmented output, thus it is not enabled by default.

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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)