How-to use comskip+dvdauthor on recordings II (1 Viewer)

johnbobjamesson

Portal Pro
June 17, 2004
91
0
Crailsheim
Hey,

after Ralph's great howtos about using comskip and MpegII2DVD (https://forum.team-mediaportal.com/viewtopic.php?t=10281&highlight= & https://forum.team-mediaportal.com/viewtopic.php?t=12853&highlight=) I tried to adjust the used programs to my personal needs. I wanted to use cuttermaran, since mpgtx gave me files that were stuttering. Plus, since I need to demux the mpeg files for cuttermaran, I am then able to remux them with mplex and have a valid mpeg-file for dvdauthor. Thus I can easily decide after the cutting procedure to author the resulting file into a dvd structure and burn it - if I want to.

1.
Now, what do I do? My comskip procedure doesn't vary much from Ralph's way. I only changed the comskip.ini to use all detection methods (method 255) and output a file for cuttermaran. I then created a new batch file which does not use mpgtx to cut and join the parts, but bbdemux to demux, cuttermaran to cut, mplex to remux and a couple of commands to rename and tidy up the whole temp procedure.

comskip.ini looks like this:

detect_method=255 ;1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 16=closed captions, 32=aspect ration, 255=all
verbose=10 ;show a lot of extra info, level 5 is also OK, set to 0 to disable
max_brightness=60 ;frame not black if any pixels checked are greater than this (scale 0 to 255)
test_brightness=40 ;frame not pure black if any pixels checked are greater than this, will check average brightness (scale 0 to 255)
max_avg_brightness=25 ;maximum average brightness for a dim frame to be considered black (scale 0 to 255) 0 means autosetting
max_commercialbreak=600 ;maximum length in seconds to consider a segment a commercial break
min_commercialbreak=10 ;minimum length in seconds to consider a segment a commercial break
max_commercial_size=120 ;maximum time in seconds for a single commercial or multiple commercials if no breaks in between
min_commercial_size=4 ;mimimum time in seconds for a single commercial
min_show_segment_length=120 ; any segment longer than this will be scored towards show.
non_uniformity=500
max_volume=500 ; any frame with sound volume larger than this will not be regarded as black frame
ticker_tape=0 ; Amount of pixels from bottom to ignore in all processing
intelligent_brightness=0 ; Set to 1 to use a USA specific algorithm to tune some of the settings, not adviced outside the USA
logo_percentile=0.92 ; if more then this amount of logo is found then logo detection will be disabled
logo_threshold=0.80
aggressive_logo_rejection=0
connect_blocks_with_logo=1 ; set to 1 if you want successive blocks with logo on the transition to be regarded as connected, set to 0 to disable
cut_on_ar_change=1 ; set to 1 if you want to cut also on aspect ratio changes, set to 0 to disable
delete_show_after_last_commercial=1 ; set to 1 if you want to delete the last block if its a show and after a commercial
delete_show_before_or_after_current=0 ; set to 1 if you want to delete the previous and the next show in the recording, this can lead to the deletion of trailers of next show
shrink_logo=5 ; Reduce the duration of the logo with this amount of seconds
after_logo=0 ; set to number of seconds after logo disappears comskip should start to search for silence to insert an additional cutpoint
padding=0
delete_logo_file=1 ; set to 1 if you want comskip to tidy up after finishing
output_framearray=0 ; create a big excel file for detailed analysis, set to 0 to disable
output_videoredo=0
output_womble=0
output_cuttermaran=1
output_mpgtx=0
output_zoomplayer_chapter=0
output_zoomplayer_cutlist=0
output_edl=0
output_vcf=0
live_tv=0 ; set to 1 if you use parallelprocessing and need the output while recording
cuttermaran_options="cut=\"true\" unattended=\"true\" muxResult=\"false\" snapToCutPoints=\"true\" closeApp=\"true\""
1

I then create an entry in the myprograms plugin just like Ralph did: Directory browse to open the selected mpeg file with a batch file. The batch file is called process.bat (or comskip.bat, or whatever) and has the following contents:

comskip %1
bbdmux.exe %1 0xE0 "%~dp1%~n1.m2v"
bbdmux.exe %1 0xC0 "%~dp1%~n1.mp2"
"c:\programme\cuttermaran\cuttermaran.exe" "%~dp1%~n1.cpf"
mplex.exe -f8 -o "%~dp1%~n1_clean.mpg" "%~dp1%~n1_clean.m2v" "%~dp1%~n1_clean.mp2"
ren %1 "%~n1_original.mpg"
ren "%~dp1%~n1_clean.mpg" %1
del "%~dp1%~n1*m2v"
del "%~dp1%~n1*.mp2"
del "%~dp1%~n1*.cpf"
del "%~dp1%~n1*.log"
del "%~dp1%~n1*.txt"
exit

You need to adjust the program path of cuttermaran to your system, other than that it should work. Of course you can use different demuxers, but bbdemux was a good choice for me, since the cli is rather simple. You can add another line to delete the original file if you want to (or delete the line which renames it to ..._original, which should overwrite it when renaming the clean to %1), but for testing purpose I advise not to.

2.
Aditionally I wrote a batch file to author a dvd with dvdauthor afterwards. I inserted another entry in the myprograms plugin (directory browse) which will then start the "author.bat" on the selected file which will then take the cleaned up mpg, author it into a directory and delete the mpg.
It looks like this:

dvdauthor.exe -f %1 -t -o "C:\Dokumente und Einstellungen\claudio\Eigene Dateien\Filme\%~n1\"
dvdauthor.exe -T -o "C:\Dokumente und Einstellungen\claudio\Eigene Dateien\Filme\%~n1\"
del %1

The double dvdauthor call is necessary for the ifos to work. Again, leave out the delete command for testing purpose, if you want.
You could add a call of mkisofs to create an iso and burn it via imgburn, but I use my burning program to do that directly from the folder. Saves some time.

The two batch files are located in one directory (it's called "cut" in my case) together with bbdemux.exe, dvdauthor.exe, mplex.exe, comskip.exe, comskip.ini, comskip.dictionary and the cygwin dlls needed for dvdauthor.

You can download the programs on the net, I can provide links if needed.

I now have a one-click solution to cut out commercials from a recorded file that has been converted into mpg. The resulting file is cleanly cut and valid to be authored to dvd.
If I want to, I also have a one-click solution to create a dvd folder in my movie-folder, ready to be burnt or watched as a dvd.

Hope this is of interest for you. My wish for the next step would be to be able to directly use the dvr-ms file for comskipping, but on the other hand - sometime soon MP will change to .ts and then most of the problems with converting the file beforehand will be gone.

J
 

Brutus

Portal Member
December 19, 2005
38
0
Belgium
Mpeg cut/trim

I planned to make a new screen where you can cut/trim recordings (cut begin/end of recording, trim commercials). Everything embedded instead of using several tools ! Usefull ? Trimming and cutting functionality is ready in C#.
 

Ralph

Retired Team Member
  • Premium Supporter
  • May 13, 2005
    692
    8
    Germany
    Home Country
    Germany Germany
    Hi Brutus,

    nice to see you are back.
    Of course a plugin to trim and cut recordings is still needed.
    Kaybe already started to write one for dvr-ms files but he can't get the preview work properly:
    https://forum.team-mediaportal.com/viewtopic.php?t=13535

    What's the status of your plugin, right now?
    Will you support mpeg-files?
    I wrote you a PM a month a ago, but unfortunately got no answer?

    Regards
    Ralph
     

    Brutus

    Portal Member
    December 19, 2005
    38
    0
    Belgium
    Low-level MPEG2 works, written in csharp,I need to start creating the UI ! I would like to add a button to MyTV !
     

    Users who are viewing this thread

    Top Bottom