request simple script to convert to mkv

The switch to .ts instead of .mkv really messed with my viewing experience. I have an extend and record in h.264 directly, onto an old readynas that direct plays to rokus and other devices. When the switch was made to .ts, I can no longer fast forward or even resume a recording. I created a very simple post processing script to convert from .ts to .mkv but my recent recordings only have audio and no video. Where am I going wrong?
export LD_LIBRARY_PATH="/apps/plexmediaserver/Binaries"
infile=1 outfile={infile//.ts/.mkv}
/apps/plexmediaserver/Binaries/Plex\ Transcoder -fflags +genpts -i “$infile” -map 0 -c copy “$outfile”
rm “$infile”
exit 1

If any devs are reading, please at least give us the option to remux back to mkv again. The experience was near perfect for me.

take a look at using ffmpeg or handbrake for changing containers. Using the Plex binaries is going to be dodgy.

ffmpeg -i input.ts -vcodec copy -sameq -acodec copy -f matroska output.mkv

I have an amazingly complex program that will do it for you if you like :slight_smile:

what sdlsatcom posted will work though. you can leave out the -sameq and -f matroksa options.

You could also just use the plex transcoder like you are doing, instead of ffmpeg, good job on setting the ld library path.

Here, I corrected your script.

#!/bin/bash
outfile=${1//.ts/.mkv}

LD_LIBRARY_PATH="/volume1/@appstore/Plex Media Server" ; export LD_LIBRARY_PATH
ffmpeg="/volume1/@appstore/Plex Media Server/Plex Transcoder"

“$ffmpeg” -hide_banner -i “$1” -vcodec copy -acodec copy “$outfile”
rm “$1”

https://pastebin.com/UJgbKQSi

I wrote you a better one here:

https://pastebin.com/xAzKC8N0

Thanks I’ll test things out. I used to have ffmpeg working but couldn’t get it running on the latest readynas OS.

Yeah let me know. In last pastebin you will have to adjust paths for things. It’s setup how it is on my Synology.

Sorry to bump this but want to mention that everything seems to be working as expected without the need to convert to MKV now. I can trick play on my roku using the .ts files.