2

I'm trying to transcode an 854x480 h264 mp4 video to an h265 mp4 video using vaapi.

The video does come out nice looking, and is encoded very quickly. But there is a black bar on the right side of the video. If I change my command to upscale to 1280x720 this does not happen.

ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i 1.mp4 -c:v hevc_vaapi -vf scale_vaapi=854:480 -ss 00:00:0.0 -t 10 -maxrate 400 output.mp4
Xenon
  • 31
  • 2

1 Answers1

0

Are you using AMD hardware?

AFAICS this a bug in using HW-acceleration on AMD. (Ubuntu 20.04, ffmpeg 4.2.4.1, Mesa 20.0.8)

[hevc_vaapi @ 0x5644267bf7c0] Driver does not support some wanted packed headers (wanted 0xd, found 0).
[hevc_vaapi @ 0x5644267bf7c0] Driver does not support packed sequence headers, but a global header is requested.
[hevc_vaapi @ 0x5644267bf7c0] No global header will be written: this may result in a stream which is not usable for some purposes (e.g. not muxable to some containers).
[hevc_vaapi @ 0x5644267bf7c0] Cropping information on input frames ignored due to lack of API support.

It doesn't happen using software encoding:

So as a workaround use hevc/lib265x instead of hevc_vaapi.

 -c:v hevc
Janghou
  • 373
  • 2
  • 7
  • "-c:v hevc" worked, but it is missing HW acceleration and is several times slower :-/ i also see the yellow text message "[hevc_vaapi @ 0x5610856a3fc0] Driver does not support some wanted packed headers (wanted 0xd, found 0x1)." ([ffmpeg output](https://bin.disroot.org/?0e6ac64a8795ae89#CUdZ9urWe17YGjnAL8Thxo7neGZ1W8x3mwbE8W38V727)) so please how to hevc AMD HW encode without black bar or remove it post process without recoding? Is this some bug, in some component, where to report it please? – 16851556 Apr 02 '21 at 10:54