Stripping Commercials from recorded files

Hey guys, hopefully this is ok to post this stuff here. I wasn't able to find a good solution to permanently remove the commercials, so I created one. This uses ffmpeg to split out the file using the EDL file spit out by the DVR, and then joins them back together.

There's a plan on the roadmap to incorporate this as a docker container to automatically strip out commercials, but for now it's just a python script you can run on-demand for your recordings.

Pull requests welcome!

Usage:

sudo pip install edlstrip
edlstrip recording.mpg

(The above will install the python script on your system and will process "recording.mpg" using "recording.edl" and will write out a new file with commercials skipped "recording_comskipped.mkv")

https://github.com/shuaiscott/edlstrip

3 Likes

I realize this was 3 years ago, but I'm just finding this. Thank you! This is exactly what I've been looking for; a simple command line, 'take this file, strip the commercials, and put it back together' script.

@ChannelRat Do you have this script running?

I've run across several issues getting it to work, the first was fixed by installing a dependency: pip3 install click, and the second is related to error handling in __init__.py which I thought I fixed by adding the PR that's sitting in the queue for this project. I have another similar error popping-up now though.

What's your experience been?

I've added the edlstrip project referenced here to OliveTin-for-Channels under the :test.debian tag -- and resolved an issue or two with it along the way. Seems to be functioning well at this early stage, but there's nothing like a wider test to reveal what needs to be addressed!

As far as a workflow goes, using the CDVR built-in commercial skip validation process (Edit Commercials under DVR-Manage) is highly recommended before running this new OliveTin Action. I typically find a block or more that need to switched from program to commercial or visa versa.

I've migrated away from modifying the original project's standard Fedora container, to a Debian 12 base. This has allowed me to easily add the CDVR versions of ffmpeg and ffprobe to the container.

If you haven't done so before, you'll need to mount whatever you use as your "dvr" share in the docker compose in the form:

    volumes:
      - ${DVR_SHARE}:/mnt/host-port # This can either be a Docker volume or a host 

${DVR_SHARE} can either be a directory binding or a Docker Volume. Docker volumes need to be used if you'll be mounting an SMB: or NFS: share.

Use Portainer-Volumes to create it first, and then assign it in the form shown above, where host-port is the hostname or IP address of your CDVR server followed by a "-" (dash), and then the port number.

The more complete Volumes section should look something like this:

    volumes:
      - ${HOST_DIR}/olivetin:/config # Add the parent directory on your Docker you'd like to use
      - ${DVR_SHARE}:/mnt/media-server6-8089 # This can either be a Docker volume or a host directory that's connected via Samba or NFS to your Channels DVR network share
    restart: unless-stopped
#volumes: # use this section if you've setup a docker volume named channels-dvr, with CIFS or NFS, to bind to /mnt/dvr inside the container
  #channels-dvr:
    #external: true

Uncomment the second volumes section if you've created a Docker volume for your network share. In the above example the volume's name is "channels-dvr". Multiple DVRs are supported using the same scheme for creating and naming each volume mount.

1 Like

Haha, well, you've already gotten far ahead of me! Yes, I ran into the same thing with pip3, but the next morning when I went to dig into what was going on, my hard drive decided to die. So I've been spending these past days rebuilding my system. Yes, I have backups, but for some reason decided to take the opportunity to rebuild from scratch. So, I'll look at this again later. And that's awesome what you've done with Olive Tin! I'll be checking that out as well!