[Mesa-dev] [PATCH] st/va: Fix vaSyncSurface with no outstanding operation
Mark Thompson
sw at jkqxz.net
Tue Sep 27 00:18:45 UTC 2016
On 27/09/16 00:49, Andy Furniss wrote:
> Mark Thompson wrote:
>> ---
>> A simple fix to the problem described here: <https://lists.freedesktop.org/archives/mesa-dev/2016-September/128076.html>.
>>
>> With this applied, the driver no longer hangs/crashes when vaSyncSurface() is called in places other than for the first time after an encode operation (including a second call on the same surface).
>
> Once I could get ffmpeg (patched) or avconv to roughly work (before the dual instance commit), but I can't get either to work now = produces unreadable file.
>
> Testing with git avconv I am trying -
>
> ./avconv -vaapi_device :0 -f rawvideo -framerate 50 -s 2560x1440 -pix_fmt nv12 -i /mnt/ramdisk/trees-1440p50.nv12 -vframes 5 -vf 'hwupload' -c:v h264_vaapi -profile:v 66 -b:v 40M -bf 0 -g 30 -f h264 -y /mnt/ramdisk/out.264
>
> but debugging printfs show refs = 2 and bframes enabled (I also notice with your baseline patch that -profile:v 66 fails).
>
> Do you have an example that works for you with avconv + this patch?
Yes: this patch <https://lists.libav.org/pipermail/libav-devel/2016-September/079207.html> is also required to match the vaSyncSurface() change. The rest of the that series to libav and the one to mesa for config setup makes it all a bit more sensible (doesn't submit a load of packed headers which are ignored), but it does mostly work without.
With all of those, the commands:
./avconv -y -vaapi_device /dev/dri/renderD129 -i in.mp4 -an -vf 'format=nv12,hwupload' -c:v h264_vaapi -bf 0 out.mp4
./avconv -y -vaapi_device /dev/dri/renderD129 -hwaccel vaapi -hwaccel_output_format vaapi -i in.mp4 -an -c:v h264_vaapi -bf 0 out.mp4
./avconv -y -vaapi_device /dev/dri/renderD129 -hwaccel vaapi -hwaccel_output_format vaapi -i in.mp4 -an -vf 'scale_vaapi=w=1280:h=720' -c:v h264_vaapi -bf 0 out.mp4
work sensibly for me (also with -b for CBR, -qp for CQP, -g for GOP size); I imagine raw video as in your example would also be fine. On profile, constrained baseline on the command line is 578 (== 66 | 0x200, for constraint_set1_flag).
Thanks,
- Mark
More information about the mesa-dev
mailing list