| Comskip Support Forum http://www.kaashoek.com/comskip/ |
|
| How to remove commercials in AVI files using ComSkip http://www.kaashoek.com/comskip/viewtopic.php?f=5&t=63 |
Page 1 of 1 |
| Author: | peliopoulos [ Thu Feb 02, 2006 7:24 pm ] |
| Post subject: | How to remove commercials in AVI files using ComSkip |
How to remove commercials in AVI files using ComSkip Tools Required VirtualDub 1.6.12 http://www.virtualdub.org/ QuEnc 0.61 http://nic.dnsalias.com/QuEnc.html ComSkip 0.79.30 or higher http://mk.kaashoek.com/comskip/ AVISynth 2.5 or higherhttp://www.avisynth.com MEncoder (optional) http://www.mplayerhq.hu/ Those of us who capture television programs directly to AVI files (not MPEG files) have had to watch from the sidelines while ComSkip worked its magic for everyone else. To get around this problem, I have devised a method for detecting commercials in AVI files and removing them. Please note that I don't go into detailed explanations of explicitly setting out folders, or explaining how to create and run batch files. I am merely providing the framework for going about the process. Step 1 - Convert to MPEG There are a number of programs out there that will covert an AVI file to an MPEG file. I have found QuEnc to be useful. QuEnc can be run using the command line and gives good quality conversions in a relatively short time. For example, the follwing command executed in a DOS window has given me sufficient quality in a short time: Code: quenc.exe -i capture.avs -o capture.mpg -b 3000 -aspectratio 4:3 -mpeg1 -novbr -auto -nohq -priority 4 -close Before running the above command, create a file called "capture.avs" file with the following command: Code: AVISource(capture.avi) Note: Don't use 0.70. It doesn't work for me for some reason. Step 2 - Run Comskip (0.79.22 or higher) Now run ComSkip on the MPEG file you created in step 1. Code: comskip.exe capture.mpg If you want to use VirtualDub make sure that you change the following line in the comskip.ini file from Code: output_vcf=0 to Code: output_vcf=1 Step 3 - Apply Commercial Cuts to AVI file Using VirtualDub (1.6.12 or higher) Use the following three commands from a command prompt to make the cuts using VirtualDub. Code: vdub.exe /c vdub.exe /s capture.vcf /p capture.avi capturecut.avi vdub.exe /r where capture.vcf was created by comskip, capturecut.avi is the new file created by VirtualDub. Why am I wasting your time with all this command line nonsense? Because command line based programs allow us to make batch files to automate the process. Below are example batch files that you need to modify to match your own desired directories. The resulting files in the CUTDIR folder are in the same format as the capture format. The total processing time is about 20-25 minutes for an hour of programs on an AMD 2400. Example Batch File 1 - Basic This batch file is a basic setup for using the above method for your own system. Modify the initial variables to match your directories. Code: setlocal REM The variables below need to be changed to match your setup REM Please don't change the presence or absence of quotation marks as it may interfere with the functionality of the batch file set CAPDIR=X:\DigitalVCR\temp REM Set the directory where the original AVI files are captured set CAPDIRBACKUP=X:\DigitalVCR\temp3 REM Set the directory where the original AVI files are backed up set CUTDIR=X:\DigitalVCR\converted REM Set the directory where the cut versions of the original AVI files are placed set COMSKIP="C:\Program Files\ComSkip\comskip.exe" set VDUB="C:\Program Files\VirtualDub\vdub.exe" set QUENC="C:\Program Files\QuEnc\QuEnc.exe" REM Set Program Locations %CAPDIR:~0,2% REM Change working drive to CAPDIR's drive cd %CAPDIR% REM Change working directory to CAPDIR FOR %%C in (%CAPDIR%\*.avi) DO echo AVISource("""%%C""")>"%CAPDIR%\%%~nC.avs" REM Create AVS files for use by QuEnc FOR %%C in (%CAPDIR%\*.avs) DO start "Quenc" /wait %QUENC% -i "%%C" -o "%CAPDIR%\%%~nC.mpg" -b 3000 -aspectratio 4:3 -mpeg1 -novbr -auto -nohq -priority 4 -close REM Use QuEnc to convert captures to MPG files in CAPDIR FOR %%D in (%CAPDIR%\*.mpg) DO %COMSKIP% "%%D" REM Use Comskip to read commercial locations in MPEG files FOR %%A in (%CAPDIR%\*.avi) DO echo VirtualDub.Open(u"%%A"); > "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avi) DO type "%CAPDIR%\%%~nA.vcf" >> "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avi) DO echo VirtualDub.SaveAVI(u"%CUTDIR%\%%~nA.avi"); >> "%CAPDIR%\%%~nAnew.vcf" REM Create VirtualDub script REM You can add additional lines to add video or audio processing to the vcf script file. REM If you are going to add Video processing of the file you need to add the line "VirtualDub.video.SetMode(1);" before your video processing commands. REM See http://www.virtualdub.org/docs/vdscript.txt for more info on Virtualdub scripts. FOR %%F in (%CAPDIR%\*.avi) DO %VDUB% /s "%CAPDIR%\%%~nFnew.vcf" REM Run VirtualDub script REM You can add additional commands for postprocessing here. move %CAPDIR%\*.avi %CAPDIRBACKUP% REM Move original AVI captured files to backup directory del %CAPDIR%\*.* /Q REM Remove all temporary files in original capture directory endlocal Example Batch File 2 - Adding AVISynth commands and VirtualDub to the processing. This batch file is the same as the basic batch file except that it allows you to add some AVISynth processing commands before. Modify the initial variables to match your directories. Code: setlocal REM The variables below need to be changed to match your setup REM Please don't change the presence or absence of quotation marks as it may interfere with the functionality of the batch file set CAPDIR=X:\DigitalVCR\temp REM Set the directory where the original AVI files are captured set CAPDIRBACKUP=X:\DigitalVCR\temp3 REM Set the directory where the original AVI files are backed up set CUTDIR=X:\DigitalVCR\converted REM Set the directory where the cut versions of the original AVI files are placed set COMSKIP="C:\Program Files\ComSkip\comskip.exe" set VDUB="C:\Program Files\VirtualDub\vdub.exe" set QUENC="C:\Program Files\QuEnc\QuEnc.exe" REM Set Program Locations set AVISYNTH1=Crop (30, 0, 30,0) set AVISYNTH2=AssumeTFF() set AVISYNTH3=Telecide() set AVISYNTH4=Decimate() REM Replace these example AVISynth commands here with your commands. Add more variables if required. set VDUB1=VirtualDub.video.SetMode(3); set VDUB2=VirtualDub.video.SetFrameRate(0,1); set VDUB3=VirtualDub.video.SetTargetFrameRate(250000,10000); set VDUB4=VirtualDub.video.SetCompression(0x64697678,0,10000,0); REM Replace these example VirtualDub script commands here with your commands. Add more variables if required. REM See http://www.virtualdub.org/docs/vdscript.txt for more info on Virtualdub scripts. %CAPDIR:~0,2% REM Change working drive to CAPDIR's drive cd %CAPDIR% REM Change working directory to CAPDIR FOR %%C in (%CAPDIR%\*.avi) DO echo AVISource("""%%C""")>"%CAPDIR%\%%~nC.avs" REM Create AVS files for use by QuEnc FOR %%C in (%CAPDIR%\*.avs) DO start "Quenc" /wait %QUENC% -i "%%C" -o "%CAPDIR%\%%~nC.mpg" -b 3000 -aspectratio 4:3 -mpeg1 -novbr -auto -nohq -priority 4 -close REM Use QuEnc to convert captures to MPG files in CAPDIR FOR %%D in (%CAPDIR%\*.mpg) DO %COMSKIP% "%%D" REM Use Comskip to read commercial locations in MPEG files FOR %%B in (%CAPDIR%\*.avi) DO echo AVISYNTH1 >>"%CAPDIR%\%%~nB.avs" FOR %%B in (%CAPDIR%\*.avi) DO echo AVISYNTH2 >>"%CAPDIR%\%%~nB.avs" FOR %%B in (%CAPDIR%\*.avi) DO echo AVISYNTH3 >>"%CAPDIR%\%%~nB.avs" FOR %%B in (%CAPDIR%\*.avi) DO echo AVISYNTH4 >>"%CAPDIR%\%%~nB.avs" REM Add AVISynth commands to avs file created above. Add more lines if required FOR %%A in (%CAPDIR%\*.avs) DO echo VirtualDub.Open(u"%%A"); > "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avs) DO type "%CAPDIR%\%%~nA.vcf" >> "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avs) DO echo "VirtualDub.video.SetMode(1);" >> "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avs) DO echo VDUB1 >> "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avs) DO echo VDUB2 >> "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avs) DO echo VDUB3 >> "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avs) DO echo VDUB4 >> "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avs) DO echo VirtualDub.SaveAVI(u"%CUTDIR%\%%~nA.avi"); >> "%CAPDIR%\%%~nAnew.vcf" REM Create VirtualDub script REM You can add additional lines to add video or audio processing to the vcf script file. FOR %%F in (%CAPDIR%\*.avi) DO %VDUB% /s "%CAPDIR%\%%~nFnew.vcf" REM Run VirtualDub script REM You can add additional commands for postprocessing here. move %CAPDIR%\*.avi %CAPDIRBACKUP% REM Move original AVI captured files to backup diretory del %CAPDIR%\*.* /Q REM Remove all temporary files in original capture directory endlocal Example Batch File 3 - PocketPC version This batch file is the same as the basic setup except that it uses MEncoder to convert the cut file to be playable on a PocketPC (248 kbps Video, 320 pixels wide, original aspect ratio, MPEG4; 96 kbps Audio, MP3). Modify the initial variables to match your directories. Code: setlocal
REM The variables below need to be changed to match your setup REM Please don't change the presence or absence of quotation marks as it may interfere with the functionality of the batch file set CAPDIR=X:\DigitalVCR\temp REM Set the directory where the original AVI files are captured set CAPDIRBACKUP=X:\DigitalVCR\temp3 REM Set the directory where the original AVI files are backed up set CUTDIR=X:\DigitalVCR\converted REM Set the directory where the cut versions of the original AVI files are placed set PPCDIR=X:\DigitalVCR\PPC REM Set the directory where the PocketPC versions of the captures are stored set COMSKIP="C:\Program Files\ComSkip\comskip.exe" set VDUB="C:\Program Files\VirtualDub\vdub.exe" set QUENC="C:\Program Files\QuEnc\QuEnc.exe" set MENCODER="C:\Program Files\mplayer\mencoder.exe" REM Set Program Locations %CAPDIR:~0,2% REM Change working drive to CAPDIR's drive cd %CAPDIR% REM Change working directory to CAPDIR FOR %%C in (%CAPDIR%\*.avi) DO echo AVISource("""%%C""")>"%CAPDIR%\%%~nC.avs" REM Create AVS files for use by QuEnc FOR %%C in (%CAPDIR%\*.avs) DO start "Quenc" /wait %QUENC% -i "%%C" -o "%CAPDIR%\%%~nC.mpg" -b 3000 -aspectratio 4:3 -mpeg1 -novbr -auto -nohq -priority 4 -close REM Use QuEnc to convert captures to MPG files in CAPDIR FOR %%D in (%CAPDIR%\*.mpg) DO %COMSKIP% "%%D" REM Use Comskip to read commercial locations in MPEG files FOR %%A in (%CAPDIR%\*.avi) DO echo VirtualDub.Open(u"%%A"); > "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avi) DO type "%CAPDIR%\%%~nA.vcf" >> "%CAPDIR%\%%~nAnew.vcf" FOR %%A in (%CAPDIR%\*.avi) DO echo VirtualDub.SaveAVI(u"%CUTDIR%\%%~nA.avi"); >> "%CAPDIR%\%%~nAnew.vcf" REM Create VirtualDub script REM You can add additional lines to add video or audio processing to the vcf script file. REM If you are going to add Video processing of the file you need to add the line "VirtualDub.video.SetMode(1);" before your video processing commands. REM See http://www.virtualdub.org/docs/vdscript.txt for more info on Virtualdub scripts. FOR %%F in (%CAPDIR%\*.avi) DO %VDUB% /s "%CAPDIR%\%%~nFnew.vcf" REM Run VirtualDub script FOR %%E in (%CAPDIR%\*.avi) DO %MENCODER% "%CUTDIR%\%%~nE.avi" -o "%PPCDIR%\%%~nE PPC.avi" -oac mp3lame -lameopts cbr:br=96 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=248 -vf scale=320:-11 -ffourcc DX50 REM Convert Cut files to AVI compatible with PocketPC's (248 kbps Video, 320 pixels wide, original aspect ratio MPEG4; 96 kbps Audio, MP3) REM See http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html for more options move %CAPDIR%\*.avi %CAPDIRBACKUP% REM Move original AVI captured files to backup directory del %CAPDIR%\*.* /Q REM Remove all temporary files in original capture directory endlocal |
|
| Author: | mierdatuti [ Fri Oct 03, 2008 4:02 pm ] |
| Post subject: | Re: How to remove commercials in AVI files using ComSkip |
Hi, My tv card capture on mpg. I try to follow the tutorial but when I do: ]>vdub.exe /c VirtualDub CLI Video Processor Version 1.8.6 (build 30009/release) for 80x86 Copyright (C) Avery Lee 1998-2008. Licensed under GNU General Public License >vdub.exe /s prueba.vcf /p prueba.avi pruebacortea.avi VirtualDub CLI Video Processor Version 1.8.6 (build 30009/release) for 80x86 Copyright (C) Avery Lee 1998-2008. Licensed under GNU General Public License >vdub.exe /r VirtualDub CLI Video Processor Version 1.8.6 (build 30009/release) for 80x86 Copyright (C) Avery Lee 1998-2008. Licensed under GNU General Public License AVI: Opening file "E:\GRABACION\cbreakwithmpeg\HERRAMIETNAS\total\prueba.avi" AVI: OpenDML hierarchical index detected on stream 0. AVI: OpenDML hierarchical index detected on stream 1. I see that virtual dub doesn't generate the file pruebacortea.avi and the 3 steps of virtualdub take about 10 seconds. Could you help me? Many thanks and sorry for my english! |
|
| Author: | erik [ Fri Oct 03, 2008 4:37 pm ] |
| Post subject: | Re: How to remove commercials in AVI files using ComSkip |
Sorry, I can not help as I do not use virtualdub. Maybe someone else, or you could ask you question on the forum of www.videohelp.com |
|
| Author: | mierdatuti [ Sun Oct 12, 2008 7:02 pm ] |
| Post subject: | Re: How to remove commercials in AVI files using ComSkip |
Thanks. How do you do after compskip detects the commericials to can remove from avi? Many thanks! |
|
| Author: | erik [ Sun Oct 12, 2008 7:36 pm ] |
| Post subject: | Re: How to remove commercials in AVI files using ComSkip |
Once Comskip has detected the commercials and generated a .edl output file (listing once commercial per line) mencoder can be used to remove the commercials. mencoder can take an input file, and output and an .edl file. Please have a look at the mencoder help (google for mencoder man page) how to do this or study the batch file listed above. |
|
| Author: | Tarsys [ Tue May 26, 2009 5:50 am ] |
| Post subject: | Re: How to remove commercials in AVI files using ComSkip |
I would like to add a little something to help out my peers. comskip's generated VCF files disable video processing. To fix that problem, I put a "scripts" directory in my capture directory. Then I put the following batch file. Code: @FOR %%A in (*.vcf) DO scripts\generate_script %%~nA "scripts\de-interlace_recompress.vcf" "%%A" ".\temp\%%A" @FOR %%F in (.\temp\*.vcf) DO vdub.exe /s"%%F" @rem @del *.vcf @rem @del temp\*.vcf @PAUSE My de-interlave_recompress.vcf is as follows Code: VirtualDub.audio.SetSource(1); VirtualDub.audio.SetMode(1); VirtualDub.audio.SetInterleave(1,500,1,0,0); VirtualDub.audio.SetClipMode(1,1); VirtualDub.audio.SetConversion(0,0,0,0,0); VirtualDub.audio.SetVolume(); VirtualDub.audio.SetCompressionWithHint(85,48000,2,0,16000,1,12,"AQACAAAAgAEBAAAA","MPEG Layer-3 Codec"); VirtualDub.audio.EnableFilterGraph(0); VirtualDub.video.SetInputFormat(0); VirtualDub.video.SetOutputFormat(7); VirtualDub.video.SetMode(3); Virt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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="); VirtualDub.video.filters.Clear(); VirtualDub.video.filters.Add("deinterlace"); VirtualDub.video.filters.instance[0].Config(0); VirtualDub.audio.filters.Clear(); And my Generate_script.exe is a c# executable. Here's its code. Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Generate_script { class Program { static void Main(string[] args) { try { // strings declared for debug friendlyness string file_name = args[0]; string recomp_vcf = args[1]; string input_vcf = args[2]; string output_vcf = args[3]; string first_line = "VirtualDub.Open(\"" + file_name + ".mpg\");"; string last_line = "VirtualDub.SaveAVI(\"" + file_name + ".avi\");"; // open a writer and a header. StreamWriter w = new StreamWriter(output_vcf); StreamReader header = new StreamReader(recomp_vcf); w.WriteLine(first_line); // this copies the "recompress" vcf file while (header.EndOfStream == false) { w.WriteLine(header.ReadLine()); } header.Close(); // open the cuts vcf file made by comskip StreamReader body = new StreamReader(input_vcf); body.ReadLine(); // remove 1st line. // this copies the cuts file into the output while (body.EndOfStream == false) { w.WriteLine(body.ReadLine()); } body.Close(); w.WriteLine(last_line); // closing all files is important if you want a complete file at the end of execution w.Close(); } catch (Exception e) { // generic error code. System.Console.WriteLine("Usage : Generate_script input_video compression.vcf cuts.vcf output.vcf"); System.Console.WriteLine("Error : " + e.Message.ToString()); } } } } It's actually quite simple, but can help out people so they don't have to edit by hand their 100s of vcf files. Cheers! |
|
| Author: | erik [ Tue May 26, 2009 6:05 am ] |
| Post subject: | Re: How to remove commercials in AVI files using ComSkip |
Nice explanation, well done. In case you need to re-encode then the output resolution for the video to be usable by Comskip only needs to be 320x200 when processing SD, HD may need 640x400 |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|