Hot answers tagged ffmpeg
7
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 ...
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
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
-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.
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
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 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
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
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
...
3
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 ...
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 ...
2
ffmpeg will do it for you - http://stackoverflow.com/questions/5887311/ffmpeg-1-image-1-audio-file-1-video
If you want to provide good seeking ability, you will need to provide key frames at certain intervals in the encoding, which will increase the size of the video. The codec will encode the whole frame at each of the keyframes but greatly compress the ...
2
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 ...
1
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
...
1
You can create an avi animation as a series of png images ( png is lossless so the jpeg => png conversion should not degrade your pictures ):
if your images a named img_0001.jpg
ffmpeg -r 25 -start_number 1 -f image2 -i "img_%04d.jpg" -vcodec png video.avi
where "25" is the frame rate you want in the resulting video. -start_number is not needed if it ...
1
What you wish to do is somewhat convoluted. There is a path to achieving it in the 2 step process you propose, but I would just suggest creating a new folder where you copy all the input files and rename to form a continuous sequence.
Let's say you have 3 folders and the following files in them to be joined in that order
Folder A: a001.png, a002.png, ...
1
The JPEG 2000 codec in FFMPEG is still experimental. To use it you would have to compile FFMPEG by yourself with a special option enabled.
But you could use OpenDCP, which has it's documentation here. It needs TIFF images and WAV files as input, that you can produce with FFMPEG. The resulting MXF can be tested with the easyDCP player.
OpenDCP is available ...
1
There are some things to make clear:
A format is not a codec; you want to get a file in avi format with video encoded with h264 codec. Just use -vcodec libx264 and a filename with .avi. Ffmpeg should recognize a format by looking at a file extension, but you may also be specific adding -f avi. You definetely not want to use mpeg1, because it gives worse ...
1
I'd suggest installing WinFF, which is a GUI for ffmpeg, and comes with a job manager.
Basically, perform the task for one video and verify it's ok, then populate the job queue with the remaining files, and it will adopt the last used encode parameters and process the queue.
1
You should explicitly specify a video codec using -vcodec as well as quality settings.
The problem is that ffmpeg's defaults aren't very sensible when you only specify a container format for the output, often choosing a sub-standard video format by default.
If you want H.264 output, try using the presets, e.g. -vcodec libx264 -vpre max. (To see what ...
Only top voted, non community-wiki answers of a minimum length are eligible
