[FFmpeg-user] AMD screen record + h/w vaapi encode to mkv fails.

Andy Furniss adf.lists at gmail.com
Wed Mar 7 21:12:36 EET 2018


Andy Furniss wrote:
> Andy Furniss wrote:
>> Haven't had time to bisect, but I can't screengrab to mkv any more.
>> kmsgrab + playing with vsync etc. give the same error as this example, 
>> mp4 works OK.
> 
> Bisected to -
> 
> commit ae7df68edd79bce5c318810c6b307ee4e81cd2a6
> Author: James Almer <jamrial at gmail.com>
> Date:   Fri Nov 24 19:42:50 2017 -0300
> 
>      avformat/avc: return an error in ff_isom_write_avcc if the buffer 
> lenght is too small
> 
>      Signed-off-by: James Almer <jamrial at gmail.com>

I thought this was just screen rec initially, but it can be reproduced
with a transcode as well. Replacing mkv with mp4 in the examples will 
work OK.

Adding Mark to cc.

ffm -vaapi_device /dev/dri/renderD128 -i ~/abc-60fps.mp4 -an -sn -vf 
'format=nv12,hwupload' -c:v h264_vaapi -profile:v 578 -bf 0 -y ~/out.mkv
ffmpeg version N-90242-g5ab0ecf283 Copyright (c) 2000-2018 the FFmpeg 
developers
   built with gcc 7.3.0 (GCC)
   configuration: --prefix=/usr --disable-doc --enable-gpl 
--enable-libvpx --enable-libx265 --enable-libx264 --enable-gnutls 
--enable-libdrm --enable-libfreetype --enable-libmp3lame
   libavutil      56.  8.100 / 56.  8.100
   libavcodec     58. 13.102 / 58. 13.102
   libavformat    58. 10.100 / 58. 10.100
   libavdevice    58.  2.100 / 58.  2.100
   libavfilter     7. 12.100 /  7. 12.100
   libswscale      5.  0.102 /  5.  0.102
   libswresample   3.  0.101 /  3.  0.101
   libpostproc    55.  0.100 / 55.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/andy/abc-60fps.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf58.0.100
   Duration: 00:01:36.00, start: 0.000000, bitrate: 624 kb/s
     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
1920x1080, 619 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
     Metadata:
       handler_name    : VideoHandler
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
Press [q] to stop, [?] for help
[h264_vaapi @ 0x4062880] Warning: some packed headers are not supported 
(want 0xd, got 0).
Could not write header for output file #0 (incorrect codec parameters 
?): Invalid data found when processing input
Error initializing output stream 0:0 --
Conversion failed!


More information about the ffmpeg-user mailing list