Is there any way to have Plex or the script post process only 1 recording at a time? I’ve run into 2 recordings that complete at the same time that are taking longer to remove the commercials because it’s processing both files at the same time. Is it something that can be done with a script or does Plex have to change how the post processing feature works? Right now I’ve opted to do it manually until I can figure this out. Would appreciate any advice or workarounds.
@PC319 said:
Is there any way to have Plex or the script post process only 1 recording at a time? I’ve run into 2 recordings that complete at the same time that are taking longer to remove the commercials because it’s processing both files at the same time. Is it something that can be done with a script or does Plex have to change how the post processing feature works? Right now I’ve opted to do it manually until I can figure this out. Would appreciate any advice or workarounds.
My script is supposed to do only one at a time. When a process kicks off it touches a lock file so if another process starts it will see the lock and sleep 10 seconds and then check again. Once the lock file is gone it will begin processing the next video.
@PC319 said:
Is there any way to have Plex or the script post process only 1 recording at a time? I’ve run into 2 recordings that complete at the same time that are taking longer to remove the commercials because it’s processing both files at the same time. Is it something that can be done with a script or does Plex have to change how the post processing feature works? Right now I’ve opted to do it manually until I can figure this out. Would appreciate any advice or workarounds.
I would actually like to set post processing to occur at a time after the recordings are done (like later in the evening) if there is a way in the setup script to set a time or delay. I have found that if I have 2 or 3 consecutive recordings the post processing sometimes work erratically on the first and may or may not work on the subsequent recordings. I am not doing any remixing, but I suspect that recording and post processing simultaneously on my mac mini (late 2014, 2.6 mHz dual core) is a bit too much for it.
@toxlab said:
@PC319 said:
Is there any way to have Plex or the script post process only 1 recording at a time? I’ve run into 2 recordings that complete at the same time that are taking longer to remove the commercials because it’s processing both files at the same time. Is it something that can be done with a script or does Plex have to change how the post processing feature works? Right now I’ve opted to do it manually until I can figure this out. Would appreciate any advice or workarounds.I would actually like to set post processing to occur at a time after the recordings are done (like later in the evening) if there is a way in the setup script to set a time or delay. I have found that if I have 2 or 3 consecutive recordings the post processing sometimes work erratically on the first and may or may not work on the subsequent recordings. I am not doing any remixing, but I suspect that recording and post processing simultaneously on my mac mini (late 2014, 2.6 mHz dual core) is a bit too much for it.
I suppose you could do that but would take a lot more work. I don’t know all the specifics on how/when/where plex finally decides to copy the file from the .grab directory into the specified TV directory but it seems it knows when the script is finished and then does the move. So… maybe I could add in a time delay when the postscript starts to tell the postscript to sleep until say 1am the following morning. Then it wakes up and finishes the postscript. I wonder how plex will handle an open postscript for that many hours?
@csilvertooth said:
My script is supposed to do only one at a time. When a process kicks off it touches a lock file so if another process starts it will see the lock and sleep 10 seconds and then check again. Once the lock file is gone it will begin processing the next video.
Thanks, didn’t see your post with the script before. I edited it to skip the handbrake process since I don’t need that. Hopefully still works, I’ll test it tonight.
Thanks to everyone for sharing their knowledge and ideas. I could however do with a little help in making this work!
“Download ETV-Comskip from https://github.com/essandess/etv-comskip by downloading the latest release:
https://github.com/essandess/etv-comskip/releases/download/v3.5.3/ETVComskip-3.5.3-10.11.dmg
All you really need is the bin and lib folders. The bin folder has comskip and comskip-gui prebuilt and some other unrelated binaries, which can be discarded if you want. The lib folder has the libraries comskip requires to run as well as some extras but keeping them is fine.”__
So I created a “software” folder under my user folder and created a Comskip folder under this that contains the bin and lib folders.
“PlexComskip requires python to be installed in order to run.
Download or clone the GitHub PlexComskip repo at https://github.com/ekim1337/PlexComskip.
Extract and copy the PlexComskip.conf.example file and rename it to PlexComskip.conf. This file will hold your settings for where the comskip and ffmpeg binary files are located on your system and some other self explanatory settings.”
I created a PlexComSkip folder under the software folder and copied the contents of the download file into this folder.
I get the error below when I test the installation. Any suggestions?
IMacServer-iMac:~ IMacServer$ python /Volumes/iMac\ Disk\ A\ (4TB)/IMacServer/Software/PlexComSkip/PlexComskip.py /Volumes/iMac\ Disk\ A\ (4TB)/IMacServer/Software/PlexComSkip/Test/KPRC\ Channel\ 2\ News\ at\ 6pm\ (2006)\ -\ 2016-10-29\ 00_00_00\ -\ Episode\ 10-29.ts
PlexComskip got invoked from /Volumes/iMac Disk A (4TB)/IMacServer/Software/PlexComSkip/PlexComskip.py
fatal: Not a git repository (or any parent up to mount point /Volumes/iMac Disk A (4TB))
Hello Everyone,
All of this is Fantastic, and great work but one thing i am a little confused about is where to stipulate the locations of the recordings.
On my server i have two folders, DVR Telly and DVR Movies which have their respective content recorded into from DVB-T (UK off Air) in .TS format.
Looking through all of this information i have yet to see where i can tell PlexComskip to look for the recordings to process (actual recorded file location), or am i missing something and this is what Plex handles, after i put the script path in?
Many thanks
Lambiepie
Thank you so much for the guide! I’ve gotten everything installed - and was successfully able to manually process a Plex recorded video (command line). I’m having trouble getting this to run automatically by Plex, however. I have everything configured correctly. I have closely monitored shows as they are recorded - they show up in my TV directory. They then disappear - presumably being processed by the comskip script - however they never return. I then find a copy of the original .ts file in my trash - but no processed file anywhere on my system. Is there a way to find a log file that can tell me where this is failing?
@lambiepie said:
Hello Everyone,All of this is Fantastic, and great work but one thing i am a little confused about is where to stipulate the locations of the recordings.
On my server i have two folders, DVR Telly and DVR Movies which have their respective content recorded into from DVB-T (UK off Air) in .TS format.
Looking through all of this information i have yet to see where i can tell PlexComskip to look for the recordings to process (actual recorded file location), or am i missing something and this is what Plex handles, after i put the script path in?
Many thanks
Lambiepie
The files are placed in a directory called .grab it is hidden hence the preceding period. The .grab folder is located in the root directory of the directory you marked for TV shows. If you don’t have a post process script Plex copies the file to its final destination. If you select a post process script plex passes a single argument to that script which should be the full path to the file… something like ‘/Volumes/Macintosh HD/Plex/TV Shows/.grab/d548b71bc5162b28558cb303ada0d461cbebf221/The Flash (2014) - S03E05 - Monster.mkv’
The easiest way to use that argument in a bash script is to call it with the $1 option. For instance in your script you might want to make a copy of the file before processing it. So you would do something like the following.
cp “$1” “$1.orig”
Or think of it like this.
Script name is AwesomePlexScript.sh
If you wanted to tell that script to do something with a file you would type the following:
./AwesomePlexScript.sh “reallyCoolFile”
The $1 in this case is reallyCoolFile
I hope that helps a bit.
Chris
@toxlab said:
@PC319 said:
Is there any way to have Plex or the script post process only 1 recording at a time? I’ve run into 2 recordings that complete at the same time that are taking longer to remove the commercials because it’s processing both files at the same time. Is it something that can be done with a script or does Plex have to change how the post processing feature works? Right now I’ve opted to do it manually until I can figure this out. Would appreciate any advice or workarounds.I would actually like to set post processing to occur at a time after the recordings are done (like later in the evening) if there is a way in the setup script to set a time or delay. I have found that if I have 2 or 3 consecutive recordings the post processing sometimes work erratically on the first and may or may not work on the subsequent recordings. I am not doing any remixing, but I suspect that recording and post processing simultaneously on my mac mini (late 2014, 2.6 mHz dual core) is a bit too much for it.
Maybe not an answer, but what about a cron task that would create/delete the lock file at certain times to “blackout” the period for which you don’t want processing to happen? Creating it shoudl be as simple as touching the file… For deleting it, though, it seems you would at least want to be sure that none of the associated processes are running, so you would not kill it if a valid job was in process. So, maybe cleaner would be to change the script to have a “blackout” file as well as the normal lock script, it would check for both. That way the file your cron manages would only be used for that purpose and could just be touched/deleted.
Hi! Thanks for the tutorial, it’s gave me a headache, but I wouldn’t have made it anywhere without it.
I used the long method, maybe I shouldn’t have, maybe it’s not to late to start over… At any rate, I keep getting “Errno 8”, I changed some things that I thought might make that happen and received new errors, so I reverted those changes. here is what was spit back when I executed the “test” at the bottom of the tutorial, any help would be very much appreciated.
$ python /Users/xxx/Documents/PlexComskip/PlexComskip.py /Volumes/TV\ Shows\ [RAID\ 5]\ [6TB]/TV\ shows/Kevin\ Can\ Wait\ (2016)/Season\ 1/Kevin\ Can\ Wait\ (2016)\ -\ S01E09\ -\ The\ Power\ of\ Positive\ Drinking.ts
PlexComskip got invoked from /Users/xxx/Documents/PlexComskip/PlexComskip.py
Using version: 5d2202c
Using session ID: d0d0d43a-cedd-472a-87ee-1668588cf7e1
Using temp dir: /Users/xxx/Movies/Sublet/d0d0d43a-cedd-472a-87ee-1668588cf7e1
Using input file: /Volumes/TV Shows [RAID 5] [6TB]/TV shows/Kevin Can Wait (2016)/Season 1/Kevin Can Wait (2016) - S01E09 - The Power of Positive Drinking.ts
[comskip] Command: [’/Users/JoshPayne/Documents/PlexComskip/comskip.ini’, ‘–output’, ‘/Users/xxx/Movies/Sublet/d0d0d43a-cedd-472a-87ee-1668588cf7e1’, ‘–ini’, ‘/Users/xxx/Documents/PlexComskip/comskip.ini’, ‘/Volumes/TV Shows [RAID 5] [6TB]/TV shows/Kevin Can Wait (2016)/Season 1/Kevin Can Wait (2016) - S01E09 - The Power of Positive Drinking.ts’]
Something went wrong during comskip analysis: [Errno 8] Exec format error
Leaving temp files in: /Users/xxx/Movies/Sublet/d0d0d43a-cedd-472a-87ee-1668588cf7e1
Done processing!
@badmnky said:
Hi! Thanks for the tutorial, it’s gave me a headache, but I wouldn’t have made it anywhere without it.
Soooo. I downloaded the short method files and just threw the bin and lib files into my comskip folder and redirected the conf to the new comskip binary and it’s now running as I type.
thanks again for the tutorial!!
Thanks very much, isaacrdz! So painless, and without any needed installs. Perfect - love it.
Now, is there a way to tell ffmpeg to also compress the recording at a lower bitrate?
Thank you!
I would like to know what systems (Mac and drive you record to) you two have (@badmnky and @BertholdBarz) that allows you to run the comskip without problems. I run into problems if two shows are either recording consecutively or are being recorded simultaneously on the two connect tuners. Often only 1 gets the commercial deleted.
@toxlab I haven’t been testing this super in-depth. It’s been working well so far, but I’m not sure if I had the case yet that two shows were recording simultaneously.
I record to a FW800 drive and use my Thunderbolt Raid 1 drive as the temp drive.
@toxlab I just did my first “two at once” and it seemed fine, there was one commercial that didn’t get removed so I sped through the whole episode to verify. I do all my recording and processing on a Mac Mini, late 2011, running sierrra on a SSD, the output file is saved to a thunderbolt drive. I did grab an ini configuration from one of the comskip forum links it’s the 7th post down here --> Click Me
I’m also trying unsuccessfully to figure out how to process the files through handbrake to reduce the file size and transcode them to a mkv file, I tried the script posted earlier in this thread, but I don’t know enough to make it work properly. His instructions were either to vague for me, because I have no idea what I’m doing, or something about my setup is way off from how his was setup, which goes back to, I have no idea what I’m doing.
Hi badmnky,
I think that is what I found, that some commercials were not removed. I will have to try again, but I think your SSD provides an advantage. I also think that single recordings work well with a regular drive, as noted by BertholdBar. I found that single recordings will process fine. You might want to check out magic media marker which can watch a folder and then automatically convert those files with handbook. I have never used it, but it might solve your problem (i think it has a demo if you go to the makers web site). https://www.macupdate.com/app/mac/38783/magic-media-marker
Hey @toxlab, I don’t think the hard drive is the critical component here - if anything it could be a question of CPU power to run the analyses. I’m getting around 400 fps when I’m running the script from a terminal window.
I’m using the default configuration .ini by the way and am getting great results using an OTA antenna in NYC!
@BertholdBarz
I’m going to try putting the default ini back and run the show with the missed commercial again. I didn’t really give a go to begin with. I forgot I went and got the donate version, so I copied that ini to use, not sure if I changed the right things, but it said “yes” when I ran through the install process again and it checked for donate.
@toxlab
I’m starting to get a better idea of what I need to do to convert, I set the DVR in PMS “convert video while recording” to transcode, we’ll see what I end up with. I have to figure out when people say “here’s a sample script” what the hell I’m supposed to do with said script, where to do I add it etc. I know there a way to tell handbrake to run, I just don’t know where I put that info so it gets triggered automatically.
I got everything loaded in isaacrdz’s how to post. When I manually run a file to test, it runs through as though it will be successful, however it returns an error and doesn’t complete.
/var/folders/4l/zx6ztqb92v732_xnrq4v23yr0000gp/T/315ed4ac-eb88-4551-80d5-8a50c9efefd4/segments.txt: Invalid data found when processing input
Sanity checking our work…
Something went wrong during sanity check: [Errno 2] No such file or directory: ‘/var/folders/4l/zx6ztqb92v732_xnrq4v23yr0000gp/T/315ed4ac-eb88-4551-80d5-8a50c9efefd4/Little Nikita (1988).mkv’
Leaving temp files in: /var/folders/4l/zx6ztqb92v732_xnrq4v23yr0000gp/T/315ed4ac-eb88-4551-80d5-8a50c9efefd4
Done processing!
The first time I tried running it with the recording located on my unRaid server where I store recordings. I tried a second time with the recording on the desktop and received the same error.
Can anyone point me in the right direction to get it operating properly? Thanks in advance.