jellyfin / jellyfin-roku

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

Fast Forward / Rewind / Skipping Ahead does not work for some files #684

Closed adam-frisby closed 7 months ago

adam-frisby commented 2 years ago

Describe the bug Attempting to skip ahead when watching certain video files on certain roku models results in playback restarting from the beginning. This is occurring on my TCL Roku TV models but not on a 3800X streaming stick.

General
Unique ID                                : 52432409385019185666788444467161506483 (0x27721D5EE2DB497E2FAB1E0C3D10A2B3)
Complete name                            : REDACTED.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 1.20 GiB
Duration                                 : 45 min 27 s
Overall bit rate                         : 3 791 kb/s
Movie name                               : Rejoined
Encoded date                             : UTC 2020-06-01 16:08:14
Writing application                      : mkvmerge v46.0.0 ('No Deeper Escape') 64-bit
Writing library                          : libebml v1.3.10 + libmatroska v1.5.2

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.2
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 45 min 27 s
Bit rate                                 : 3 267 kb/s
Width                                    : 1 266 pixels
Height                                   : 960 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 23.810 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.113
Stream size                              : 1.04 GiB (86%)
Writing library                          : x264 core 158
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 45 min 27 s
Bit rate mode                            : Constant
Bit rate                                 : 448 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                              : 146 MiB (12%)
Title                                    : Main Feature AC3 5.1ch 448 kbps
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Language                                 : English
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:Past Life Present
00:06:04.965                             : en:Taboo
00:11:56.582                             : en:Mature Adults
00:18:31.311                             : en:2200 At Quark's
00:23:41.019                             : en:Stardate 49195.5
00:28:11.757                             : en:Eyes Wide Open
00:35:07.339                             : en:Never Again
00:38:35.880                             : en:Worth The `Price
ffprobe version 4.2.7-0ubuntu0.1 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, matroska,webm, from 'REDACTED.mkv':
  Metadata:
    title           : Rejoined
    creation_time   : 2020-06-01T16:08:14.000000Z
    ENCODER         : Lavf58.33.100
  Duration: 00:45:27.84, start: 0.000000, bitrate: 3790 kb/s
    Chapter #0:0: start 0.000000, end 364.965000
    Metadata:
      title           : Past Life Present
    Chapter #0:1: start 364.965000, end 716.582000
    Metadata:
      title           : Taboo
    Chapter #0:2: start 716.582000, end 1111.311000
    Metadata:
      title           : Mature Adults
    Chapter #0:3: start 1111.311000, end 1421.019000
    Metadata:
      title           : 2200 At Quark's
    Chapter #0:4: start 1421.019000, end 1691.757000
    Metadata:
      title           : Stardate 49195.5
    Chapter #0:5: start 1691.757000, end 2107.339000
    Metadata:
      title           : Eyes Wide Open
    Chapter #0:6: start 2107.339000, end 2315.880000
    Metadata:
      title           : Never Again
    Chapter #0:7: start 2315.880000, end 2727.840000
    Metadata:
      title           : Worth The Price
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1266x960, 23.81 fps, 23.81 tbr, 1k tbn, 50 tbc (default)
    Metadata:
      ENCODER         : Lavc58.59.102 libx264
      BPS-eng         : 3340158
      DURATION-eng    : 00:45:27.809000000
      NUMBER_OF_FRAMES-eng: 65685
      NUMBER_OF_BYTES-eng: 1138914425
      _STATISTICS_WRITING_APP-eng: mkvmerge v46.0.0 ('No Deeper Escape') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-06-01 16:08:14
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : Main Feature AC3 5.1ch 448 kbps
      BPS-eng         : 448000
      DURATION-eng    : 00:45:27.840000000
      NUMBER_OF_FRAMES-eng: 85245
      NUMBER_OF_BYTES-eng: 152759040
      _STATISTICS_WRITING_APP-eng: mkvmerge v46.0.0 ('No Deeper Escape') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-06-01 16:08:14
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      BPS-eng         : 67
      DURATION-eng    : 00:43:18.443000000
      NUMBER_OF_FRAMES-eng: 741
      NUMBER_OF_BYTES-eng: 21905
      _STATISTICS_WRITING_APP-eng: mkvmerge v46.0.0 ('No Deeper Escape') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-06-01 16:08:14
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Does not work: TCL 49S517 & TCL 55S535 Works: Roku Streaming Stick 3800X

Server is 10.8.1. Tested with latest release and dev builds of roku plugin.

To Reproduce

  1. Open video
  2. Fast forward
  3. Play
  4. Video starts from the beginning

Expected behavior Video to begin playing from selected location

adam-frisby commented 2 years ago

After re-encoding the audio to mp3 2ch, the issue is no longer reproducible.

ffprobe version 4.2.7-0ubuntu0.1 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, matroska,webm, from 'REDACTED.mkv':
  Metadata:
    title           : Rejoined
    ENCODER         : Lavf58.20.100
  Duration: 00:45:27.86, start: 0.000000, bitrate: 3504 kb/s
    Chapter #0:0: start 0.000000, end 364.965000
    Metadata:
      title           : Past Life Present
    Chapter #0:1: start 364.965000, end 716.582000
    Metadata:
      title           : Taboo
    Chapter #0:2: start 716.582000, end 1111.311000
    Metadata:
      title           : Mature Adults
    Chapter #0:3: start 1111.311000, end 1421.019000
    Metadata:
      title           : 2200 At Quark's
    Chapter #0:4: start 1421.019000, end 1691.757000
    Metadata:
      title           : Stardate 49195.5
    Chapter #0:5: start 1691.757000, end 2107.339000
    Metadata:
      title           : Eyes Wide Open
    Chapter #0:6: start 2107.339000, end 2315.880000
    Metadata:
      title           : Never Again
    Chapter #0:7: start 2315.880000, end 2727.840000
    Metadata:
      title           : Worth The Price
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1266x960, 23.81 fps, 23.81 tbr, 1k tbn, 50 tbc (default)
    Metadata:
      ENCODER         : Lavc58.59.102 libx264
      BPS-eng         : 3340158
      DURATION-eng    : 00:45:27.809000000
      NUMBER_OF_FRAMES-eng: 65685
      NUMBER_OF_BYTES-eng: 1138914425
      _STATISTICS_WRITING_APP-eng: mkvmerge v46.0.0 ('No Deeper Escape') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-06-01 16:08:14
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      DURATION        : 00:45:27.832000000
    Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, fltp, 160 kb/s (default)
    Metadata:
      title           : Main Feature AC3 5.1ch 448 kbps
      BPS-eng         : 448000
      DURATION-eng    : 00:45:27.840000000
      NUMBER_OF_FRAMES-eng: 85245
      NUMBER_OF_BYTES-eng: 152759040
      _STATISTICS_WRITING_APP-eng: mkvmerge v46.0.0 ('No Deeper Escape') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-06-01 16:08:14
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      ENCODER         : Lavc58.35.100 libmp3lame
      DURATION        : 00:45:27.863000000
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      BPS-eng         : 67
      DURATION-eng    : 00:43:18.443000000
      NUMBER_OF_FRAMES-eng: 741
      NUMBER_OF_BYTES-eng: 21905
      _STATISTICS_WRITING_APP-eng: mkvmerge v46.0.0 ('No Deeper Escape') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-06-01 16:08:14
      DURATION        : 00:43:31.124000000
APost-It commented 1 year ago

I'm still experiencing this issue as well with my TCL Roku TV with a show series that has been ripped from TV as mkv.

gajwani commented 11 months ago

This is definitely still happening on my Roku Ultra. I'll try re-encoding as well to add more information.

Does anyone have any idea what part of the codebase to look into to try and find this issue? I'm going to try and work on it, but it's my first involvement and some direction would be much appreciated if it can be provided.

cewert commented 11 months ago

@gajwani there's been some changes to the device profile since the last stable release that might affect this behavior.

First step would be reproducing the bug using the unstable branch.

Next step would be figuring out what's different about the files showing this behavior. Is it only certain video codecs? audio codecs? number of audio channels? etc. etc.

Once you figure that out I can help point you to parts of the code that may be responsible.

gajwani commented 11 months ago

To quickly summarize where I am:

  1. I was previously using the released version of the app on the Roku store, it exhibited the bug.
  2. I have the code building on my machine, so I'm ready to modify it if necessary.
  3. I have run the latest unstable, and the bug is still being exhibited, for the same file.

Here is the ffprobe output for the file:

ffprobe version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from 'REDACTED.mkv':
  Duration: 01:12:10.99, start: 0.000000, bitrate: 4295 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 1267.150000
      Metadata:
        title           : PART_01
    Chapter #0:1: start 1267.150000, end 2137.060000
      Metadata:
        title           : PART_02
    Chapter #0:2: start 2137.060000, end 3240.220000
      Metadata:
        title           : PART_03
    Chapter #0:3: start 3240.220000, end 3569.110000
      Metadata:
        title           : PART_04
    Chapter #0:4: start 3569.110000, end 4330.986000
      Metadata:
        title           : PART_05
  Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
  Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
  Stream #0:2(eng): Subtitle: dvb_subtitle
  Stream #0:3(eng): Subtitle: subrip

I have not been able to re-encode and try as @adam-frisby did, that is next.

cewert commented 11 months ago

@gajwani Is the file direct playing or transcoding?

I noticed you're using an h264 file but I don't see the level listed or maybe I'm just missing it. Do you have the playback.tryDirect.h264ProfileLevel user setting enabled? If so, can you try disabling it and see if you can reproduce?

Also, can you pause the show? Do the playback times show up on either side of the progress bar?

1hitsong commented 7 months ago

If you're still experiencing this issue, please post to the troubleshooting forum. There are tons of great people help who can help dive into issues like this.

https://forum.jellyfin.org/f-troubleshooting