[FFmpeg-user] ffmpeg qsv performance well below expected

Xiang, Haihao haihao.xiang at intel.com
Wed Jan 6 03:36:38 EET 2021


On Fri, 2021-01-01 at 17:12 -0700, dan wrote:
> In running ubuntu with an i3-10100
> 
> I'm able to transcode 2 MPEG2 to h.265 using the following command
> ffmpeg -hwaccel qsv -i http://hdhomerun:5004/auto/v2.2.ts -c:v
> hevc_qsv -c:a copy -profile:v main -global_quality 30 -g 48
> -keyint_min 48 -sc_threshold 0 -hls_time 2 -hls_list_size 10
> -hls_segment_type mpegts -hls_flags delete_segments
> -hls_segment_filename video_%03d.ts video.m3u8

qsv based decoder is different from vaapi based decoder, you should specify the
qsv decoder if you want to use qsv in your case, otherwise the native decoder is
used. 

ffmpeg -hwaccel qsv -c:v mpeg2_qsv -i xxx

You may check the stream mapping in your ffmpeg output.

E.g. 

1. Specify h264_qsv decoder to transcode H264 to H265

Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_qsv) -> hevc (hevc_qsv))

2. Don't specify h264_qsv decoder to transoce H264 to H265

Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_qsv))

Thanks
Haihao


> 
> but, the third video causes all 3 to start to throw errors in
> encoding.  CPU usage on this quad core CPU is about 35% on 3 different
> cores, seems there's no issue with CPU (general purpose) performance.
> Am I hitting a wall on hevc_qsv here?
> 
> I've switched -hwaccel to vaapi which works but performance is a bit
> worse.  I've removed this to push the MPEG2 decode to software, no
> real effect.
> 
> I've tried to start the 3rd encode with libx265 but that crushes the CPU.
> 
> h264_qsv is able to handle this.
> 
> It appears, at least on the surface, that this CPU w/ 28 video cores
> can only handle 2 h.265 encodes in quicksync but the specs seem to
> suggest it should do more.
> 
> Am I missing something obvious?
> 
> note, the first 2 streams are 1080i MPEG2 from an HDHomeRun.  The
> third stream I selected a 720p MPEG2 stream and even that doesn't work
> well.  Also, I am not using any deinterlacer, I removed them to try to
> get the third stream running.
> 
> Thanks for any feedback.
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list