I’ve got a question that really is unrelated to plex so sorry for throwing it in here, but an issue that I’m running into during post processing of things I’m recording. I’ve not used ffmpeg in the past so I’ll go ahead and admit that I’ve only gotten this far thanks to the great information in this thread.
Regardless - I set up PP following @hthighway 's original post, the exception being that I used his fork that includes encoding to h264 after the split.
When playing, every single video I’ve recorded will halt for a few seconds every so often - then resume looking like the screenshot below. I’ve tried playing the encoded videos in VLC natively and the audio cuts out and the halt isn’t as dramatic but it still happens so something is definitely wrong with the encoded file. I’ve played the original MPEG2 files that are in the .grab folder and they don’t exhibit this so it there isn’t a problem that is created during the recording itself.
Not really certain how to inspect this video for defects, whether its an audio or video track problem (or both).
@hthighway said:
For ffmpeg, this is the general syntax: ffmpeg -i inputfile.mkv -crf 18 -map 0 -acodec copy -scodec copy -c:v libx264 -threads 0 -preset veryslow outputfile.mkv
Right now I am testing -preset medium and -crf 20
What did you settle on for your final ffmpeg output? I’m almost done with my linux/bash based version of a comstripping script, but the constant transcode errors have made me have to stop and redo things. If someone has already sorted out the best combo to go from TS to mkv, I’d rather credit/use their work than reinvent the wheel.
It’s likely dependent mostly on your system. You can exclude both options if you wish, depending on your space available and general visual preference of the output file.
veryslow is … very slow. I don’t use any preset when I encode a rip. This is how I run it, and it does a generally ok job. Nothing fancy, all it does is encode to H.264 and just copies the audio channel and any subtitles baked into the MKV container:
I have tinkered with some other settings like crf and the presets. I read somewhere that if you start mucking with crf that you should also use the qcomp flag to maintain some extra fidelity:
and went off of a doom9 post to use this nightmare of a combination, and while I noticed a slight difference in the final product, overall it wasn’t worth the effort to maintain. The settings might change from encode to encode. Note, the below was me tinkering with HEVC.
@jonh said:
I’ve got a question that really is unrelated to plex so sorry for throwing it in here, but an issue that I’m running into during post processing of things I’m recording. I’ve not used ffmpeg in the past so I’ll go ahead and admit that I’ve only gotten this far thanks to the great information in this thread.
Regardless - I set up PP following @hthighway 's original post, the exception being that I used his fork that includes encoding to h264 after the split.
When playing, every single video I’ve recorded will halt for a few seconds every so often - then resume looking like the screenshot below. I’ve tried playing the encoded videos in VLC natively and the audio cuts out and the halt isn’t as dramatic but it still happens so something is definitely wrong with the encoded file. I’ve played the original MPEG2 files that are in the .grab folder and they don’t exhibit this so it there isn’t a problem that is created during the recording itself.
Not really certain how to inspect this video for defects, whether its an audio or video track problem (or both).
@jasonmicron thanks for the info. Subtitles is the next thing I want to focus on. I am hoping for a Plex built in solution, but I’ve had lots of issues with the transcoding so far. I’m debating if it is worth going x264 for stuff that I plan to watch and delete. Or just have it quickly for speed. Granted, 20 minutes isn’t terrible, but for a 1 hour show, it could be a lot longer than that
For anyone that’s running a headless Plex server without X.org installed and has MythTV installed (probably a super-limited group of folks), I was running into issues compiling comskip.
I adapted some code I wrote for a MythTV project that will invoke Myth’s own commercial flagger (mythcommflag) and crop out the commercials. If anyone’s more familiar with chapters, I’d prefer to flag those instead.
Or - if you’re running CentOS / Fedora / RHEL / etc, look at my posts a page or so back. There are some yum repos that provide this stuff in pre-made RPM format for even easier installation. No compiling required. Specifically, the nux repo.
Or - if you’re running CentOS / Fedora / RHEL / etc, look at my posts a page or so back. There are some yum repos that provide this stuff in pre-made RPM format for even easier installation. No compiling required. Specifically, the nux repo.
I appreciate that, unfortunately I’m running Debian (Ubuntu Sever 16.04).
@IamSpartacus said:
I appreciate that, unfortunately I’m running Debian (Ubuntu Sever 16.04).
Note: FFmpeg has returned in Ubuntu 15.04 Vivid Vervet. You may still wish to compile if you experience a bug or want to customize your build (like including the non-free parts), and it will not interfere with the ffmpeg package in the repository.
If that is the case you can just do, sudo apt-get install ffmpeg
@IamSpartacus said:
I appreciate that, unfortunately I’m running Debian (Ubuntu Sever 16.04).
Note: FFmpeg has returned in Ubuntu 15.04 Vivid Vervet. You may still wish to compile if you experience a bug or want to customize your build (like including the non-free parts), and it will not interfere with the ffmpeg package in the repository.
If that is the case you can just do, sudo apt-get install ffmpeg
Ok now I’ve got all of the above done, just unsure what to do with regard to the script below. Where does this get placed and how to I set it to run via the postprocessing field in DVR Settings?
@IamSpartacus said:
Ok now I’ve got all of the above done, just unsure what to do with regard to the script below. Where does this get placed and how to I set it to run via the postprocessing field in DVR Settings?
You paste that into a file plexdvr.sh, for example
$ mkdir plexscripts
$ cd plexscripts
$ touch plexdvr.sh
$ chmod +x plexdvr.sh
$ nano plexdvr.sh
past content from above into here
then exit nana (or whatever your prefered text editor may be)
$ cd ~
Then go to Settings -> Server -> DVR (beta) and select DVR Settings
Scroll to the bottom of the popup screen and enter the path & file name of the above script into the field for POSTPROCESSING SCRIPT
@hthighway said:
You paste that into a file plexdvr.sh, for example
$ mkdir plexscripts
$ cd plexscripts
$ touch plexdvr.sh
$ chmod +x plexdvr.sh
$ nano plexdvr.sh
past content from above into here
then exit nana (or whatever your prefered text editor may be)
$ cd ~
Then go to Settings -> Server -> DVR (beta) and select DVR Settings
Scroll to the bottom of the popup screen and enter the path & file name of the above script into the field for POSTPROCESSING SCRIPT
Got it. So I pasted the following in. Any way to confirm it was taken properly by Plex?
curl --header "X-Plex-Token:MYPLEXTOKEN" -X PUT "https://MYIP:32400/livetv/dvrs/MYDVRID/prefs?postprocessingScript=/data/plexdata/Scripts/plexdvr.sh"