Movie optimization produces files with no video or audio stream in them

I posted this issue previously on reddit, but i guess the forum is a better place to discuss this issue.

Server Version#: 1.19.4.2902
Host OS: Ubuntu Server 18.04
Docker Tag: default

How to reproduce:

  • Select a movie from your library -> three dots -> Optimize …
  • Select whatever preset you want and click optimize. I tried with Optimized for TV and Custom. I also tried different version storage locations.
  • Let it run over night, because your server is slow
  • Try to watch the optimized version and get a playback error

The size of the file seems about right. 9GB for a 2h movie optimized for TV, but there seems to be no audio of video stream in it. Media info shows:

Complete name                            : /path/to/file.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 9,46 GiB

And Plex says: (Note that the third column is missing where the streams would be listed)

Media                              Part
    Proxy Type 42                     File Black Panther (2018).mp4
    Target Optimized for TV           Size 9.46 GB
    Target Tag I D 2
    Title Optimized for TV

Obviously I can’t play the file with any other player, like VLC, either.

Here are the logs:

Edit: Just tried a VC1 movie and that produced far less errors. The result is the same, though

anyone got an idea?

Updated to 1.19.4.2902 and the issue still persists.

Is there maybe a good third party solution to optimize my media? I really need the feature, because my CPU is just not fast enough to transcode on the fly

Just updates to 1.20.1.3252, but it didn’t help.

Though it was able to optimize a movie once, for some reason. But after I deleted the optimized version and tried again, it failed, too.

The sps_id errors in the first example aren’t necessarily an issue.

The “Unable to re-open … output file for the second pass (fast start)” message looks like a significant issue.

After the Plex Transcoder (ffmpeg) does the re-encoding, it rewrites the file to get the headers at the right place at the front of the file. If that’s failing, you’ll be left with a broken file.

Where are these files actually stored, and how are they made available to Ubuntu and Docker?

My first thought is permissions, or something odd about how the filesystem is mapped in.

My second thought is to try a simpler/smaller file, in case something else is going wrong inside the transcoder/ffmpeg. Can you grab this and add it to your library (doesn’t matter if it matches correctly) and try it?

http://dl5.webmfiles.org/video-h264.mkv

1 Like

Damn, I completely forgot to mention that I have my library stored on google drive. It’s then mounted using rclone. It’s mounted with code = drive so it has full read write access. The rclone flags are --allow-other --daemon --vfs-cache-mode writes

Also keep in mind that the optimization worked once. So it works in principle.

Setting a local directory as a storage for the optimized file makes it work, too, which I also could have mentioned earlier. Sorry about that

Edit: Optimizing your smaller file works

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.