jellyfin / jellyfin-roku

The Official Roku Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
438 stars 133 forks source link

Direct play of transport stream media (e.g. live tv recording) has incorrect duration and cannot seek back/forwards #1850

Open ch6574 opened 1 month ago

ch6574 commented 1 month ago

Software Versions

Describe the bug

Playback media that is contained in a transport stream "ts" file in Direct Play mode (not transcoded) and observe that the duration is wildly inaccurate, and that seek back/forwards is impossible. Try the same media on a web browser or Android client and see that is works correctly.

How To Reproduce

Create two 10 second test files (a "ts" and a "mkv") with keyframes as follows:

ffmpeg -f lavfi -i "testsrc=duration=10:size=1920x1080" -c:v libx264 -x264-params keyint=25 -pix_fmt yuv420p test_01.ts
ffmpeg -f lavfi -i "testsrc=duration=10:size=1920x1080" -c:v libx264 -x264-params keyint=25 -pix_fmt yuv420p test_02.mkv

Then play them back via Firefox, Android, and Roku clients:

Test Firefox Android Roku
test_01 (h264 in a ts) Direct Play :white_check_mark: Direct Play :white_check_mark: Direct Play, no seek/skip, shows 5h 45min long :x:
test_02 (h264 in a mkv) Direct Play :white_check_mark: Direct Play :white_check_mark: Direct Play :white_check_mark:

Expected behavior

Ability to seek back / forwards as per other clients.

Logs

n/a

Screenshots

See https://github.com/jellyfin/jellyfin/issues/12244#issuecomment-2216299713

Connection Information

Additional context

I also filed https://github.com/jellyfin/jellyfin/issues/12244 should this be a backend issue, however other clients don't suffer this issue.

cewert commented 1 month ago

Can you try playing the file using the Roku Media Player? If the file doesn't play then there is no hope of the file working with our app

ch6574 commented 1 month ago

I can do. What's the easiest way to do this while ruling out as much else as possible - put it on a USB stick?

cewert commented 1 month ago

The app only supports USB and DLNA IIRC so whichever is easier for you. Feel free to test any and all files you think may be bugged using the roku client

ch6574 commented 1 month ago

I just did a local play with these test files on USB in Roku Media Player and observed:

So the difference with the "ts" file locally is the Roku now presents no controls at all!

Interestingly, with remote play of these on the Jellyfin backend there's no "FFmpeg.DirectStream" log created, unlike with Android or Firefox, which I guess is wrapping it in a HLS stream for them, but not for Roku clients?

InvestigationNation commented 1 week ago

I encountered this same issue (Direct Play of .ts files resulting in bad time hacks and disabled forward/rewind navigation) and my workaround was modifying app Settings-->Playback-->Video Codec Support and disabling "Support Direct Play" for both MPEG-2 and MPEG-4.