Michael Rampe
Forum Replies Created
-
[William Lipinski] “Can anyone diagnose the cause of this problem at the beginning of the first video? I would love to switch to 2-pass, but I’m stuck on single-pass until I find out what I’m doing wrong.”
I have also experienced this. My advice would be to use 1pass encoding with -crf rate control. This is AS GOOD as a 2pass encode using -b rate control. As you are going to youtube and do not have to deliver a set bitrate, this would be your best option. In libx264, -crf ranges from 1 (best) to 51 (poorest). Do some experimentation to find the best results for your needs.
If you really are dead set on the -b rate control, try experimenting with different values for -g. This represents the GOP size and smaller values might be another solution to the youtube wierdness.
Michael
-
[Jay Patel] “I want to convert 1920×1080(16:9) .mov video to 720×526 (4:3) .mov”
Your first problem is that 720×526 IS NOT 4:3!!! (720/526=1.3688 and it should be 1.3333)
Try 768×576 which IS true 4:3.Rounding errors become problematic very quickly in encoding.
Your second problem is the size and aspect flags outside of the filter chain. These should now be performed inside the filter chain.
I replicated your command line to get a working solution from a 1920p source.
Example:ffmpeg -i tilt_shift_1.mp4 -vcodec libx264 -preset ultrafast -vf "scale=768:432,pad=768:576:0:72,setdar=4:3" -b 15000k test_2.movNow all scale, pad and aspect is done inside the filter chain which avoids the conflicts you were experiencing.
Basically:
1. scale the 1920×1080 source to 768×432 dimensions (square pixel 16:9)
2. Pad this to the output size of 768×576
3. Set the aspect ratio to 4:3NOTE: When using libx264 in recent versions of FFmpeg, the -vpre option has been replaced by -preset. Modify the code or update your FFmpeg as required. Also, I left out your audio options for simplicity.
Michael
-
[Laurent Nguyen] “How do I get this information in real time, i.e. every time a frame is processed ? I tried to read from the file, but ffmpeg seems to be writing chunks.”
I certainly have experienced this one before. I use the -vstats feature and get it to write to a named pipe (mkfifo). I then use this “live” to produce a graph of the results whilst it is encoding (ie. ffmpeg & sed & gnuplot). What I have found is that the output is buffered to 1024 bytes so as you said, it only writes in chunks.
IIRC, I did some hunting once a while back in the source (ffmpeg.c) and found a buffering option (char buf[1024];) for this but gave up before getting it to work due to lack of C knowledge on my part.
Certainly worth revisiting though. Let me know if you find a workable solution. It would make you a legend in my mind;-)
Michael
-
Michael Rampe
July 4, 2011 at 12:57 am in reply to: Applying video filter to specific samples of frames.[matt kim] “What is the best way to perform a specific video filter on random samples of frames?
At the moment I’ve found that the best way is to just use a -ss command along with the select command of the -vf option.”
This seems like the best way to me as well….
Is there something that you cannot achieve using this method?
Michael
-
[Werner Clausen] “The first pass completes but the second fails on start with this message: “Error while opening codec for output stream #0.0 – maybe incorrect parameters such as bit_rate, rate, width or height”.”
Does the first pass actually complete?
Please post the FFmpeg version.
For newer builds of FFmpeg, the use of presets is recommended for the libx264 codec.
Depending on the build, this is achieved by using the -vpre or -preset option.
Also, the pass log file option is not needed for the libx264 library as it generates it’s own logs.
Finally, -crf only needs one pass as it is setting the constant “q” factor which would be determined by two pass.
Anyway, for the latest version, a UNIX 2 pass example (using -b instead of -crf) would be:
ffmpeg -i Kamera20.MOV -an -vcodec libx264 -preset slow -b 1500k -pass 1 -f rawvideo -y /dev/null &&
ffmpeg -i Kamera20.MOV -acodec libfaac -ar 48000 -ab 192k -vcodec libx264 -preset slow -b 1500k -pass 2 Kamera20.mp4Adjust as needed for windows.
Michael
-
[jefferson Goven] “FFmpeg version SVN-r13582, Copyright (c) 2000-2008 Fabrice Bellard, et al.”
This is a very old version. I recommend upgrading to a newer version.
Also, the library specifically related to this is libfaac.
Michael
-
[Marcos Bori] “The “Duration” metadata is not properly set by ffmpeg when outputting to stdout. “
FFmpeg cannot give the duration because it is encoding with passthrough… therefore it has no idea what the final duration will be until it is finished.
[Marcos Bori] “If I decrease the quality (removing the -sameq parameter) of the resulting video, it is executed without this error. “
This seems to be an issue with the encoder not being able to keep up in realtime using the -sameq flag. If you really need -sameq, try to drop the framesize or framerate. Otherwise, work at a lower quality so the encoder can work in realtime.
Michael
-
[Edgar Merino] “Hello, I was wondering if it’s possible to use ffmpeg to take photographs with a photo camera”
This is not the droid you are looking for.
I guess it is “possible” because FFmpeg can take stills from a webcom. Not sure if it is the best approach though because FFmpeg is primarily a video converter, not a still image converter….
Michael
-
Michael Rampe
May 24, 2011 at 10:12 pm in reply to: libraries like libfaac and lame not present after install[MArco Berger] “I installed all the libraries and codecs, put them in the configure command and it does not return an error so they were found and all is ok.
Then I compile, still everything ok.”
These need to be enabled in the configure line (–enable-libx264 –enable-libmp3lame –enable-libfaac) along with –enable-nonfree. Post you FFmpeg configure flags (output from terminal) and I will take a look.
Michael
-
[Magnus Karlsson] “How come i get the following when trying to convert?
File for preset ‘hq’ not found”Was it working before and now not working or is this a first use error?
Could be a couple of things….
If you are using an *older* version:
The hq preset has been missing for some time now. Check the FFpresets folder for available preset options.If you are using a *newer* version:
The command line options changed recently for libx264. The -vpre option has been replaced by a method calling the x264 presets direct. -preset, -profile & -tune are the new options to replace the -vpre use. Check the x264 docs for a full list of available options.Can you post your command line and output to verify the error/version?
Michael