Linux – bash: ffmpeg libx265 prevent output

ffmpeglinux

I'd like to use the new codec x265 (libx265) to encode my video collection.

For this I created a lovely bash script under linux which works in general very well! But something is strange:

I prohibit the output of ffmpeg to echo on my own way. With x264 (the "old" one) everything works fine. But as soon as I use x265 I get always this kind of output on my terminal:

x265 [info]: HEVC encoder version 1.7
x265 [info]: build info [Linux][GCC 5.1.0][64 bit] 8bpp
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x265 [info]: Main profile, Level-2.1 (Main tier)
x265 [info]: Thread pool created using 2 threads
x265 [info]: frame threads / pool features       : 1 / wpp(5 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut       : 25 / 250 / 40
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb / refs: 1 / 1 / 0 / 3
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 64 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=0.30 signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao

This is the way I encode my video with ffmpeg:

ffmpeg -i /input/file -c:v libx265 -c:a copy -loglevel quiet /output/file.mp4 <>/dev/null 2>&1

I thought that the

<>/dev/null 2>&1

and the

-loglevel quiet

will do this but apparently I'm mistaken.

How can I solve this problem?

Thanks for your help!

Best Answer

It looks like ffmpeg doesn't tell the x265 encoder to use the loglevel you're telling ffmpeg to use. So if you want ffmpeg and the x265 encoder within ffmpeg to be quiet, you need to set log level options for both of them.

If you have an ffmpeg command that looks like this:

ffmpeg -loglevel error -stats -i "inputfile.xyz" -c:v libx265 -x265-params parameter1=value:parameter2=value outputfile.xyz

You can add the log-level=error option to the list of x265-params like this:

ffmpeg -loglevel error -stats -i "inputfile.xyz" -c:v libx265 -x265-params log-level=error:parameter1=value:parameter2=value ....
Related Question