-
Notifications
You must be signed in to change notification settings - Fork 460
FFmpeg-qsv encoding failed when NumMbPerSlice < 50 #864
Comments
@lizhong1008 : https://patchwork.ffmpeg.org/patch/10778/ does not apply by itself, it has some prerequisites. Could you, please, list them all here? |
@dvrogozh , I don't know why ffmpeg patchwork just received 5 patches (7 patches in this series). |
Input stream is 1920x1088 meaning 120x68=8160 macroblocks. For 49 mb per slices we should have 167 slices. Issues happens on writing slices data for the 2nd or 3rd frame (not the first frame for sure) when encoder starts to write slice with the first_mb_inslice=8036. mediasdk h264 encoder throws an exception writing slices data from here:
Eventually we have less space in the output buffer allocated than needed. @stasefremov, @ogolikov : can you, please, suggest why this can happen? |
Any update? |
1 similar comment
Any update? |
After 58835b0 I see error gone for num_mb_per_slice=49, but now it (this can be other error inside mediasdk, but it has the same signature on ffmpeg level) happens on the threshold of 31/32 (at least in case of my clip):
@ogolikov : threshold of 32 is suspicious... Are there any natural limitation for the parameter to be >=32? or that's some other issue under the hood? |
Apply patch: https://patchwork.ffmpeg.org/patch/10778/
Then run:
./ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vframes 100 -c:v h264_qsv -flags qscale -global_quality 25 -num_mb_per_slice 49 -y test.mp4 -loglevel verbose
Encoding failed with error message:
[h264_qsv @ 0x2e9b480] Error during encoding: device failed (-17)
Video encoding failed
if set num_mb_per_slice >=50, everything is ok.
The test input clip can be downloaded from: http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4
The text was updated successfully, but these errors were encountered: