Error when attempting to burn-in subtitles using vaapi
See original GitHub issueI’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!
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (18 by maintainers)
Top Results From Across the Web
Transcoding using VAAPI with burn-in subtitles fails (FFMPEG ...
Describe the bug This is a continuation of #642. I am unable to transcode a regular mp4 + srt, or mkv, or any...
Read more >[HELP] VAAPI transcode with subtitle burn. : r/ffmpeg - Reddit
But when I try to VAAPI transcode and burn in subtitles using: ffmpeg -vaapi_device /dev/dri/renderD128 -i ... Error reinitializing filters!
Read more >ASS burn-in takes long time to begin on hw transcoding (vaapi ...
We are aware of this issue. The problem is that the ffmpeg filter for burning in subtitles needs to read and parse the...
Read more >Hardware Acceleration | Jellyfin
VA-API is a Video Acceleration API that uses libva to interface with ... tone-mapping and subtitle burn-in) on Intel, AMD and NVIDIA hardware...
Read more >Burn subtitles in a stop motion video, with hardware acceleration
I'm trying to make a year long stop motion video with the images taken from a webcam. ... ffmpeg \ -y \ -hwaccel...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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