Tag Info

Hot answers tagged

25

In recent versions of FFmpeg, use the crop filter: ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4 Where the options are as follows: out_w is the width of the output rectangle out_h is the height of the output rectangle x and y specify the top left corner of the output rectangle So, for example, to crop a 640×480 window, starting from ...


9

using the scale filter will do it, but there is a bit more to it. ffmpeg -i input.mov -vf scale=720x406 output.mov will create a movie with the required pixel dimensions, but if you look at the output you'll find that it adds information into the metadata so that it will play back at the same aspect ratio as the original, by using non-square pixels. So ...


6

FFmpeg is probably being used more than you believe. I think the BBC uses it for some workflows, there is evidence that Laika and Weta may use it, and there is a fork called FFmbc which is targeted for professional broadcast usage. YouTube probably uses FFmpeg to decode as shown by some unique decoding issues (but this was several years ago that I read ...


5

From http://www.ffmpeg.org/faq.html: If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the ‘/tmp’ directory in the sequence of ‘img001.jpg’, ‘img002.jpg’ and so on. x=1; for i in *jpg; do ...


5

ffmpeg has removed their x264 presets so the -vpre setting doesn't work any more. Now, I have a script for converting video files to a format my Cellphone can handle. ffmpeg -i input.avi -sws_flags lanczos+accurate_rnd -vf "scale=320:240" -c:v libx264 -crf 20 -preset veryslow -profile:v main -tune fastdecode -c:a copy output.mkv I'll explain each option ...


5

I have a large set of jpgs that I want to convert to a video losslessly You can probably just mux the jpg images: ffmpeg -r 30 -i input%03d.jpg -codec copy output.mkv Then compare the md5sums of each frame with the framemd5 muxer: $ ffmpeg -i input%03d.jpg -f framemd5 - 0, 0, 0, 1, 460800, 29bcc2db3726c7dfec1826c5740f603f ...


4

I suspect you are having problems because you are trying to overwrite the input file with the output, ffmpeg just doesn't work that way. For a single file: ffmpeg -i input.avi -an -c:v copy output.mkv To do every file in a directory, you can use a for loop. For every `file.avi``in the working directory, this command will create an output called ...


4

First of all, if I remember correctly, the DV format is intra-only, and thus if there is various damage that has happened to your video, there should be a relatively big chance of getting at least something out -- given that the file isn't completely broken in the most relevant of places. A good way of checking if there's at least some kind of sanity left ...


4

-profile baseline seems to work for me, using libx264. I use the libx264 presets - for example "slow" gives me the options listed below. there's fast, slow, veryslow and placebo (might be more, can't remember). stib$ ffmbc -i test.mov -vcodec libx264 -preset slow -profile baseline -acodec libfaac -ab 96k -crf 19 test.mp4 ... [libx264 @ 0x101858c00] profile ...


4

Note: This is for recent FFmpeg, not FFmbc, which doesn't use the same option syntax (yet) You need to use the -profile:v option, which has been introduced in FFmpeg 0.9 (afaik) and is now standard in 1.0. ffmpeg -i input.mp4 -c:v libx264 -preset fast -profile:v baseline out.mov Why? -profile was used (and prioritized) for AAC encoding. It's simply ...


4

H.264 does support true lossless compression (see 'Lossless mode' on this page). It seems that to avoid chroma format conversion, you need to encode using the Hi444PP profile, which accepts RGB pixels. However, a cursory search indicates that x264 doesn't support Hi444PP (yet), whereas some commercial codecs like MainConcept do.


4

Premiere Pro CS5 should be able to import H.264 video, IIRC, however it may be having trouble with the audio and/or container format. With ffmpeg try re-muxing the video stream without the audio: ffmpeg -i input -an -codec:v copy output.mp4 -an -codec:v copy output.avi If both output.mp4 and output.avi work then we know that the issue lies with the audio ...


4

There is no "typical" size. It depends entirely on the quality level and level of motion in the video. I could encode ten hours of video where there is no movement with very little space since the compression would work very well. On the other hand, if I had a video where every frame was completely different from the last, it would take a huge amount of ...


4

concat filter This method is best if you need to perform additional filtering: Use the trim, atrim, setpts, asetpts, and concat filters: ffmpeg -i input -filter_complex \ "[0:v]trim=60:65,setpts=PTS-STARTPTS[v0]; \ [0:a]atrim=60:65,asetpts=PTS-STARTPTS[a0]; \ [0:v]trim=120:125,setpts=PTS-STARTPTS[v1]; [0:a]atrim=120:125,asetpts=PTS-STARTPTS[a1]; \ ...


4

Re-muxing only Use stream copy mode to just re-mux instead of re-encode: ffmpeg -ss 01:07:29 -i input -codec copy -map 0 -to 01:08:05 fight.avi Using -ss as an input option can be faster than using it as an output option, but it may not be as accurate. -codec copy will stream copy (no re-encoding). Default behavior, if -codec copy is omitted, is to ...


4

Why would you want your videos in the .3gp container to begin with? Its a very irrelevant format nowadays, there is practically no device that supports the 3gp container but not MP4 at the same time. Its nothing but a close derivative of MP4, they are very similar container formats holding the same codec. If you want to support a lot of devices using h264 in ...


4

The -loop option is specific to the image file demuxer and gif muxer, so it can't be used for typical video files, but you can use the concat demuxer. Concat demuxer Make a text file. Contents of an example text file to repeat 4 times. $ cat list.txt file 'input.mp4' file 'input.mp4' file 'input.mp4' file 'input.mp4' Then run ffmpeg: ffmpeg -f concat ...


4

Couldn't wait! Figured it out: I saved an image to the file out.png at a fixed frame rate from processing. Created a fifo: mkfifo fifo Then in one terminal: tail -f out.png > fifo Then in another terminal: cat fifo | ffmpeg -f image2pipe -r 1 -i pipe:0 spo.mp4 Making sure to close tail first allowing ffmpeg to write the last bit of the file.


3

Devices are often picky, and specifications are usually too uninformative so it's always trial and error. For example, your link indicates that the phone supports MP4 playback, but that is simply a container than can utilize several video and audio formats. MPEG-4 part 2 video and AAC-LC audio (partially based on the working video details you provided) ...


3

with ffmpeg 0.11.1 it's as easy as: ffmpeg -f image2 -i %*.png out.avi From the man page, in an example under "Video and Audio file format conversion": When importing an image sequence, -i also supports expanding shell-like wildcard patterns (globbing) internally. To lower the chance of interfering with your actual file names and the shell's glob ...


3

Besides the workaround in my comment, you should be able to use this syntax from the ffmpeg documentation: ffmpeg -f image2 -pattern_type glob -i *.png out.avi


3

I would actually suggest the same thing Mulvya suggested. Whenever I've needed to do stuff like this when dealing with 3D animation renderings, I've renamed the files to make them sequential. It's just easier to work with that way in a lot of different software unless you need to preserve the file names for some reason. Total Commander is also a great ...


3

If you had just 4:3 and 16:9 videos, I would suggest: ffmpeg -i input.mov -filter:v 'scale=-1:768;crop=1024:ih' \ -c:v libx264 -crf 23 -preset veryfast output.mp4 That would scale a video to a height of 768, scaling the width to keep the aspect ratio; and then it crops the width to 1024, keeping the height at 768. However, the fact that you are using 1:1 ...


3

1) If you're not going to deinterlace it then stick to the source's field order. 2) I wouldn't bother with the two pass encoding (if indeed it even does anything) - dnxhd will only encode at certain specific fixed bit rates anyway so you're actually pretty constrained for options. 3) You'll see some softening, but it's unavoidable. ffmbc's filtering is ok ...


3

I'm trying to help. First, I don't understand why you're saying FFMPEG H.264 is not the input format? I don't know the FFMPEG command line well enough (is there anyone who does? ;) ). There's got to be a switch for multipass encoding. I know there are some built-in presets you could probably use and do almost certainly what you're aiming for. These are ...


3

The H.264 standard defines maximum bit rates for 1280x720@30fps as between 14.000 and 42.000 kbit/s, depending on the profile (baseline, main, high etc.). It's even higher for higher frame rates. (http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC) Sony Vegas standard rendering templates use bitrates between 2 and 16 Mbps. Youtube recommends bitrates between ...


3

This depends entirely on what kind of 3d video you want. There are numerous formats for 3d video. Some are as simple as placing the left and right images either side by side or one on top of the other (typically compressing them spatially to still take up the original space, for example 1080p video done like this ends up being wither 540 vertical pixels ...


3

The main reason is support, usability and control. First, lets clarify that FFMPEG is an encoder, QuickTime Pro is a video utility that happens to include multiple encoders and Final Cut Pro is a non-linear editor and has nothing to do with encoders other than the fact it can output to an encoder (generally QuickTime I believe). For big budget commercial ...


3

Apparently by default ffmpeg only copies one stream of each type. To tell it to copy all streams, you need -map 0 So, this does it: ffmpeg -i "concat:a01.mxf|b02.mxf" -y -map 0 -c copy result.mxf


3

One method is to use the overlay video filter. Assuming your video is 640x480, 30 seconds duration, 25 frame rate: ffmpeg -f nullsrc=s=640x480:d=35:r=25 -i video.mp4 -i audio.wav -filter_complex \ "[0:v][1:v]overlay[video]" -map "[video]" -map 2:a -codec:a copy -shortest output.mkv I set the duration of the nullsrc source filter to be 5 seconds longer ...



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