I think this may be the right ffmpeg code to do the job, but I’m not sure of a few things.
I imagine this needs to be saved in a .sh file and put on my synology, but I’m not sure of the filepaths for Synology Diskstations. I can’t seem to find that anywhere. volume1/homes/plex/filename.sh or something like that?
How does it know what file to convert? Does Plex send it as an input, and if so, did I call it correctly?
do I need anything other than the ffmpeg code in the sh file?
Sorry but I don’t really know what I’m doing with ffmpeg. This is a weak spot. I got everything else working through and would be super excited if this got going too.
Finally, where would I submit transcode after recording as a feature request? Presumably with the removal of commercials option encoding is done.
Mike,
I don’t support DVR/TV but did reach out to ask if there’s documentation anywhere, even in draft form.
I am sorry I didn’t see your post here in Synology until now
Thanks Chuck, Also, I apparently put this in General rather than Plex Features. I have re-tagged it and hopefully I’ll get support from someone on the LiveTV/DVR team
This converts the mpeg2 video in the ts file to h.264 and repackages the file as an mp4. It worked perfectly but it does take a LONG time on a DS418play. A 5 min test file (I started the recording with 5 min left in the episode) took about 17 min to convert. I’m now considering dropping the additional $130 to return my 418play and upgrade to the DS918+ which has a quad core processor. But this should work on either.
Actually, I added an additional parameter to the ffmpeg line and it’s MUCH faster now. Not as good compression, but still under of the 50% the ts files
I’ve look for this a million times and this is the first time I “think” I understand what to do, in order to get PostProcessing to work. Thank you for sharing your findings (and frustrations)
I’m honestly not sure because I haven’t had any need to convert 1080i to 1080p. You could possibly use tinterlace or MBAFF encoding mode, but I’m honestly not sure because I haven’t played around with it.
Also, I would give you a warning, check your frame rate and frames vs fields. It’s very possible that it will mess with your frame rate when you convert from fields to frames or vice versa. This can cause your video to get laggy or reduce motion flow.
The only example I saw (on a quick search) of deinterlacing 1080i was https://cweiske.de/tagebuch/deinterlacing-1080i.htm
It looks like he solved his issue with ffmpeg so scroll down to that section.
I fiddle around with it last night with ALOT of trial and error - never before have I made Unix Shell file OR worked with ffmpeg… so I have many things to learn
Initially I got the script to work, but with a 0 byte file size output.. bummer.
I used your setup -that worked- and have now made a variant incl. a log-file etc.
#!/bin/bash
dvrPostLog='/volume2/Plex/dvrProcessing.log'
echo "=================================" | tee -a $dvrPostLog
[ $# -ge 1 -a -f "$1" ]
echo "`date '+%Y-%m-%d'`" | tee -a $dvrPostLog
echo "`date '+%H:%M:%S'` file '$1' is opened" | tee -a $dvrPostLog
ffmpeg -i "$1" -acodec copy -vcodec libx264 -preset superfast "${1%.ts}.mp4"
echo "`date '+%H:%M:%S'` conversion done. new file saved" | tee -a $dvrPostLog
A interesting part here:
My source video is often 1080i H264 and if I just did ‘-vcodec copy’ I of course got the exact same format in the MP4. But when I did your ‘-vcodec libx264’ the output format is set to 1080p H264 – which I aimed for. At least that is what Plex is showing
@sorenhlaursen If you want stream, with no convert (ex ipad…) and want limitation cpu : ffmpeg -i "$1" -f matroska -threads 1 -acodec aac -strict -2 -vcodec libx264 -preset ultrafast "${1%.ts}.mkv"
It’s no big issue for now, since some streams I get from cable is AC3 which Plex can direct stream for some of my devices (or easily transcode on the fly) - but I would LOVE to get better performance on multiple streams and instead maybe schedule PostProcessing at night time.