Video preview thumbnail generation fails with certain Blu-ray rips (NOT re-encoded)

Go head and help them please?

I have other code to finish and threads to reply to.

I told 'em the files were borkened days ago… but here’s my parting shot:

The first appearance of Stinky The Albatross shows up in MakeMKV like this with it’s funky undies on every (unneeded) track on the left - just waiting for Handbrake (or DVD FAB for that matter) to turn a bouquet of roses into a bucket of Fermented Hurl:

Highlight Stinky
Delete
Hit Enter:

Did somebody light some incense?
It sure smells better in here…:

… and that’s how you murder an embedded Title Field from jump street…

and now you can right click the topmost field to the left where Stinky used to live and Deselect ALL - then turn on what you want.

I mean I can see an audio track labeled Japanese.
I might as well leave that one behind - considering I don’t speak Japanese and none of my Japanese friends do either…

:slight_smile:

We’re aware that re-encoding is the (obvious) workaround today.

These are H.264 streams that the Plex video preview thumbnail generator doesn’t handle correctly. We believe the streams themselves to be valid, and are asking for help escalating this appropriately at Plex.

Re-muxing them with MKVToolNix doesn’t avoid the issue. Nor does extracting just the video to an MP4 container - that has the same symptoms in ffmpeg/ffprobe and Plex itself.

Here’s the same H.264 video stream by itself an MP4 container.

https://ufile.io/abrjky0t

So the official message is ā€œIt’s not us, it’s your filesā€? Even when the files are ripped directly from Blu-rays, and a particular label of Blu-rays consistently, and other people have had similar problems, and Volts has put some work in and actually demonstrated that there’s a bug in ffmpeg when encountering some files’ frame encoding, which can be worked around?

Wow.

@JuiceWSA, the problem is not with MKV files. It doesn’t matter which container or format you put the video in, it still won’t work when being indexed. The problem, as I’m pretty certain Volts has discovered, is a bug in ffmpeg and hence Plex Media Encoder. Being snarky and dismissive doesn’t help.

@ChuckPa, I don’t think Volts is part of your dev team, is he? But he’s shown far more interest in actually potentially solving this problem than anyone else rather than ā€œI have other code to finish and threads to reply to.ā€ He’s also far more patient than I am with this attitude…

Here is a trailer ripped directly from The Exorcist III Blu-ray disc (original), using MakeMKV. Good luck getting it to index correctly in Plex. Note that all Arrow discs seem to use this encoding.

@JuiceWSA, comments?

Thank you for this next test file.

I will go through it and examine.

Thank you!

What should I be seeing ?

Scanned (in Other Video section) - frame grab performed.

Pause playback in Plex/Web and screenshot.

[chuck@lizum user-Volts.518]$ ffmpeg -i Raelworld-test.mkv 
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.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 'Raelworld-test.mkv':
  Metadata:
    title           : THE EXORCIST III
    encoder         : libmakemkv v1.15.2 (1.3.10/1.5.2) win(x64-release)
    creation_time   : 2020-07-27T21:34:52.000000Z
  Duration: 00:02:25.73, start: 0.000000, bitrate: 8166 kb/s
    Chapter #0:0: start 0.000000, end 31.781750
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 31.781750, end 65.023292
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 65.023292, end 81.039292
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 81.039292, end 113.113000
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 113.113000, end 129.254125
    Metadata:
      title           : Chapter 05
    Chapter #0:5: start 129.254125, end 145.728917
    Metadata:
      title           : Chapter 06
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Metadata:
      BPS-eng         : 7971347
      DURATION-eng    : 00:02:25.728916666
      NUMBER_OF_FRAMES-eng: 3494
      NUMBER_OF_BYTES-eng: 145206061
      SOURCE_ID-eng   : 001011
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.15.2 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-07-27 21:34:52
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      title           : Stereo
      BPS-eng         : 192000
      DURATION-eng    : 00:02:25.728000000
      NUMBER_OF_FRAMES-eng: 4554
      NUMBER_OF_BYTES-eng: 3497472
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.15.2 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-07-27 21:34:52
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
At least one output file must be specified
[chuck@lizum user-Volts.519]$

Was Plex able to generate video preview thumbnails for the test file?

yes. as shown in the first screenshot. ( left-most image of the 3 )

Not standard thumbnails, that works fine. We mean video preview thumbs - the ones that are used when scrubbing the timeline in some apps. See my screenshot for the error that happens there.

1 Like

I will go pull the logs and review them now

1 Like

Sorry, I mean video preview thumbnails. The index-sd.bif files that are used to provide FF/RWD previews and show up in the ā€œnow playingā€ screens.

They’re usually indicated as ā€œIndexes SDā€ on the Media Info screen, but not present here.

I expect you got this in the logs:

Jul 27, 2020 16:45:58.195 [0x8109e7500] DEBUG - BaseIndexFrameFileManager: building index (320x240) for parts for MetadataItem 112563 (The Exorcist III)
Jul 27, 2020 16:46:03.429 [0x8109e7500] ERROR - BaseIndexFrameFileManager: expected 72 images, but found 0

I don’t have them in this test library. I have BIFs generate during scheduled time if need be.

I will say this: This second file is clean. It’s what I would expect and what I always get from MakeMKV / MKVtoolnix. The first file, with its attached images, is, imho, asking for trouble.

I must caveat that by saying I do not have, nor do I use, Windows nor those tools.
I have been Unix / Linux my entire career (started in 1983).

Well, generating the BIFs is the whole problem. In all other respects the files play fine, and chapter thumbnails etc. work. Please try to generate a BIF for this file.

Will you also try something for me?

  1. Take the problematic file
  2. Run it through MKVToolnix - stripping (deleting) the attachments
  3. Outputting that file to a new location which can be then used to create a dedicated ā€œTest Movieā€ library section.
  4. When it’s done remuxing, Create the new section and let PMS do its thing on that single file.
  5. When it’s done adding and generating the BIF (otherwise sitting idle ), Download the Logs ZIP file and attach them.

This will be your way to independently duplicate what I see here.

What this accomplishes is:

  1. We take the original problematic source
  2. Run it through mkvtoolnix to remove the attachments
  3. See what happens in PMS.

From those logs, we will know if it’s a file problem or a core FFMPEG problem or a BIF generation problem (Plex).

Done. There are no attachments in my MKV files, and there are none in this file, but I put it through MKVToolnix anyway.

The usual BaseIndexFrameFileManager error appeared as expected and the BIF is not created. Log file enclosed… Timestamp is Jul 28, 2020 00:44:11.667
Plex Media Server Logs_2020-07-28_00-44-21.zip (1.8 MB)

There is definitely something going on here.

I see your 404 errors

Jul 28, 2020 00:44:09.074 [0x7f6ae0a0f700] DEBUG - Completed: [127.0.0.1:46900] 206 PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress?status=opened (9 live) 0ms 371 bytes (pipelined: 4) (range: bytes=0-) 
Jul 28, 2020 00:44:09.074 [0x7f6a75ffb700] DEBUG - Request: [127.0.0.1:46900 (Loopback)] PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/stream?index=0&id=0&codec=h264&type=video (9 live) Signed-in Token (Raelworld) (range: bytes=0-) 
Jul 28, 2020 00:44:09.074 [0x7f6ae1210700] DEBUG - Completed: [127.0.0.1:46900] 404 PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/stream?index=0&id=0&codec=h264&type=video (9 live) 0ms 288 bytes (pipelined: 5) (range: bytes=0-) 
Jul 28, 2020 00:44:09.074 [0x7f6a377fe700] DEBUG - Request: [127.0.0.1:46902 (Loopback)] PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/stream?index=0&id=0&codec=h264&type=video (9 live) Signed-in Token (Raelworld) (range: bytes=0-) 
Jul 28, 2020 00:44:09.074 [0x7f6ae0a0f700] DEBUG - Completed: [127.0.0.1:46902] 404 PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/stream?index=0&id=0&codec=h264&type=video (9 live) 0ms 288 bytes (pipelined: 1) (range: bytes=0-) 
Jul 28, 2020 00:44:09.075 [0x7f6a597fa700] DEBUG - Request: [127.0.0.1:46904 (Loopback)] PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/stream?index=1&id=0&codec=ac3&type=audio (9 live) Signed-in Token (Raelworld) (range: bytes=0-) 
Jul 28, 2020 00:44:09.075 [0x7f6ae1210700] DEBUG - Completed: [127.0.0.1:46904] 404 PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/stream?index=1&id=0&codec=ac3&type=audio (9 live) 0ms 288 bytes (pipelined: 1) (range: bytes=0-) 
Jul 28, 2020 00:44:09.138 [0x7f6a9ffff700] DEBUG - Request: [127.0.0.1:46906 (Loopback)] PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/streamDetail?index=0&id=0&codec=h264&type=video&profile=High&language=eng&width=1920&height=1080&interlaced=0&sar=1:1&level=41&frameRate=23.976 (9 live) Signed-in Token (Raelworld) (range: bytes=0-) 
Jul 28, 2020 00:44:09.138 [0x7f6ae0a0f700] DEBUG - Completed: [127.0.0.1:46906] 404 PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/streamDetail?index=0&id=0&codec=h264&type=video&profile=High&language=eng&width=1920&height=1080&interlaced=0&sar=1:1&level=41&frameRate=23.976 (9 live) 0ms 288 bytes (pipelined: 1) (range: bytes=0-) 
Jul 28, 2020 00:44:09.138 [0x7f6a37fff700] DEBUG - Request: [127.0.0.1:46908 (Loopback)] PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/streamDetail?index=1&id=0&codec=ac3&type=audio&bitrate=192000&language=eng&channels=2&layout=stereo&sampleRate=48000&disp_default=1 (9 live) Signed-in Token (Raelworld) (range: bytes=0-) 
Jul 28, 2020 00:44:09.138 [0x7f6ae1210700] DEBUG - Completed: [127.0.0.1:46908] 404 PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress/streamDetail?index=1&id=0&codec=ac3&type=audio&bitrate=192000&language=eng&channels=2&layout=stereo&sampleRate=48000&disp_default=1 (9 live) 0ms 288 bytes (pipelined: 1) (range: bytes=0-) 
Jul 28, 2020 00:44:09.139 [0x7f6a75ffb700] DEBUG - Request: [127.0.0.1:46910 (Loopback)] PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress?duration=145.729000 (9 live) Signed-in Token (Raelworld) (range: bytes=0-) 
Jul 28, 2020 00:44:09.139 [0x7f6ae0a0f700] DEBUG - Completed: [127.0.0.1:46910] 206 PUT /video/:/transcode/session/bif/2032e069-8cf8-4430-a577-16ee6d8f204b/progress?duration=145.729000 (9 live) 0ms 371 bytes (pipelined: 1) (range: bytes=0-) 

Further, I see this: (BaseFrameIndex errors)

Jul 27, 2020 19:45:59.605 [0x7ffb008cf700] DEBUG - Jobs: '/share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Plex Transcoder' exit code for process 4613 is 0 (success)
Jul 27, 2020 19:45:59.605 [0x7ffa0f735700] ERROR - BaseIndexFrameFileManager: expected 3099 images, but found 0
Jul 27, 2020 19:45:59.606 [0x7ffa0f735700] DEBUG - Updating part with ID=158599 [/share/NFSv=4/qa/bif/user-Volts/robocop.mkv]
Jul 27, 2020 19:45:59.606 [0x7ffa0f735700] DEBUG - Activity: Ended activity b027e219-ed92-4a88-83b9-c5a832dc962d.
Jul 27, 2020 19:45:59.617 [0x7ffaf8fd8700] DEBUG - BlurHashManager: Generated for item 124575 thumb in 26 ms.
Jul 27, 2020 19:45:59.617 [0x7ffaf8fd8700] DEBUG - Photo transcoder: Request for url [/library/metadata/124575/art/1595893542] (is local: 1 upscaled: 0)
Jul 27, 2020 19:45:59.618 [0x7ffaf8fd8700] DEBUG - Calling back into ourselves for photo to transcode, optimizing the process (status: 404)
Jul 27, 2020 19:45:59.618 [0x7ffaf8fd8700] DEBUG - Photo transcoder: Request for url [/library/metadata/124576/thumb/1595893542] (is local: 1 upscaled: 0)
Jul 27, 2020 19:45:59.619 [0x7ffaf8fd8700] DEBUG - Computed media url for item 124576: http://127.0.0.1:43591/system/agents/media/get?guid=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F71637%2F3%2F21%3Flang%3Den&mediaType=4&url=metadata%3A%2F%2Fseasons%2F3%2Fepisodes%2F21%2Fthumbs%2Fcom%2Eplexapp%2Eagents%2Ethetvdb_190b1d29c446426cc0631bf476c39e229253cc56
Jul 27, 2020 19:45:59.619 [0x7ffaf8fd8700] DEBUG - HTTP requesting GET http://127.0.0.1:43591/system/agents/media/get?guid=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F71637%2F3%2F21%3Flang%3Den&mediaType=4&url=metadata%3A%2F%2Fseasons%2F3%2Fepisodes%2F21%2Fthumbs%2Fcom%2Eplexapp%2Eagents%2Ethetvdb_190b1d29c446426cc0631bf476c39e229253cc56
Jul 27, 2020 19:45:59.621 [0x7ffaf8fd8700] DEBUG - HTTP 200 response from GET http://127.0.0.1:43591/system/agents/media/get?guid=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F71637%2F3%2F21%3Flang%3Den&mediaType=4&url=metadata%3A%2F%2Fseasons%2F3%2Fepisodes%2F21%2Fthumbs%2Fcom%2Eplexapp%2Eagents%2Ethetvdb_190b1d29c446426cc0631bf476c39e229253cc56
Jul 27, 2020 19:45:59.621 [0x7ffaf8fd8700] DEBUG - Calculated media file path for path [metadata://seasons/3/episodes/21/thumbs/com.plexapp.agents.thetvdb_190b1d29c446426cc0631bf476c39e229253cc56]: ["/share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Metadata/TV Shows/8/1df8b23e07204a698b6aaa6c526352e8add5de1.bundle/Contents/_combined/seasons/3/episodes/21/thumbs/com.plexapp.agents.thetvdb_190b1d29c446426cc0631bf476c39e229253cc56"]

This will take a bit but I am going to take one of my known-good rips and perform the same test by copying the full length into the library (make sure taking a snippet of the file didn’t throw the header off)

Thanks. Yes, as I say, I always get the BaseIndexFrameFileManager error when the VPT generation hasn’t worked.

FWIW, I see the same errors if I use ffmpeg to cleanly slice a portion of the stream off, instead of a naive dd truncation.

Similarly, the same errors occur if the H.264 video stream is extracted/remuxed into an MP4 container, avoiding MKV entirely.

Also notably, taking a different H.264 file, from a show where Plex did create VPT/BIF files correctly, and truncating it (either with dd or ffmpeg) does not cause these errors.