How can I manually run the commerical removal program?
I want to be able to test that it is correctly working and not removing parts of the programs. Its auto execution is turned off and I want to keep it that way until I can test it and confirm it is working correctly.
Server Version#: 1.19.3.2764 (running in a docker on Ubuntu 18)
Tuner Make/Model: HDHomeRun Duo
The program that Plex uses is called comskip and is typically found in /usr/local/bin on an Ubuntu box. You can find out by typing which comskip at CLI. Comskip uses an INI file to get its settings from at run time. The one for Plex is in the /usr/lib/plexmediaserver/Resources/ directory. There are ways to customize the INI file and there is a sister application called comchap that will add chapter markers to files if they are converted to MKV. MPEG TS files donât support chapters. To manually run, you will want to write a small script to call the program against the out of box INI file and test how it works.
Thanks. I canât find the comskip executable file in the docker file system, I have tried using a WHICH and FIND command, but there is no file called comskip within the docker!
I am running what I think is the official docker image âplexinc/pms-docker:latest)â.
Does this sound like the issue?
Any idea how I can fix it?
Do I need to take the issue to the docker sub-forum?
Plex Media Server uses a customized version of comskip named âPlex Commercial Skipper.â Itâs located in:
/usr/lib/plexmediaserver/
To run successfully, it requires a couple of environment variables to be set correctly: EAE_ROOT and FFMPEG_EXTERNAL_LIBS. The values to which these are set vary by version. But, if you set up commercial skipping for a test show, you can check the logs to see what should be used (search for âPlex Commercial Skipperâ). You may just be able to play a video and force a transcode as well, as Plex Transcoder uses the same environment variables. In that case, search for âPlex Transcoderâ in the logs.
On my Linux test server, FFMPEG_EXTERNAL_LIBS is set here: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Codecs/99c90e0-3095-linux-x86_64
You should have a similar path on your system. I donât use Docker, but Iâd assume it would be close.
EAE_ROOT is set here on the same system (it could be different on yours):
As I mentioned above, the best way way to determine the correct values to use for your system would be to do a test recording with commercial skipping enabled, or force a transcode during playback of a video. You can then search for the those variables in your PMS logs.
Removing commercials is a multi-step process. The above is just the first part. It creates the EDL file, which contains the list of commercial segments. Plex, through some process about which I have no clue, turns that into a segment list file. That then gets fed to the transcoder along with the original recording to remove the commercial segments. The final result is then assimilated into the the library.
There are a couple of steps which arenât explicitly logged as far as I can tell. The above-mentioned creation of the segment list being chief among them. Perhaps they are logged with verbose logging enabled; I havenât tested that.
At any rate, the best I can suggest is for you to record a test show with commercial skipping enabled and then have a look at your Plex Media Server log to see exactly what Plex does.
comskip needs a script called comcut to actually alter the .ts file. All comskip does is produce the edl file to get the commercial markers by frame. I donât do docker, but comcut is in same place as comskip on my system. There is also another tool called comchap that creates chapter markers in mkv files. TS files donât support chapters.
The command to run it is a test mode from within docker is below.
When you see plex running the process in htop it has passed the --ini parameter, so you also need to do it when testing.
Do be aware that this will not remove the adverts, just generate a .txt file that tells the frames to be removed. For this you need to use the related âcomcleanâ process. I am not sure yet how this is implemented in plex.