Lou Logan
Forum Replies Created
-
[Peter Robertson] “the ‘-acodec copy -vcodec copy’ needs to be placed AFTER the output file.”
Don’t you mean “after the *input* file”? Please use the CODE button on your commands and console outputs.
-
Lou Logan
May 24, 2013 at 11:24 pm in reply to: Crop, scale and keep quality. Keep getting low bitrateslibx264 ignores “-qscale”. Use “-crf” instead as explained in the FFmpeg and x264 Encoding Guide.
As a semi-related sidenote, as of 2013-04-18, you can use the “-aspect” option with “-vcodec copy” if you only need to change container aspect ratio:
If -aspect is used together with -vcodec copy, it will affect the aspect ratio stored at container level, but not the aspect ratio stored in encoded frames, if it exists.
-
[Jim Sustacek] “
filter="-vf crop=1500:1080:210:0"filter= and its associated quotation marks should be removed.
-
[Thomas Monk] “When converting to 720×576 I would like to crop the side bars.”
How much from each side would you like to crop?
-
You are experiencing the same issue as described in FFmpeg output is black video, with audio. Basically, you need to add the following option:
-pix_fmt yuv420p
or
-vf format=yuv420p
…and read my response in this thread to Jim Sustacek about your command (I now realize that was your command that Jim provided).So your command can look like:
ffmpeg.exe -i Render.avi -i Kalimba.mp3 -codec:v libx264 -crf 23 -preset slow -filter:v format=yuv420p,scale=320:-1,setdar=4:3 -codec:a libvo_aacenc -ar 48000 -b:a 128k -shortest Sample.mp4Next time please simply include your ffmpeg command and the complete console output in your message on this forum.
-
[Jim Sustacek] “ffmpeg -y -i “Render.avi” -crf 35.0 -vcodec libx264 -vf scale=320:240 -aspect 4:3 -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 0 -qmax 69 -qdiff 4 -bf 3 -refs 5 -direct-pred 3 -trellis 1 -wpredp 2 -rc_lookahead 50 -threads 0 “video.mp4″”
Declaring a bewildering multitude of various libx264 options is not recommended. That’s what the encoding presets are for. The presets were designed by the x264 developers so users would not have to create such massive (and often incorrect) commands. Additionally, the presets keep up with any changes, new features, etc; unlike manually setting a million options.
So instead of your long command you could use:
ffmpeg -i input -codec:v libx264 -preset slow -crf 23 -vf scale=320:-1 output.mp4A crf value of 35 is fairly low quality so I used a value that will provide higher quality, and “-threads 0” is now default, so that is not required.
Also see the FFmpeg and x264 Encoding Guide for more details and examples.
-
ffmpeg does not seem to support description for mov container, but it seems to work fine with mp4 container. I’m not sure if this is supported officially by mov or if it is simply a missing feature in ffmpeg. Why are you using mov as the output container and then re-muxing to mp4? Why not simply output to mp4?
Also, placing your commands and console output in the CODE tags will make it easier to read and differentiate it from your comments.
-
[Peter Robertson] “Any suggestions?”
Please show your full ffmpeg command and the complete console output.
-
[Jim Sustacek] “
ffmpeg -i original.mp4 -metadata title="my title" -c copy -y /tmp/tmp.mp4 && ffmpeg -i /tmp/tmp.mp4 -c copy -y original.mp4“Consider adding “-map 0”. By default ffmpeg will choose to copy only the “best” streams but not automatically choose all streams when using “-c copy”. From the documentation:
Stream selection
By default ffmpeg includes only one stream of each type (video, audio, subtitle) present in the input files and adds them to each output file. It picks the “best” of each based upon the following criteria; for video it is the stream with the highest resolution, for audio the stream with the most channels, for subtitle it’s the first subtitle stream. In the case where several streams of the same type rate equally, the lowest numbered stream is chosen.This doesn’t matter for an input that only has one stream per stream type (video, audio, subtitle, etc), but adding “-map 0” will ensure that all streams from the (first) input will be copied if your input contains multiple tracks per stream type (such as one video stream and two audio streams).