"Optimized version" transcoding failed

Some movies can’t be optimized with no reason (message “Unable to convert”). Example below.

Ubuntu: 15.10, plex 0.9.15.0.

From logs:
Jan 05, 2016 17:51:03 [0x7fa3cbff5700] WARN - WARNING: Couldn’t create directory /media/data/videos/_Unwatched/The Martian (2015)/Plex Versions/Optimized for Mobile/.inProgress
(…)
Jan 05, 2016 17:51:03 [0x7fa3d9bfd700] ERROR - [Transcoder] Could not write header for output file #6 (incorrect codec parameters ?): Invalid argument

Directory:
drwxr-sr-x 2 plex xxx 4096 Jan 5 17:51 Plex Versions

$ tree Plex\ Versions/
Plex Versions/

0 directories, 0 files

mediainfo:
Format : Matroska
Format version : Version 4 / Version 2
File size : 4.70 GiB
Duration : 2h 21mn
Overall bit rate : 4 744 Kbps
Writing application : mkvmerge v8.3.0 (‘Over the Horizon’) 64bit
Writing library : libebml v1.3.1 + libmatroska v1.4.2
Attachements : cover_land.jpg / small_cover.jpg / small_cover_land.jpg / cover.jpg

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 2h 21mn
Bit rate : 4 265 Kbps
Width : 1 916 pixels
Height : 796 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.117
Stream size : 4.22 GiB (90%)
Language : English
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : A_AC3
Duration : 2h 21mn
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 389 MiB (8%)
Language : English
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 : Yes
Forced : No

i have a similar problem ( windows PMS)
I had just 2 out of 13 show episodes fail conversion when I ran optimize , and all attempts to re-do those 2 give an immediate create fail error , whatever pre-set I try ( there is something about invalid data in the log then convert ends with an error 1 )
but if I move to another PC, set up the server + those files they optimize/convert just fine)
so there is something in this one plex database that i need to clear but what/where?
I have done all of delete optimized versions, analyses, refresh,update, even remove the whole show from plex and then added it back again.
I know plex has a set of subs somewhere in it’s metadata for this show, that may be where the problem lies, but I can watch the problem episodes with no problems and I can see that they are transcoding on the fly. so I don’t understand why transcoding via optimize instead immediately fails
I cannot shift this stubborn bug. I am not too fussed as to what glitch caused it originally, I just want to clean the relevant bit of the database so that I can test-optimize some more on those shows. there is no apparent difference between the 2 episodes that will not optimize and the 11 that will

all other shows that I test do not fail the optimize process, just these 2 specific episodes from 1 season of 1 show

here is the log of the failure -after re-trying one of the problem episodes:
it seeme to put a file called temp-0.srt into my temp transcode directory and then find a problem with it
Jan 21, 2016 08:35:40:672 [8468] INFO - [Transcoder] Input #0, avi, from ‘T: v series\Regenesis\Regenesis Season 2\ReGenesis.S02E02.avi’:
Metadata:
encoder : Nandub v1.0rc2
Duration: 00:48:36.41, start: 0.000000, bitrate: 1007 kb/s
Stream #0:0, 1, 1001/24000: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 624x352 [SAR 1:1 DAR 39:22], 867 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
Stream #0:1, 20, 3/125: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 127 kb/s
Jan 21, 2016 08:35:40:698 [1012] ERROR - [Transcoder] C:\rip\plex-transcode-a81f76dd-ef3e-4355-b669-67f8506d264f-57adbb21-2e07-4d4a-8ca6-7c6d930e2299 emp-0.srt: Invalid data found when processing input
Jan 21, 2016 08:35:40:703 [8468] ? - [Transcoder]
Jan 21, 2016 08:35:40:744 [2716] DEBUG - Cleaning old transcode directories.
Jan 21, 2016 08:35:40:744 [2716] DEBUG - Cleaning old transcode directory: C:\rip\plex-transcode-a81f76dd-ef3e-4355-b669-67f8506d264f-57adbb21-2e07-4d4a-8ca6-7c6d930e2299
Jan 21, 2016 08:35:40:744 [2716] DEBUG - TranscodeJobManager: [Running] onTranscodeSessionStopped: a81f76dd-ef3e-4355-b669-67f8506d264f
Jan 21, 2016 08:35:40:744 [2716] DEBUG - Whacked session, 0 remaining.
Jan 21, 2016 08:35:40:744 [2716] DEBUG - Sync: transcode of metadata item 3297 failed with exit code 1

I have the same issues : Bump … it’s always an error about invalid subtitle date (*.srt) … when i remove the subtitle from the file, the file converts flawless … is there a way to disable subtitle usage in transcoding completly ?

I abandoned the whole “optimize” thing. nice idea in theory but implementation is too iffy.
I got fed up of it randomly failing to create optimized version on pc 1, when same files would optimise OK with a clean install of server on test PC 2.

You are right about subtitles, the trick is to not let plex grab a set from opensubtitles.org and squirrel them away, because once it has done that, they play havok with the optimise feature. And once plex has them it hides them, so you cannot remove them from it’s database. it hangs on to them even if you remove and then replace the video files. That is why I can get optimise to work on a 2nd test server, because I’ve not set up auto fetch for subs on that.
the optimize presets are poorly documented, I tested various presets & some create separate new separate subs fiiles, some burn them in so you are stuck with them always on…

But for me, Id rather have the subs auto fetched & stashed & forgo the optimize.

I found, by testing with other servers and with basic DLNA in order to establish target device’s actual capabilities , that actually I can bypass most plex transcoding simply by changing default settings in my fire tablet plex client. I now tell it to accept dolby digital ( aka AC3) , because the tablet can actually handle that, and I tell it to accept h264 level4.1 'cos that woks ok also . the only think lef that still needs transcoding is DTS audio, but audio only transcode does not need much CPU
So I can stream at 1080p 8MB , so long as I use my 5GHz wifi option ; & most of my stuff will direct stream as audio & video components, ( I have direct play disabled as stuff seems to stream better with that off.)

My samsung smart TV, with its latest plex client can direct play pretty much anything I throw at it anyway, so no need to optimize for that.

Also I stumbled across “shana encoder” open source freeware; that has a preset that can rapidly put .mkv into .mp4 containers without transcoding, so I can prep stuff like that for less tolerant devices

The Problem is … the same error occurs also on Sync with my Ipad … i used optimize just to be able to repoduce it faster

maybe a new thread asking for a way to remove a specific .srt file set from database is what’s needed ?

Which logfile contains information on Optimize? I am having a similar problem, and wanted to dig into the logs.

@maxengel said:
Which logfile contains information on Optimize? I am having a similar problem, and wanted to dig into the logs.

Would you mind creating a new thread? This is over 2 years old and should have been closed.

I am having the same issue, if a new thread is open please post it here.

This tells me nothing and contains nothing actionable.

Would you mind creating a new thread, post your ZIP log files after recreating the issue ?