Hot answers tagged

7

Choose your license FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. Some features are covered by the GNU General Public License (GPL) version 2 or later. If those parts get used the GPL applies to all of FFmpeg. See LICENSE.md in the source to see a list of GPL parts of FFmpeg and which external libraries require ...


7

Use drawbox for the box, and drawtext for the text. ffmpeg -i input.mp4 -vf \ "format=yuv444p, \ drawbox=y=ih/PHI:color=black@0.4:width=iw:height=48:t=max, \ drawtext=fontfile=OpenSans-Regular.ttf:text='Title of this Video':fontcolor=white:fontsize=24:x=(w-tw)/2:y=(h/PHI)+th, \ format=yuv420p" \ -c:v libx264 -c:a copy -movflags +faststart output.mp4 ...


5

Use it. Nothing else can provide the the same quality per bitrate as x264 (the top-class H.264 encoder) while not taking 10,000 years to encode (x265 'n VP9). Some tips: Use a recent ffmpeg build since development is so active. Static builds are available and easy. Add -movflags +faststart to your command. Once encoding is finished this option will ...


5

This is possible but will require scripting. ffprobe will be used to determine the duration of the input, then the countdown and background box will be created by the drawtext filter. A 30 second input will start from 30 and count down to 0. Example: input=input.mp4 duration=$(ffprobe -loglevel error -show_entries format=duration -of default=nw=1:nk=1 ...


5

-select_streams If you only want the information from the first video stream, then add this to your command: -select_streams v:0 duration Note that duration may be missing or incorrect; especially with damaged files. You can always compare it with the output of: ffmpeg -i input -f null - Then look at time= in the second to last line. This will decode ...


5

This should do it: ffmpeg -i input.mp4 \ -filter_complex "[0:v] crop=iw/3:ih:0:0,pad=iw:2*ih [left]; \ [0:v] crop=iw/3:ih:(iw/3)+1:0 [middle]; \ [0:v] crop=iw/3:ih:(2*iw/3)+1:0 [right]; \ [left][middle] overlay=0:main_h/2,pad=iw:(3*ih/2) [out1]; \ [out1][right] overlay=0:(2*main_h/3) [fout] " \ -c:v libx264 -an -map "[fout]" ...


5

I'm not well-versed with Unix shell scripting, and also only have basic proficiency in Windows scripting, so I can only offer a pseudocode flow of the script: 1) Break up your full video into N-second segments of only audio (into a temporary folder) ffmpeg -i GoProFull.mp4 -vn -c:a copy -segment_time n -f segment GP%03d.mp4 Obviously, this will generate ...


4

You can use AtomicParsley to parse the metadata of a MP4-file. For example AtomicParsley /path/to.mp4 -T 1 will print the whole atom tree.


4

All anyone might be able to say is that there are no known holes in the various players. (I don't know if that's true, just that it's impossible to know that there are no undiscovered bugs in a complex piece of code.) H.264 streams are complex enough to have lots of corner cases. They're parsed with speed-optimized code written in C and assembly. You're ...


4

I work as an assistant editor on feature films, and use ffmpeg all the time, primarily for two purposes: Transcoding files to be uploaded for producers to view on digital dailies systems (Dax, PIX, etc). I've written up shell scripts that accept property-of and recipient strings as command line input, along with target bitrate, and then generate the ...


4

This should work faster... ffmpeg -ss 1:00 -t 5 -i in.mkv -ss 2:00 -t 5 -i in.mkv \ -filter_complex "[0][1]concat=n=2:v=1:a=1" \ out.mkv There's no need to specify -t on the output. There's no need to split the audio and video before the concat.


4

The default settings for ffmpeg are very low quality, and since you don't specify any codec or quality parameters it's just using the defaults (I don't know why the devs don't fix that because it generates a lot of questions on forums everywhere). Try adding -c:v libx264 -crf 20 -preset slow to the command. -c:v libx264 tells it to use the libx264 ...


4

You are correct: h.264 is non-free and content producers as well as developers are obliged to pay royalties to MPEGLA for its use - but only if they are charging for their content, and the volume goes over the threshold MPEGLA sets (which is in the order of 100,000 paying subscribers or > 12 minutes in length if charging title-by-title). Thjey have also said ...


4

Using the latest ffmpeg General users should always use ffmpeg from the current git master branch (the latest code available): When encountering an issue the first thing to do is check to see if you are using a build from git master. It is considered stable. It will have more bug fixes and features. FFmpeg development is very active. If you want to get ...


4

Your current method using the concat demuxer while stream copying is probably the fastest (I'm just counting the ffmpeg time and not any time you take to enter the additional commands). Unfortunately, you have to perform several steps, but the advantage is that your non-filtered segments are not being re-encoded which preserves quality and results in fast ...


4

Hope this explanation is what you're looking for: When you transcode to an encoding such as H.264 (MPEG-4 part 10) you necessarily also resample the video, that's part of H.264 compression technique. Nontheless, I doubt if this is the reason you experience a timing gap since the resampling doesn't necessarily influence the clock rate of the media. So, I ...


4

BTW, this question might be better on stackoverflow, or maybe unix.stackexchange, or maybe serverfault. This site is I think less focused on questions that don't involve decisions based on creative merit or at least perceptual video / audio quality. However, I'm all about the tech details, so I'll answer. FFmpeg uses multi-threading by default, so you ...


4

I am the author of the original Calf plugin, I had no idea it was being used in FFmpeg, great! The original plugin used to have a sidechain input to use as the level detection, but I am assuming the ported version just uses the input signal as this level. The main parameter is the threshold, it sets the level below which gating begins to occur. Having 0 ...


4

MPEG-2 doesn't seem to be an officially sanctioned codec for the Quicktime container. The official specification has a section related to MPEG-1 in MOV but not MPEG-2. The US Library of Congress also does not have an entry for the subtype MPEG-2 in MOV, like it does for MPEG-1 (just called QTV_MPEG). So, there's no official word on "allowable alternative ...


4

As you are hardcoding subtitles, the video (with the subtitles added) will be re-encoded. You can use the CRF rate control method to modulate the quality of the output. So, start with ffmpeg -i grdedFinal.mov -vf subtitles=portSbs.srt -crf 18 -c:a copy gradedFinalwithSubs.mov If the quality's not acceptable, lower that value till it is - in exchange ...


3

Download Assuming the downloaded video is the same as the one you'd watch in your browser: $ youtube-dl https://vimeo.com/123456789 strings & grep Assuming x264 is used to encode, and the encoding settings weren't stripped out, you can see what version was used and view some of the particular settings. However, it does not mean that you should ...


3

Yes, you have the right idea. If stib's suggestion of making multiple outputs in parallel with the same ffmpeg commandline doesn't quite do the trick, then use a temp file to hold a lossless copy of the output of any slow filtering: ffmpeg -i src.mkv -vf yadif=3:1,mcdeint=2:1 -c:a copy -c:v libx264 -preset ultrafast -qp 0 deinterlaced.mkv (never use ...


3

libtheora is single threaded. There is a multithreaded experimental build, but is not maintained. I would suggest running it in parallel with the other encodes. Also if possible use libfdk-aac over libfaac. Much higher audio fidelity at the same bitrate.


3

HDV camera, right? It's not untypical for cameras to claim higher resolution than they actually scan. In such cases you have to look at the different aspect ratios involved: pixel, frame, display, sample. Here's a post that discusses this, or google "HDV aspect ratio". And here's a link to the spec from the HDV consortium. It's essentially anamorphic. The ...


3

Rather than using constant bitrate, have a go using constant quality (AKA constant rate factor, or crf). So instead of -b:v 2000 use -crf 23 (adjust the number to change the quality, higher is smaller / lower quality and lower is larger / better quality). Constant quality usually gives you more bang for your bits, as it skimps on bitrate where it's not ...


3

From https://trac.ffmpeg.org/wiki/FFprobeTips If you want to get the bit_rate of the 1st video stream you could use: ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 input.mp4 Where -select_steams v:0 is selecting the 1st video stream and :nokey=1 gives the value without the key. You could also ...


3

If your question was Where are these pixel formats defined? Go to http://ffmpeg.org/download.html and download the source of ffmpeg. Then unpack it tar -xavf FILENAME.tar.* and descend to the folder in the source code that is called libavutil cd ffmpeg-*/libavutil/ and open the file pixfmt.h where you will find a description of all pixel formats. ...


3

Using crop and vstack: ffmpeg -i input -filter_complex \ "[0:v]crop=iw/3:ih:0:0[left]; \ [0:v]crop=iw/3[center]; \ [0:v]crop=iw/3:ih:ow*2:0[right]; \ [left][center][right]vstack=inputs=3[v]" \ -map "[v]" -map 0:a -c:a copy output vstack is faster than pad + overlay. If your ffmpeg is too old for the vstack filter then just download a recent build.


3

Here's a way to do it with the blackdetect and trim filters. First, a better way to get the blackdetect output is via ffprobe because it is capable of writing structured data such as XML, JSON or one key=value per line. You do this using metadata injection: ffprobe -f lavfi -i "movie=/path/to/input.mp4,blackdetect[out0]" -show_entries ...


3

MPEG -TS. See here: All MPEG-2 TS operations from GPAC (client and MP42TS) are supported on HEVC. MP42TS can be used to generate TS files usable for DASH or for injection in modulation chains; it can also be used to send the TS over an UDP or RTP stream in unicast or multicast mode



Only top voted, non community-wiki answers of a minimum length are eligible