jellyfin / jellyfin-androidtv

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

Seeking doesn't work for a few videos in direct play, works when transcoding. #3879

Open yashaskm11 opened 2 months ago

yashaskm11 commented 2 months ago

Describe the bug

Seeking doesn't work for a few videos, forward or rewind results in playback starting from the beginning. Resuming the video also results in the same. This behavior is only for a few files, one such file's media info is attached. When requested for a transcoded version, seeking works perfectly. Issue is only with direct play.

Logs

No response

FFmpeg logs

No response

Media info of the file

General
Unique ID                                : 2XXXX
Complete name                            : Filename.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 12.9 GiB
Duration                                 : 2 h 42 min
Overall bit rate                         : 11.4 Mb/s
Frame rate                               : 24.000 FPS
Movie name                               : Actual Name / Another Name
Encoded by                               : ME@me.me
ContentType                              : Movie
Description                              : Description goes here
Released date                            : 2023-10-20
Recorded date                            : 2023-10-20
Writing application                      : mkvmerge v76.0 ('Celebration') 64-bit
Writing library                          : libebml v1.4.4 + libmatroska v1.7.1
Copyright                                : ME@me.me
Cover                                    : Yes
Comment                                  : ME@me.me
Attachments                              : cover.jpg / kodi-metadata
ACTOR                                    : Actor 1 , Actor 2, 176 Characters
ARTIST                                   : Actor 1 , Actor 2, 176 Characters
DIRECTOR                                 : The Director
GENRE                                    : Genere1, Genere2
IMDB                                     : tt000000
PRODUCER                                 : Person Name
PRODUCTION_STUDIO                        : Studio Name
SCREENPLAY_BY                            : person Name
SUMMARY                                  : Description goes here
SYNOPSIS                                 : 205 characters including & , . and ""
WRITTEN_BY                               : Person Name

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 2 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 8 812 kb/s
Nominal bit rate                         : 10 000 kb/s
Width                                    : 1 920 pixels
Height                                   : 816 pixels
Display aspect ratio                     : 2.35:1
Frame rate mode                          : Constant
Frame rate                               : 24.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.234
Stream size                              : 9.99 GiB (77%)
Title                                    : ME
Language                                 : Language
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 2
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Codec ID                                 : A_EAC3
Duration                                 : 2 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 743 MiB (6%)
Title                                    : ME
Language                                 : Language
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Codec ID                                 : A_EAC3
Duration                                 : 2 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 743 MiB (6%)
Title                                    : ME
Language                                 : Language2
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No

Audio #3
ID                                       : 4
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Codec ID                                 : A_EAC3
Duration                                 : 2 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 743 MiB (6%)
Title                                    : ME
Language                                 : Language3
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No

Audio #4
ID                                       : 5
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Codec ID                                 : A_EAC3
Duration                                 : 2 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 743 MiB (6%)
Title                                    : ME
Language                                 : Language3
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No

Text
ID                                       : 6
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 2 h 39 min
Bit rate                                 : 59 b/s
Frame rate                               : 0.193 FPS
Count of elements                        : 1851
Stream size                              : 70.1 KiB (0%)
Title                                    : SDH
Language                                 : English
Default                                  : No
Forced                                   : No

Application version

0.17.1

Device information

Amazon Firestick 4k

Android version

Fire OS 6

Jellyfin server version

10.9.7

VampiricAlien commented 2 months ago

When transcoding, the server re-encodes the video into a more compatible format, allowing seeking to function properly. The issue could be video encoding.

Try ffmpeg -i "Filename.mkv" -c:v copy -c:a copy -movflags faststart "Output.mp4" or ffmpeg -i "Filename.mkv" -c:v copy -c:a copy -map 0 "Output.mkv"

glebaccon commented 2 months ago

Same for me with hevc movies 😔, i will paste media info ASAP

Media info:

Container: mkv Path: filename.mkv Size: 1906 MB

Subtitle Title: French Forced - Par défaut - Forcé - SUBRIP Language: fre Codec: SUBRIP AVC: No Default: Yes Forced: Yes External: No

Video Title: Reencod AvALoN x265 10bits 4000k cfr 2 pass slow Dolby Vision - 4K - HEVC - HDR Codec: HEVC AVC: No Profile: Main 10 Level: 150 Resolution: 3840x2160 Aspect ratio: 16:9 Anamorphic: No Interlaced: No Framerate: 23.976025 Bitrate: 5597 kbps Bit depth: 10 bit Video range: HDR Video range type: DOVIWithHDR10 DV title: DV Profile 8.1 (HDR10) DV version major: 1 DV version minor: 0 DV profile: 8 DV level: 6 DV rpu preset flag: 1 DV el preset flag: 0 DV bl preset flag: 1 DV bl signal compatibility id: 1 Color space: bt2020nc Color transfer: smpte2084 Color primaries: bt2020 Pixel format: yuv420p10le Ref frames: 1

Audio Title: French DDP 5.1 - Dolby Digital+ - Par défaut Language: fre Codec: EAC3 AVC: No Profile: Dolby Digital Plus + Dolby Atmos Layout: 5.1 Channels: 6 ch Bitrate: 768 kbps Sample rate: 48000 Hz Default: Yes Forced: No External: No

Audio Title: English DDP 5.1 - Dolby Digital+ Language: eng Codec: EAC3 AVC: No Profile: Dolby Digital Plus + Dolby Atmos Layout: 5.1 Channels: 6 ch Bitrate: 768 kbps Sample rate: 48000 Hz Default: No Forced: No External: No

Subtitle Title: French - SUBRIP Language: fre Codec: SUBRIP AVC: No Default: No Forced: No External: No

Subtitle Title: French - Malentendants - SUBRIP Language: fre Codec: SUBRIP AVC: No Default: No Forced: No External: No

Subtitle Title: English - SUBRIP Language: eng Codec: SUBRIP AVC: No Default: No Forced: No External: No

fritzmg commented 2 months ago

I am experiencing the same for many videos, though I cannot discern a pattern. Transcoding is enabled for all formats - except AV1 (which I have no videos in).

Seeking works fine on the regular Android app and on Windows and in all browsers - only in the AndroidTV app seeking always causes the video to restart, no matter what. I can also confirm that the video in question is in fact being transcoded, as the web player shows "Play method: Transcoding" under "Playback info".

This issue started to happen fairly recently, but I cannot say whether it was after a Jellyfin server update or an AndroidTV Jellyfin app update.

Application version

0.17.3

Device information

Philips 43PUS8535

Android version

11, Kernel 4.9.285-ab3673

Jellyfin server version

10.9.9

// edit: Interestingly, Windows Media Player is also unable to seek these videos. And both Windows Media Player and Jellyfin report the videos to be much longer than they actually are. A 50 minute long video is reported as being 1:04h long for example. MPC-BE is also having issues playing back these videos. So overall I think these are just badly encoded videos.