jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.73k stars 466 forks source link

Audio and video desync #3013

Closed Rihan9 closed 3 months ago

Rihan9 commented 1 year ago

Describe the bug

Hi, I'm experiencing and audio/video desync with almost all my videos. All my library is encoded with the following ffmpeg command: ffmpeg -progress pipe:1 -i {INPUTFILE} -map 0:v:0 -c:v hevc_nvenc -cq:v 19 -preset slow -map 0:a -c:a eac3 -b:a 512K

Logs

[2023-08-31 12:59:52.519 +00:00] [INF] [86] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "Client". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True [2023-08-31 12:59:52.520 +00:00] [INF] [86] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile="AndroidTV-ExoPlayer", Path="{OMITTED}.mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectPlay, TranscodeReason=0 ) "media:/videos/7f3b68aa-8aa6-543a-3345-74747acc3953/stream.mkv?MediaSourceId=7f3b68aa8aa6543a334574747acc3953&Static=true&VideoCodec=hevc&AudioCodec=eac3&AudioStreamIndex=1&api_key=&Tag=12a363347533fa105f2a0f4e17a74631" [2023-08-31 12:59:53.262 +00:00] [INF] [34] Jellyfin.Plugin.KodiSyncQueue.EntryPoints.UserSyncNotification: Started user data sync [2023-08-31 12:59:53.310 +00:00] [INF] [34] Jellyfin.Plugin.KodiSyncQueue.EntryPoints.UserSyncNotification: User Data Sync: User "Client" ("21427b247d474ba8b417e7d46673d444") posted 2 updates [2023-08-31 12:59:53.310 +00:00] [INF] [34] Jellyfin.Plugin.KodiSyncQueue.EntryPoints.UserSyncNotification: Finished user data sync, taking "00:00:00.0474797" [2023-08-31 13:00:38.655 +00:00] [INF] [29] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Android TV" "0.15.12" playing "Episodio 2". Stopped at "138432" ms

FFmpeg logs

No response

Media info of the file

No response

Application version

0.15.12

Device information

Philips 55PUS7504 (TPM191E)

Android version

Android 9

Jellyfin server version

10.8.10

Rihan9 commented 1 year ago

Hi guys, I can understand that this is an open source project with a lot of thinks to do, but your application, despite being focused to media content, does not have a player 100% working. I opened this issue and this: #3025, neither of them with a single comment.

Can I ask if you have a workaround to have the audio 100% working? I'm tired of hoping that the next update will fix it

jellyfin-bot commented 8 months ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

fice-t commented 8 months ago

Could you describe in more detail how to reproduce this? Such as:

One thing to note is that AFAIU the playback code is undergoing a major rewrite, which may inadvertently fix this issue (and perhaps your other issue) when it lands; this would mean that less attention is currently on tricky or hard to reproduce playback issues.

Rihan9 commented 8 months ago

Hi:

How long does it take for noticeable audio desync to occur?

30 to 60 seconds. The delay between audio/video keep increasing

Can you try reproducing with videos encoded with libx265 or x264 instead of hevc_nvenc, or stereo instead of eac3?

I will try to generate a couple of clips with different codec audio/video.

Could you provide a sample file that reproduces this behaviour?

Same of above, I will try to generate a couple of minutes video just for this test.

One thing to note is that AFAIU the playback code is undergoing a major rewrite, which may inadvertently fix this issue (and perhaps your other issue) when it lands; this would mean that less attention is currently on tricky or hard to reproduce playback issues.

Sweet. Should we wait for this instead try to solve this issue? There is an expected release date or a blog topic/issues/other which can I follow?

jellyfin-bot commented 4 months ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.