how to specify profile when using ffmpeg with vaapi hardware encoder

2.7k Views Asked by At

When I use ffmpeg and vaapi encoder, I know I can specify "profile" in a commandline:

ffmpeg ... -i input.wmv -c:v h264_vaapi -profile:v PROFILE_NUMBER output.mp4

Since this I am using vaapi, I know I need to take a look at what kind of profile does my Intel CPU actually support by typing

$ vainfo|grep -i enc|grep 264
libva info: VA-API version 1.13.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_13
libva info: va_openDriver() returns 0
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP

From this output, I know my Intel support Main, High and ConstrainedBaseLine profiles

(by the way, I have no idea what "VAEntrypointEncSlice" and "VAEntrypointEncSliceLP" means)

By cross-reference wikipage https://en.wikipedia.org/wiki/Advanced_Video_Coding#Profiles

the corresponding "profile number" are 77 100 and 66

The problem is that specifying specific profile has no effect whatsover. In other word

ffmpeg ... -i input.wmv -c:v h264_vaapi -profile:v 77 output-77.mp4

ffmpeg ... -i input.wmv -c:v h264_vaapi -profile:v 100 output-100.mp4

ffmpeg ... -i input.wmv -c:v h264_vaapi -profile:v 66 output-66.mp4

yields output file of exact same size.

My question is: what went wrong? It is rather obvious that I've invoked the right profile or ffmpeg will complain that the profile is not supported. but if the encoding profile has been properly invoked, why it has no effect to the output file?

Thanks in advance

0

There are 0 best solutions below