[FFmpeg-user] Converting numerous files to h264

Lou lou at lrcd.com
Wed Nov 14 07:57:17 CET 2012


On Tue, 13 Nov 2012 18:05:59 +1000
neoculture23 <neoculture23 at gmail.com> wrote:

> First of all, many thank to all who have been helping me. After reading the
> various pages I have had pointed to me, I have made my command line thus:
> 
> ffmpeg -i "filename.ext" \
>     -vprofile high \

You probably don't need this. The encoder will set it for you unless you
require something less complex such as "baseline" for certain devices.

>     -preset veryslow \
>     -map 0 \
>     -threads 0 \

Superfluous. -threads 0 (does not mean "zero threads") is
now automatically applied.

>     -c:a copy -c:s copy -c:d copy -c:t copy \
>     -c:v libx264 \
>     -crf 23 \
>     "filename.mkv"
> 
> And I'm probably repeating myself with some of these parameters...
> 
> I am now playing with the CRF value, and tried a few between 22-24. Here
> are the results in terms of sizes:
> 
> Original: 288,270,774
> Default:  210,738,125 (ffmpeg defaults, no parameters, 73% of original file
> size)
> crf22:     214,530,280 (Above command line, crf of 22, 74%)
> crf23:     193,136,555 (67%)
> crf24:     173,912,796 (60%)
> 
> Original: 250,068,560
> Default:  187,402,004 (75%)
> crf22:     190,052,807 (76%)
> crf23:     172,670,535 (69%)
> crf24:     156,883,580 (63%)
> 
> So depending on the crf, I can get a file down to 60-74% of its original
> size... which would save me quite a lot of room over all of my rips.

Using crf will not allow you to know the output file size until
encoding is complete, and a certain crf value that results in a certain
file size for an input can not be extrapolated to all of your rips.

> But which crf to use? 22, 23 or 24? I don't think I want to go much outside
> that range; do people have any experience about which value they have used
> successfully over a large number of video files?

As the guide shows the general usage is to simply choose the highest
value that gives you an acceptable quality output. If it looks bad,
then decrease the value. Nobody can tell you what to use since
"quality" is subjective. You don't have to encode the whole video to
get an idea of what it will look like. Just encode a few thousand
frames of some random sections using the "-ss", "-t", and/or "-vframes"
options. Once you find an acceptable value then use it for the rest of
your set to be encoded.

If this was my task, and I had the drive space, I'd simply just keep the
original files.


More information about the ffmpeg-user mailing list