Opened 3 years ago

Closed 2 years ago

#8042 closed defect (invalid)

AMD screen record + h/w vaapi encode to mkv fails

Reported by: soreau Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: vaapi
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
Trying to encode using vaapi fails if the container is mkv. With wf-recorder avformat_write_header() fails with "Invalid data found when processing input". This is a link to a email with an ffmpeg command to reproduce: Changing the output format to .mp4 in the command works.

How to reproduce:

% ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'hwupload' -vcodec h264_vaapi -bf 0 output.mkv


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!

ffmpeg version: git
built on: x86_64 linux

Attachments (2)

output.mp4 (63.5 KB ) - added by soreau 3 years ago.
The resulting .mp4 output (good/working)
mesa-report-packed-header-support.diff (583 bytes ) - added by soreau 3 years ago.
Proposed fix for mesa

Download all attachments as: .zip

Change History (4)

by soreau, 3 years ago

Attachment: output.mp4 added

The resulting .mp4 output (good/working)

comment:1 by James, 3 years ago

Keywords: vaapi added; radeonsi amd mkv removed

ff_isom_write_avcc() is returning an error, meaning the h264_vaapi encoder is either sending invalid extradata, or none at all, during init(). Apparently, the latter is the most likely case, probably due to a featureless driver.

The Matroska muxer checks the return value for errors and aborts, whereas the mp4 one ignores it and keeps going, creating a non spec complaint file that may or may not play depending on the presence of in-band headers, and how strict the demuxer is.

by soreau, 3 years ago

Proposed fix for mesa

comment:2 by Carl Eugen Hoyos, 2 years ago

Resolution: invalid
Status: newclosed

The observed behaviour seems intended.

Note: See TracTickets for help on using tickets.