Jump to content

TV recording post processing


Recommended Posts

revengineer
Posted

I just noticed that server v3 now allowed post processing of recording. This is fantastic and a great step toward dealing with commercials. Are there instructions somewhere on how to use the feature? At the minimum I need to know the how to pass the file name of the recording. The web page indicates to use  {path} for the path but what do I use for the file name? Thank you so much for taking this feature on. It should allow commercial skipping through kodi.

Posted

We don't have a token for filename but I guess it could be added. You need to research the command line arguments your program expects

revengineer
Posted

Luke, I have played around with this feature and I think this is just a terminology issue. Using comskip, the commercials process just fine when I pass {path} to the executable. So comskip it must get the directory plus filename and not just the direcotry which I interpreted as the path. So no further coding is necessary to get the commercials to process.

 

The next step is for me to test the commercial skipping feature of kodi using the .edl files produced by comskip.

 

Eventually it will be great if the commercial times noted in the files are interpreted by the web player.

 

Thanks again for taking on this feature! 

revengineer
Posted

OK, I have tested the processing chain with kodi, and kodi now successfully skips commercials of shows recorded by emby. Super!

 

The next desired feature is for the web player to process the Edit Decision List (.edl) file produced by comskip or showanalyzer to skip the identified commercial segments. The file format is very simple; it contains the start and stop times of commercials in seconds from start. Fro example, this is from a half-our sit com show:

 
523.09 754.22 0
1075.34 1308.64 0
1546.91 1697.30 0
 
There are three commercial, start and stop time are fractional seconds. The third number is the action, where "0" stands for "cut". See for example http://www.mplayerhq.hu/DOCS/HTML/en/edl.html
 
Is that hard to implement?
Posted

It would be a pretty significant project. It could potentially be done cheaply with transcoding, and isolating the changes to the server, but you probably won't want to give up your direct play just to skip commercials. So that would then mean implementing it separately within each app one at a time. Realistically, if handbrake understands those edl files, or mcebuddy, then you are better off using those tools to permanently remove the commercials from the video files. For us to support this, we would need to adequate demand to justify the effort.

revengineer
Posted

It would be a pretty significant project. It could potentially be done cheaply with transcoding, and isolating the changes to the server, but you probably won't want to give up your direct play just to skip commercials. So that would then mean implementing it separately within each app one at a time. Realistically, if handbrake understands those edl files, or mcebuddy, then you are better off using those tools to permanently remove the commercials from the video files. For us to support this, we would need to adequate demand to justify the effort.

Thanks for the assessment. The direct play path is preferred to avoid transcoding. My server is purposely underpowered to save electricity and cannot handle a lot of transcoding. I just was not sure whether the segments could be trimmed from the direct play stream before sending them to the apps.

 

If per-app implementation is required, I suggest putting this on the back-burner. I expect other users to have similar needs in the future, especially as Windows Media Center rides into the sunset, and it can be picked up at that time. Until then, just keep it on the wishlist. Thanks.

Posted

DVRMS Toolbox can be added to automatically skip commercials within Emby on a Windows PC. I used to have it working but it's somewhat difficult to setup and I haven't gotten back around to it. I'm really surprised Babvagant hasn't figured a way to implement it in other apps or at least build it into the WMC Emby. That is the best way I found since the detection is never 100% accurate and if it makes an error you are not SOL.

revengineer
Posted (edited)

I have DVRMS Toolbox running on my Media Center PC. The prime role is to start the comskip post-processing when the recording ends. The actual skippin in Media Center is done by the DTB addin, which is specific to Media Center and does not work with emby.

 

I am aware that DVRMS Toolbox can also be used to start tools like MCEBuddy to remove commercials by transcoding. This is not what I want to do and is NOT what I suggested above. I would like to avoid transcoding, which is cpu hungry and certainly does not improve quality, altogether.

 

Please correct me if there is a way to have DVRMS Toolbox interpret the edl files so that it can be used with emby without transcoding. However, even if this is the case, it would not work on Roku, FireTV, Android, iPod, iPad, etc.

 

So there is definitely a need for the feature I suggested above. Time will show how great the need is across the emby user base.

Edited by revengineer
Posted

Please correct me if there is a way to have DVRMS Toolbox interpret the edl files so that it can be used with emby without transcoding. However, even if this is the case, it would not work on Roku, FireTV, Android, iPod, iPad, etc.

You're wrong... Corrected The key if I remember correctly is pointing the add on to the right folder to look for edl. Again it only works for WMC client so doesn't solve the other apps. I was just providing an alternative. I, like you, would very much like a emby based commercial skipping tool. I currently use MCE buddy but keep hopping back and forth between mkv and mp4 because I use the chapter skip instead of cut but not all devices support it.... Still trying to dial that one in.....

Posted

Hi @@revengineer

 

I also use MCEBuddy, have since my Media Centre days. You should check it out. No real need to kick it off from emby as it has its own monitoring capabilities. From what I understand of your use case just pick the correct  "unprocessed" profile, that should give you the commercial cuts and leave the file in native format. The cuts will be made to the file so no need for an emby client to have to read them real time. (Will use comskip or showanalyzer) you can auto-archive the original uncut to go back to if needed.

 

The profiles can be modified or custom ones added, so you should be able to get the output  you need. (support on their forum site is good!) or there are many users here.

 

Personally I use a custom profile that converts to mp4 and cuts commercials (Ac3 audio). Handbrake or ffmpeg is used by the tool, also GPU enabled. 1hr  HD show cut commercials and convert takes about 26min on my system. Maybe 5min of that is commercial cut using the built in comskip.

revengineer
Posted

You're wrong... Corrected The key if I remember correctly is pointing the add on to the right folder to look for edl. Again it only works for WMC client so doesn't solve the other apps. I was just providing an alternative. I, like you, would very much like a emby based commercial skipping tool. I currently use MCE buddy but keep hopping back and forth between mkv and mp4 because I use the chapter skip instead of cut but not all devices support it.... Still trying to dial that one in.....

Ok, thanks for the correction. I misunderstood and thought that DVRMS Toolbox would work on Windows as a general solution. I never tried Emby for WMC as my whole search is for a replacement of WMC.

revengineer
Posted

Hi @@revengineer

 

I also use MCEBuddy, have since my Media Centre days. You should check it out. No real need to kick it off from emby as it has its own monitoring capabilities. From what I understand of your use case just pick the correct  "unprocessed" profile, that should give you the commercial cuts and leave the file in native format. The cuts will be made to the file so no need for an emby client to have to read them real time. (Will use comskip or showanalyzer) you can auto-archive the original uncut to go back to if needed.

 

The profiles can be modified or custom ones added, so you should be able to get the output  you need. (support on their forum site is good!) or there are many users here.

 

Personally I use a custom profile that converts to mp4 and cuts commercials (Ac3 audio). Handbrake or ffmpeg is used by the tool, also GPU enabled. 1hr  HD show cut commercials and convert takes about 26min on my system. Maybe 5min of that is commercial cut using the built in comskip.

If I understand correctly, MCEBuddy cuts the commercials by removing segments from the original video file. Doesn't this require some form of recoding the file with ffmpeg independent of the profile settings? This would be the step I am trying to avoid.

Posted

If I understand correctly, MCEBuddy cuts the commercials by removing segments from the original video file. Doesn't this require some form of recoding the file with ffmpeg independent of the profile settings? This would be the step I am trying to avoid.

 

It uses TSCut to remove the commercial segments. It has to reassemble the file. Here is a profile example using ffmpeg  it is a straight copy so any overhead is trivial.

 

[TS Unprocessed]

Description=Very fast but limited functionality. Use this to convert to TS format while taking out commercials and keeping original video/audio quality. It does not remove black bars, resize the video, deinterlace or select audio language. The original video can be in any format, MPEG1, MPEG2 or MPEG4/H.264, it will be retained unaltered.

order=copy,ffmpeg

copy-ext=.ts

copy-audiodelay=skip

ffmpeg-general=-threads 0

ffmpeg-video=-vcodec copy -f mpegts -map 0:v -sn

ffmpeg-audio=-acodec copy -map 0:a

ffmpeg-audioac3=-acodec copy -map 0:a

ffmpeg-ext=.ts

ffmpeg-audiodelay=skip

FixedResolution=true

SkipCropping=true

PreConversionCommercialRemover=true

AutoDeinterlace=false

  • Like 1
  • 2 weeks later...
Posted

Can we get commercial skip (as a direct enhancement or as a third-party integration framework) to emby's roadmap ?  I would certainly use the feature if it was available!

Posted

@@sle118, please see post #6.

 

As far as third party integration, is that really still needed? You can integrate with just about anything using the post processing feature.

Posted

Unless things have changed dramatically over the past years (I haven't used comskip in a while), you probably don't want a tool to cut out the original recording file in case it misbehaves and doesn't recognize the start/end properly. So the integration (or native support) would mean preserving the original file and supporting some standard chapters / bookmarks. I'm thinking of 2 possible options

- Support bookmarks

- Support chapters

 

from the "execution" standpoint, there could also be 2 options

- Users would manually skip commercials clicking the fast forward button (which would skip to the next bookmark/chapter)

- System would automatically follow the chapters/bookmarks as some sort of single file play list

 

maybe someone has a better idea, but I'm thinking that this could minimize the impact of implementing the new feature. 

  • Like 1
Posted

That requires individual support in every app. It's possible, but we need to see adequate demand in order to do that. You can easily slice files with ffmpeg over the command line. i think that is the most practical option.

Posted

That's the point...  slicing the file means you're loosing content. What if the commercial recognition messed up and cut it all?  Having a "cut list" means it would be possible to override while viewing as opposed to having to chase the original file (assuming it's still there).  At this point, it would not be an issue if the commercial detection is a hit/miss thing as the original content is preserved and accessible.

 

The "comskip" tool has the following option for output. Emby could have its own internal bookmarking mechanism, and that would be fed by different plugins on scheduled tasks.  

  --zpcut                   Outputs a ZoomPlayer cutlist

  --zpchapter               Outputs a ZoomPlayer chapter file

  --videoredo               Outputs a VideoRedo cutlist

  --csvout                  Outputs a csv of the frame array

 

The process would be

- Recording done

- Plugin runs commercial extraction as Post processing and generate  cut file, chapter, etc file 

- Plugin runs then grabs the output of the tool and converts to emby's bookmark 

  • Like 1
Posted (edited)

I think I found a way to achieve what I want. The process flow would look like this

 

Record->run comskip (generate edl file)->embed edl into mp4 stream as chapter->emby scans library->emby pulls chapters

 

not sure if emby has ways to jump to the next chapter during playback, but I'll check

 

as for embedding chapters into the mp4 file, I think the tool below has some potential

https://github.com/gpac/gpac

Edited by sle118
  • Like 1
Posted (edited)

First off, I will admit my own ignorance a bit here up front, I am not even sure what post processing exactly achieves.  I do feel, however, you are a bit over-complicating it a bit.  

 

You can already have MCE Buddy scan the program, re-encode it (or not), file it into an Emby acceptable filing format, and have it create chapter markers.  I have been playing around with it and there are limitations I can look into later.  I believe the issues are both that it has to be in a MP4 format and not an MKV format (or vice versa) and that not all clients seem to support the chapter markers.  I can look at it further later if I get my actual work done. :)

 

Edit:  Both MP4 and MKV work fine on the Emby for WMC.  Android I know doesn't support chapters and I don't believe Theater does either.  So what I believe you want to accomplish (and me too) is for wider chapter support in the clients.  Roku is outside and it's 35 and raining so not sure if that supports chapters.

Edited by Bert
revengineer
Posted

First off, I will admit my own ignorance a bit here up front, I am not even sure what post processing exactly achieves.  I do feel, however, you are a bit over-complicating it a bit.  

 

You can already have MCE Buddy scan the program, re-encode it (or not), file it into an Emby acceptable filing format, and have it create chapter markers.  I have been playing around with it and there are limitations I can look into later.  I believe the issues are both that it has to be in a MP4 format and not an MKV format (or vice versa) and that not all clients seem to support the chapter markers.  I can look at it further later if I get my actual work done. :)

 

Edit:  Both MP4 and MKV work fine on the Emby for WMC.  Android I know doesn't support chapters and I don't believe Theater does either.  So what I believe you want to accomplish (and me too) is for wider chapter support in the clients.  Roku is outside and it's 35 and raining so not sure if that supports chapters.

My points: 

1. I do not want to use (and buy) MCE Buddy.

2. Emby for WMC is a mute point. I am looking for a solution that will work when we retire WMC. For now, I have a working solution using WMC with dvrms toolbox and comskip. But, in the long run, I am looking for a replacement.

Posted

Right but DTB is creating the same markers that Mce Buddy is so if chapter support is added you could accomplish the same things using it. I'd love Emby to handle it all too but chapter support is needed no matter what and may be something that'd be added sooner.

  • 3 months later...
bardmaster
Posted

I think I found a way to achieve what I want. The process flow would look like this

 

Record->run comskip (generate edl file)->embed edl into mp4 stream as chapter->emby scans library->emby pulls chapters

 

not sure if emby has ways to jump to the next chapter during playback, but I'll check

 

as for embedding chapters into the mp4 file, I think the tool below has some potential

https://github.com/gpac/gpac

@@sle118 I'm curious how your experimentation ended up.

bardmaster
Posted

It uses TSCut to remove the commercial segments. It has to reassemble the file. Here is a profile example using ffmpeg  it is a straight copy so any overhead is trivial.

 

[TS Unprocessed]

Description=Very fast but limited functionality. Use this to convert to TS format while taking out commercials and keeping original video/audio quality. It does not remove black bars, resize the video, deinterlace or select audio language. The original video can be in any format, MPEG1, MPEG2 or MPEG4/H.264, it will be retained unaltered.

order=copy,ffmpeg

copy-ext=.ts

copy-audiodelay=skip

ffmpeg-general=-threads 0

ffmpeg-video=-vcodec copy -f mpegts -map 0:v -sn

ffmpeg-audio=-acodec copy -map 0:a

ffmpeg-audioac3=-acodec copy -map 0:a

ffmpeg-ext=.ts

ffmpeg-audiodelay=skip

FixedResolution=true

SkipCropping=true

PreConversionCommercialRemover=true

AutoDeinterlace=false

@@Vicpa do you have more details on your finished product?  I am experimenting with comskip as a postprocessing step and it easily creates the EDL file with the commercial times.  Right now I'm working on slicing out the commercials and reassembling the TS file.  Comskip also has a batch file comclean.bat which uses mpgtx.exe but I'm struggling a bit to get it to work.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...