Running Transcoder manually

Server Version#: Version 4.59.2 - plexmediaserver-1.24.1.4931-1a38e63c6.x86_64
Player Version#: N/A

Due to a bug in the Plex Server, I’m considering moving the background transcoding (“Optimization”) out of Plex and doing it manually (scripted, possibly with a “Batch” job queue system).

Has anyone done anything like this? Suggestions are welcome, along with a link to the “man” page for the Plex transcoder.

Thank you.

Which “bug” ? (I can think of a few but probably not related :wink: )

There is no “man page” for the transcoder because it’s not meant to be operated standalone (Integration with PMS)

You’re better off using FFMPEG directly – for which there does exist a man page

Which “bug” ?

I created this one about two weeks ago: Bug report - Server restart resets Transcoding parameters

I then found a related bug report (fewer details) created two months ago: Plex Media Server configs after power failure

Neither of these has had any response from the Developers. No indication of someone doing any Triage on them to verify whether or not it’s real and to estimate dev-hours required to resolve. Not even someone asking for more details. :frowning:

There is no “man page” for the transcoder
You’re better off using FFMPEG directly

I had hoped that the integration of the output files would be better using the transcoder, but if I need to use FFMPEG, I guess that’s what I need to do.

It will take some time to put together a usable argument list for FFMPEG and to implement a batch/queue system to process the requests.

Of course, the two obvious alternatives are:

  1. Figure out a way to convince Plex that bug resolution really is important. Based on what I’ve seen here, the chances of that are somewhere between slim and none. I’ve seen “Bug Report” threads closed after three months because the developers were too interested in new features to bother with resolving bugs. This is the best way I know of to run a product into the ground.
  2. Migrate to a server app where the developers are actually concerned with fixing bugs.

The batch/queue system has already been resolved. In fact, there are many of them available, but for this sort of thing, simpler is better. The simplest I found is: GitHub - sitaramc/bq: simple job queue manager -- REPO is OBSOLETE; please see "notes" repo for updates

There was also a solution in StackExchange (process - Simple queuing system? - Unix & Linux Stack Exchange) that used the LP system, but that appears to be no longer functional.

OK. I looked at the argument list for FFMPEG. Its insane. Has anyone figured out a way to reliably do this in bulk?

Let’s assume you want to invoke FFMPEG to:

  1. Convert all the MKV files in the current directory
  2. Convert everything to H.264 with a maximum bit rate of 25 Mbps.
  3. Keep the audio the same
  4. Set them for web-optimized
  5. Put then in another directory but with MP4 extension.

This isn’t that difficult.

I’m writing this on the fly so might have a syntax oops here & there but this is the nuts & bolts of it.

#!/bin/bash

# The input files will be in variable "i"

for i in *.mkv
do
  Filename="${i%.*}"

  # invoke ffmpeg to transcode, and web-stream optimize all in one pass
  ffmpeg -i "$i" -c:v h264 -b:v 25000k  -c:a copy  -movflags faststart "/new/directory/${Filename}.mp4"

done

This doesn’t address subtitles but you’ll probably want to ‘copy’ them too so the -c:s copy would be appropriate.

c – codec (v = video, a = audio, s = subtitle)
b – bitrate (b:v = bitrate for video )

the ‘copy’ codec does just that – copies the input stream to the output untouched,.

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