sickbeard_mp4_automator: Error when attempting to burn-in subtitles using vaapi

I’m still looking online for a solution, but I think the error is caused because the same method for non-accelerated burn-in does not work for HW accelerated burn in.

Not using vaapi, does work normally.

Here is ffmpeg’s page with information: https://trac.ffmpeg.org/wiki/Hardware/VAAPI

ffmpeg’s example:

ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i input.mp4 -vf 'scale_vaapi,hwmap=mode=read+write+direct,format=nv12,ass=subtitles.ass,hwmap' -c:v h264_vaapi -b:v 2M -maxrate 2M output.mp4

Here is the output from the command trying to run via the script:

/usr/local/bin/ffmpeg -fix_sub_duration -i "/storage/media/tv/show/Season/episdoe.mkv" -vcodec h264_vaapi -map 0:0 -field_order progressive -vb 6000k -level 4.0 -vaapi_device /dev/dri/renderD128 -vf subtitles='/storage/media/tv/show/Season/episdoe.mkv':si=0;format=nv12,hwupload -c:a:0 copy -map 0:2 -metadata:s:a:0 title=5.1 Channel -metadata:s:a:0 language=eng -disposition:a:0 +default -c:s:0 mov_text -map 0:3 -disposition:s:0 +default -metadata:s:s:0 language=eng -c:s:1 mov_text -map 0:4 -metadata:s:s:1 language=eng -c:s:2 mov_text -map 0:5 -metadata:s:s:2 language=eng -f mp4 -threads 0 -metadata:g encoding_tool=SMA -level 40 -maxrate 6000k -y "/storage/media/tv/show/Season/episdoe.mp4"

The error message:

Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
  Stream #0:2 -> #0:1 (copy)
  Stream #0:3 -> #0:2 (subrip (srt) -> mov_text (native))
  Stream #0:4 -> #0:3 (subrip (srt) -> mov_text (native))
  Stream #0:5 -> #0:4 (subrip (srt) -> mov_text (native))
Press [q] to stop, [?] for help
[Parsed_subtitles_0 @ 0x55b454d1e600] Shaper: FriBidi 0.19.7 (SIMPLE)
Fontconfig error: Cannot load default config file
[Parsed_subtitles_0 @ 0x55b454d1e600] No usable fontconfig configuration file found, using fallback.
Fontconfig error: Cannot load default config file
[Parsed_subtitles_0 @ 0x55b454d1e600] Using font provider fontconfig
Simple filtergraph 'subtitles='/storage/media/tv/show/Season/episdoe.mkv':si=0;format=nv12,hwupload' was expected to have exactly 1 input and 1 output. However, it had >1 input(s) and >1 output(s). Please adjust, or use a complex filtergraph (-filter_complex) instead.
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

Found the problem, single character typo 5120b16de9c7899d165cd47db18d54dc766de49b

Hm that’s an oversight. It is applied for external subtitles but not for embedded bc5322f6d1ed068ca3de9595793af9439d533a07 Should fix it

d48332244433f1bbea69ab13e80d3cf25db9323e