VAAPI ffmpeg failure from mobile applications (Android, Chromecast) #540

Closed
opened 2025-12-21 16:52:43 +01:00 by backuprepo · 11 comments
Owner

Originally created by @joshuaboniface on GitHub (Mar 24, 2019).

Describe the bug
When trying to play video from the Android app or via Chromecast, while VAAPI is enabled, the generated ffmpeg arguments are invalid. This results in "no compatible streams are available". Only testing large 1080p x264 files.

To Reproduce

  1. Enable VAAPI trascoding.
  2. Connect with Android app.
  3. Attempt to play video.
  4. See error "No compatible streams are available".
  5. See ffmpeg failure in the logs.

Expected behavior
The ffmpeg should have a valid output setting under VAAPI for the target.

Logs

Mar 24 00:43:35 jf1 jellyfin[13771]: [WRN] HTTP Response 200 to ::ffff:10.42.0.X. Time (slow): 0:00:03.4421125. http://jf1/emby/videos/e8438f0f-141e-09ee-3a53-a75d6a4831af/stream.mkv?DeviceId=828a26f7f2ac9a36&MediaSourceId=e8438f0f141e09ee3a53a75d6a4831af&VideoCodec=h264,vp8,vp9&AudioCodec=mp3,aac,opus,flac,vorbis&AudioStreamIndex=1&VideoBitrate=5616000&AudioBitrate=384000&StartTimeTicks=27565016970&PlaySessionId=d6c609aba519433e94013793256cb83f&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=43f9fd46f20fb96cae7084aafaa15500&h264-profile=high,main,baseline,constrainedbaseline&h264-level=41&TranscodeReasons=ContainerBitrateExceedsLimit&allowVideoStreamCopy=false
Mar 24 00:43:35 jf jellyfin[13771]: [INF] User policy for joshua. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] RemoteClientBitrateLimit: 6000000, RemoteIp: ::ffff:10.42.0.146, IsInLocalNetwork: False
Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] Bitrate exceeds DirectStream limit: media bitrate: 9964596, max bitrate: 6000000
Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] Profile: Unknown Profile, Path: /srv/media/Video/TV/Grand Tour (2016), The/Season 3/Grand Tour (2016), The - S03E08 - International Buffoons' Vacation.mkv, isEligibleForDirectPlay:True, isEligibleForDirectStream: False
Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] Profile: Unknown Profile, No direct play profiles found for Path: /srv/media/Video/TV/Grand Tour (2016), The/Season 3/Grand Tour (2016), The - S03E08 - International Buffoons' Vacation.mkv
Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] /usr/share/jellyfin-ffmpeg/ffmpeg -ss 00:45:56.501 -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:"/srv/media/Video/TV/Grand Tour (2016), The/Season 3/Grand Tour (2016), The - S03E08 - International Buffoons' Vacation.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -force_key_frames "expr:gte(t,n_forced*5)" -vf "format=nv12|vaapi,hwupload" -b:v 5616000 -maxrate 5616000 -bufsize 11232000 -profile:v high -level 41 -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 libmp3lame -ac 2 -ab 384000 -af "volume=2" -y "/var/lib/jellyfin/transcoding-temp/ad9e5dd0470161e50f1893a03d5cc131.mkv"
Mar 24 00:43:36 jf1 jellyfin[13771]: [INF] FFMpeg exited with code 1
Mar 24 00:43:39 jf1 jellyfin[13771]: [WRN] HTTP Response 200 to ::ffff:10.42.0.X. Time (slow): 0:00:03.4614836. http://jf1/emby/videos/e8438f0f-141e-09ee-3a53-a75d6a4831af/stream.mkv?DeviceId=828a26f7f2ac9a36&MediaSourceId=e8438f0f141e09ee3a53a75d6a4831af&VideoCodec=h264,vp8,vp9&AudioCodec=mp3,aac,opus,flac,vorbis&AudioStreamIndex=1&VideoBitrate=5616000&AudioBitrate=384000&StartTimeTicks=27565016970&PlaySessionId=f0a2d2e197bc431f9fa66f0d7a3691fc&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=43f9fd46f20fb96cae7084aafaa15500&h264-profile=high,main,baseline,constrainedbaseline&h264-level=41&TranscodeReasons=ContainerBitrateExceedsLimit&allowVideoStreamCopy=false&allowAudioStreamCopy=false
Mar 24 00:43:39 jf1 jellyfin[13771]: [INF] Playback stopped reported by app Jellyfin Mobile 20854 playing International Buffoons' Vacation. Stopped at 2756501 ms

FFMPEG output error when run manually:

Press [q] to stop, [?] for help
[h264_vaapi @ 0x55c85ea2b280] B frames are not supported (0x1) by the underlying driver.
[h264_vaapi @ 0x55c85ea2b280] 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!

Screenshots
N/A

System (please complete the following information):

  • OS: Debian
  • Browser: Jellyfin Android
  • Jellyfin Version: master
  • Reverse proxy: haproxy

Additional context
I have a rough workaround that needs review, will PR shortly.

Quick fix attempt was a quick addition of -f mpegts to the output options in EncodingHelper.cs, but this doesn't seem to work - playback fails to start (doesn't even load the playback screen).

Originally created by @joshuaboniface on GitHub (Mar 24, 2019). **Describe the bug** When trying to play video from the Android app or via Chromecast, while VAAPI is enabled, the generated ffmpeg arguments are invalid. This results in "no compatible streams are available". Only testing large 1080p x264 files. **To Reproduce** 1. Enable VAAPI trascoding. 2. Connect with Android app. 3. Attempt to play video. 4. See error "No compatible streams are available". 5. See ffmpeg failure in the logs. **Expected behavior** The ffmpeg should have a valid output setting under VAAPI for the target. **Logs** ``` Mar 24 00:43:35 jf1 jellyfin[13771]: [WRN] HTTP Response 200 to ::ffff:10.42.0.X. Time (slow): 0:00:03.4421125. http://jf1/emby/videos/e8438f0f-141e-09ee-3a53-a75d6a4831af/stream.mkv?DeviceId=828a26f7f2ac9a36&MediaSourceId=e8438f0f141e09ee3a53a75d6a4831af&VideoCodec=h264,vp8,vp9&AudioCodec=mp3,aac,opus,flac,vorbis&AudioStreamIndex=1&VideoBitrate=5616000&AudioBitrate=384000&StartTimeTicks=27565016970&PlaySessionId=d6c609aba519433e94013793256cb83f&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=43f9fd46f20fb96cae7084aafaa15500&h264-profile=high,main,baseline,constrainedbaseline&h264-level=41&TranscodeReasons=ContainerBitrateExceedsLimit&allowVideoStreamCopy=false Mar 24 00:43:35 jf jellyfin[13771]: [INF] User policy for joshua. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] RemoteClientBitrateLimit: 6000000, RemoteIp: ::ffff:10.42.0.146, IsInLocalNetwork: False Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] Bitrate exceeds DirectStream limit: media bitrate: 9964596, max bitrate: 6000000 Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] Profile: Unknown Profile, Path: /srv/media/Video/TV/Grand Tour (2016), The/Season 3/Grand Tour (2016), The - S03E08 - International Buffoons' Vacation.mkv, isEligibleForDirectPlay:True, isEligibleForDirectStream: False Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] Profile: Unknown Profile, No direct play profiles found for Path: /srv/media/Video/TV/Grand Tour (2016), The/Season 3/Grand Tour (2016), The - S03E08 - International Buffoons' Vacation.mkv Mar 24 00:43:35 jf1 jellyfin[13771]: [INF] /usr/share/jellyfin-ffmpeg/ffmpeg -ss 00:45:56.501 -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:"/srv/media/Video/TV/Grand Tour (2016), The/Season 3/Grand Tour (2016), The - S03E08 - International Buffoons' Vacation.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -force_key_frames "expr:gte(t,n_forced*5)" -vf "format=nv12|vaapi,hwupload" -b:v 5616000 -maxrate 5616000 -bufsize 11232000 -profile:v high -level 41 -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 libmp3lame -ac 2 -ab 384000 -af "volume=2" -y "/var/lib/jellyfin/transcoding-temp/ad9e5dd0470161e50f1893a03d5cc131.mkv" Mar 24 00:43:36 jf1 jellyfin[13771]: [INF] FFMpeg exited with code 1 Mar 24 00:43:39 jf1 jellyfin[13771]: [WRN] HTTP Response 200 to ::ffff:10.42.0.X. Time (slow): 0:00:03.4614836. http://jf1/emby/videos/e8438f0f-141e-09ee-3a53-a75d6a4831af/stream.mkv?DeviceId=828a26f7f2ac9a36&MediaSourceId=e8438f0f141e09ee3a53a75d6a4831af&VideoCodec=h264,vp8,vp9&AudioCodec=mp3,aac,opus,flac,vorbis&AudioStreamIndex=1&VideoBitrate=5616000&AudioBitrate=384000&StartTimeTicks=27565016970&PlaySessionId=f0a2d2e197bc431f9fa66f0d7a3691fc&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=43f9fd46f20fb96cae7084aafaa15500&h264-profile=high,main,baseline,constrainedbaseline&h264-level=41&TranscodeReasons=ContainerBitrateExceedsLimit&allowVideoStreamCopy=false&allowAudioStreamCopy=false Mar 24 00:43:39 jf1 jellyfin[13771]: [INF] Playback stopped reported by app Jellyfin Mobile 20854 playing International Buffoons' Vacation. Stopped at 2756501 ms ``` FFMPEG output error when run manually: ``` Press [q] to stop, [?] for help [h264_vaapi @ 0x55c85ea2b280] B frames are not supported (0x1) by the underlying driver. [h264_vaapi @ 0x55c85ea2b280] 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! ``` **Screenshots** N/A **System (please complete the following information):** - OS: Debian - Browser: Jellyfin Android - Jellyfin Version: master - Reverse proxy: haproxy **Additional context** ~I have a rough workaround that needs review, will PR shortly.~ Quick fix attempt was a quick addition of `-f mpegts` to the output options in `EncodingHelper.cs`, but this doesn't seem to work - playback fails to start (doesn't even load the playback screen).
backuprepo 2025-12-21 16:52:43 +01:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@joshuaboniface commented on GitHub (Mar 24, 2019):

As discussed on Riot this might be because b frames are off, which isn't supported with VAAPI. Will try out some options there.

@joshuaboniface commented on GitHub (Mar 24, 2019): As discussed on Riot this might be because b frames are off, which isn't supported with VAAPI. Will try out some options there.
Author
Owner

@cvium commented on GitHub (Mar 24, 2019):

For reference: https://github.com/GPUOpen-LibrariesAndSDKs/AMF/issues/8

Newer AMD GPUs don't support B-frames. They can be disabled with -bf 0.

Some threads also seem to indicate a need for -profile:v 578 (constrained baseline). Not sure what the consequence is.

@cvium commented on GitHub (Mar 24, 2019): For reference: https://github.com/GPUOpen-LibrariesAndSDKs/AMF/issues/8 Newer AMD GPUs don't support B-frames. They can be disabled with `-bf 0`. Some threads also seem to indicate a need for `-profile:v 578` (constrained baseline). Not sure what the consequence is.
Author
Owner

@joshuaboniface commented on GitHub (Mar 25, 2019):

So it doesn't look like it's any of those things. The -bf 0 eliminates the warning about bframes not being supported, and profile:v 578 does nothing. In either case the underlying error Invalid data found when processing input is still present. All my research seemed to point to -f mpegts as the right solution to this particular issue, and my manual run confirms that, but this output format just isn't compatible with the mobile apps. I'll keep trying to find another.

Found -f mpeg also works, but similarly fails in the mobile app. So it looks like we need to know what that end is actually expecting. Or we direct play it somehow and bypass this entirely - maybe the logs offer a clue there.

@joshuaboniface commented on GitHub (Mar 25, 2019): So it doesn't look like it's any of those things. The `-bf 0` eliminates the warning about bframes not being supported, and `profile:v 578` does nothing. In either case the underlying error `Invalid data found when processing input` is still present. All my research seemed to point to `-f mpegts` as the right solution to this particular issue, and my manual run confirms that, but this output format just isn't compatible with the mobile apps. I'll keep trying to find another. Found `-f mpeg` also works, but similarly fails in the mobile app. So it looks like we need to know what that end is actually expecting. Or we direct play it somehow and bypass this entirely - maybe the logs offer a clue there.
Author
Owner

@stale[bot] commented on GitHub (Jul 29, 2019):

Issues go stale after 60d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 7d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

@stale[bot] commented on GitHub (Jul 29, 2019): Issues go stale after 60d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 7d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on [Matrix or Social Media](https://jellyfin.readthedocs.io/en/latest/getting-help/).
Author
Owner

@openlives commented on GitHub (Oct 30, 2019):

however In Release 10.4.0,VAAPI ffmpeg still failure from mobile applications for the Newer AMD GPUs

@openlives commented on GitHub (Oct 30, 2019): however In Release 10.4.0,VAAPI ffmpeg still failure from mobile applications for the Newer AMD GPUs
Author
Owner

@bandita00 commented on GitHub (Jan 22, 2020):

10.4.3, VAAPI with Intel GPU fails as well

@bandita00 commented on GitHub (Jan 22, 2020): 10.4.3, VAAPI with Intel GPU fails as well
Author
Owner

@JustAMan commented on GitHub (Jan 23, 2020):

Some VAAPI issues are fixed in master, wait till 10.5.0 release and check (or verify using nightlies).

@JustAMan commented on GitHub (Jan 23, 2020): Some VAAPI issues are fixed in master, wait till 10.5.0 release and check (or verify using nightlies).
Author
Owner

@zkvsky commented on GitHub (Jan 24, 2020):

Some VAAPI issues are fixed in master, wait till 10.5.0 release and check (or verify using nightlies).

@JustAMan Nigthlies are broken, at least for Linux, been for some time, can't access web interface or via anything

@zkvsky commented on GitHub (Jan 24, 2020): > Some VAAPI issues are fixed in master, wait till 10.5.0 release and check (or verify using nightlies). @JustAMan Nigthlies are broken, at least for Linux, been for some time, can't access web interface or via anything
Author
Owner

@dkanada commented on GitHub (Jan 24, 2020):

I have only heard that the portable installation is broken for nightlies. Is that the case for you as well?

@dkanada commented on GitHub (Jan 24, 2020): I have only heard that the portable installation is broken for nightlies. Is that the case for you as well?
Author
Owner

@zkvsky commented on GitHub (Jan 24, 2020):

@dkanada Yes, portable nightlies are broken for me, I'm on Linux. Neither docker or standalone is an option for me

@zkvsky commented on GitHub (Jan 24, 2020): @dkanada Yes, portable nightlies are broken for me, I'm on Linux. Neither docker or standalone is an option for me
Author
Owner

@marys1234 commented on GitHub (Jan 25, 2020):

Confirming that on 10.4.3, VAAPI with Intel GPU fails on mobile app.
Assuming waiting for 10.5.0 is needed...

@marys1234 commented on GitHub (Jan 25, 2020): Confirming that on 10.4.3, VAAPI with Intel GPU fails on mobile app. Assuming waiting for 10.5.0 is needed...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#540
No description provided.