NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 70 71 72 73 74 … 93 Next »
Using MPEG-VCR with Comskip

 
  • 0 Vote(s) - 0 Average
Using MPEG-VCR with Comskip
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#31
2005-05-30, 08:15 PM (This post was last modified: 2005-05-30, 08:18 PM by reboot.)
OK, here's the way I figure I need to do it.
This is postprocessing.bat:
Quote:Comskip.exe %1 > comskip.log
RenameRecording.exe %1 > renamerecording.log

rem The next For command will recursively walk all subdirectories below c:\root_of_video and execute the :menc for all .txt files present.
rem Kind of brute force approach, who cares....
for /R d:\ %%f (*.txt) do call :menc "%%f"
goto :eof

:menc
rem Don't do anything if the .wme is already present.
if EXIST "%~dpn1.wme" goto :eof
Rem this is your old postprocessing.bat without the comskip or the renamerecording
convert2wme "%~dpn1.txt"

:eof
Because the ROOT folder is simply my D:\ drive, and all videos are in named subfolders, I changed it a bit (see above in bold if I did it right).

As I understand it, comskip will create a .txt file (with the OLD filename), then RenameRecording will rename the files, then "convert2wme.bat" will run on the renamed files, and generate the .wme containing the correct filenames.

Would I not need to use the CALL command for convert2wme, because it's calling a .bat file from within a .bat file?

If this works, you're my hero of the year (so far)...or maybe second only to Sub Wink
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#32
2005-05-30, 08:37 PM
Didn't work.
I'm trying again, with the convert2wme bit actuallly in the postprocessing.bat
Which bits do I need to remove/change?
I currently have this:
Quote:Comskip.exe %1 > comskip.log
RenameRecording.exe %1 > renamerecording.log

rem The next For command will recursively walk all subdirectories below c:\root_of_video and execute the :menc for all .txt files present.
rem Kind of brute force approach, who cares....
for /R d:\ %%f (*.txt) do call :menc "%%f"
goto :eof

:menc
rem Don't do anything if the .wme is already present.
if EXIST "%~dpn1.wme" goto :eof
Rem this is your old postprocessing.bat without the comskip or the renamerecording
@echo off
Rem PostProcessing.bat

rem Initialize the variables
set count=1
set start=0

rem Create the cliplist
echo # >"%~dpn1.wme"
rem Process all the lines from the Comskip output file
for /F "usebackq tokens=1,2,3*" %%i in ("%~dpn1.txt") do call :work %%i %%j "%%~dpn1" >>"%~dpn1.wme"

rem Output last clip
echo CLIPLIST: #%count% show >>"%~dpn1.wme"
echo CLIP: %~dpn1.mpg >>"%~dpn1.wme"
echo 6 %start% 200000 1 192 0 1 224 0 0 0 0 0 0 >>"%~dpn1.wme"

REM Remove rem from the beginning of the next line to Enable this to create an avi
REM mencoder.exe "%~dpn1.MPG" -oac mp3lame -lameopts mode=2:cbr:br=128 -vf scale=352:240,eq2=1.0:1.0:0.03:1.0 -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1400 -ffourcc DIVX -o "%~dpn1.small.avi"
Rem Remove the rem at the start of the next line to delete the mpg file after converting it to avi
rem del /q "%~dpn1.MPG"

rem this Should delete the x.tmp file...
IF EXIST x.tmp DEL x.tmp |y

rem Done.
goto :eof

:work
rem Skip useless lines
if "%1"=="FILE" goto :eof
if "%1"=="-------------------" goto :eof
rem Output the clip information for the show part
set /A length=%1-%start%
echo CLIPLIST: #%count% show
echo CLIP: %~dpn3.mpg
echo 6 %start% %length% 1 192 0 1 224 0 0 0 0 0 0
set/A count=%count%+1

rem Output the clip information for the commercial part
set /A length=%2-%1
echo CLIPLIST: #%count% commercial
echo CLIP: %~dpn3.mpg
echo 6 %1 %length% 1 192 0 1 224 0 0 0 0 0 0
set/A count=%count%+1

rem Remember start of next clip
set start=%2
goto :eof

:eof

See any mistakes or anything that won't work?
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#33
2005-05-30, 09:42 PM
OK...too much input Big Grin

I have my old postprocessing.bat which DOES create the .wme file.
If I rename the filename from gbpvr's default, to the episode name, inside the .wme file, it then works in Womble, after rename recording has finished.

I want to get comskip to run, on whatever file currently doesn't have a matching .txt file.
I want a .wme file created, using the proper file names, for every file that doesn't currently have one.
My captures are all in D:\ under various subfolders, which are named for the SHOW TITLE.
RenameRecording renames the .mpg to the EPISODE name (here's where the .wme doesn't work).

I have tried the postprocessing.bat variations, as well as the convert2wme.bat (which does absolutely nothing, and I have no idea why not).

This shouldn't be so damn difficult.
I sure wish I knew a lot more about DOS than I do.
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
erik
Offline

Posting Freak

Posts: 1,138
Threads: 123
Joined: Apr 2005
#34
2005-05-31, 07:54 AM
Reboot,

My sincere apologies for a "small" error in one of the FOR command which has been causing you all this trouble. The word "IN" was missing...... Sad

If you want to learn the dos commands you can use the HELP command in dos.
You start cmd.exe and if you want to know something about the FOR command then you enter
help for

For you convenience I rewrote the postprocesing.bat such that it creates a convert2wme.log file so you can see what has been done.
This version can not handle "&" in the file names!!!!!

postprocessing.bat
Quote:Rem change to the root directory where your recorded videos are stored
set myvideos=d:\

Comskip.exe %1 > comskip.log

REM Remove rem from the beginning of the next line to Enable this to create an avi
REM mencoder.exe "%~dpn1.MPG" -oac mp3lame -lameopts mode=2:cbr:br=128 -vf scale=352:240,eq2=1.0:1.0:0.03:1.0 -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1400 -ffourcc DIVX -o "%~dpn1.small.avi"
Rem Remove the rem at the start of the next line to delete the mpg file after converting it to avi
rem del /q "%~dpn1.MPG"

RenameRecording.exe %1 > renamerecording.log
rem After renamerecording the %1 parameter no longer points to the just recorded mpg file!!!!!!!

rem The next For command will recursively walk all subdirectories below myvideos and execute the :convert2wme for all .txt files present.
rem If you want all logging to be kept change the > in the next line to >>
for /R %myvideos% %%F IN (*.txt) do if NOT EXIST "%%~dpnF.wme" call :convert2wme "%%~dpnF.txt" >convert2wme.log

goto :eof

:convert2wme

rem Initialize the variables
set count=1
set start=0
rem Create the cliplist
echo # >x.wme
rem Process all the lines from the Comskip output file
for /F "usebackq tokens=1,2,3*" %%i in ("%~dpn1.txt") do call :processline %%i %%j "%%~dpn1"
rem Output last clip
echo CLIPLIST: #%count% show >>x.wme
echo CLIP: %~dpn1.mpg >>x.wme
echo 6 %start% 1000000 1 192 0 1 224 0 0 0 0 0 0 >>x.wme
rem Rename the output file
move x.wme "%~dpn1.wme"

rem If you want to add any commands to process on the newly created and renamed files this would be the place to do it.

rem Done.
goto :eof

:processline
rem Skip useless lines
if "%1"=="FILE" goto :eof
if "%1"=="-------------------" goto :eof
rem Output the clip information for the show part
set /A length=%1-%start%
echo CLIPLIST: #%count% show >>x.wme
echo CLIP: %~dpn3.mpg >>x.wme
echo 6 %start% %length% 1 192 0 1 224 0 0 0 0 0 0 >>x.wme
set/A count=%count%+1

rem Output the clip information for the commercial part
set /A length=%2-%1
echo CLIPLIST: #%count% commercial >>x.wme
echo CLIP: %~dpn3.mpg >>x.wme
echo 6 %1 %length% 1 192 0 1 224 0 0 0 0 0 0 >>x.wme
set/A count=%count%+1

rem Remember start of next clip
set start=%2
goto :eof

:eof
P4 3GHz 1GB, 250GB, nVidia dualTV, GBPVR 1.3.11, XP
Support Comskip, visit the forum and donate at http://www.comskip.org/
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#35
2005-05-31, 03:05 PM
I'm familiar with most of the basic DOS commands. I've written quite a few "utility" type .bat's (back in the Win98 days) for backing up stuff automatically, parsing the registry, restoring backups made, and a few other things, but never had to deal with multiple drive/folder access before.
The % variable is one I have never needed to use, other than %windir% or other basic SET variables included with windows. Assigning my own SET variable, etc., is ancient history for me, and I haven't used much DOS in about 5 years, and once upon a time, I was quite proficient at BASIC programming.
The concept of If/then/and as well as for/next, I'm familiar with, but the actual syntax is beyond me now. (my age is showing) Wink

Thanks for this latest, and sticking with me through this. I'm under the impression that there may be a new comskip version coming out, that will automatically generate .wme's for Womble, similar to the VideoRedo stuff it does now. It would be nice if that version works seamlessly with RenameRecording (and other postprocessing commands/plugins).

Just finished a test, and although it created the .wme correctly, renamerecording didn't rename the file, either before, or after the .wme was created.
Here's the renamerecording log:
Quote:Argument: D:\Captures\Atomic Betty\Atomic Betty_20050531_07300800.mpg
System.ApplicationException: Failed to get episode info for file 'D:\Captures\Atomic Betty\Atomic Betty_20050531_07300800.mpg' ---> System.Data.OleDb.OleDbException: Could not use ''; file already in use.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at RenameRecording.RenameRecordingClass.GetConnection()
at RenameRecording.RenameRecordingClass.GetEpisodeInfo(String& sEpisodeName, Int32& iEpisodeOid)
--- End of inner exception stack trace ---
at RenameRecording.RenameRecordingClass.GetEpisodeInfo(String& sEpisodeName, Int32& iEpisodeOid)
at RenameRecording.RenameRecordingClass.DoMain()
System.Data.OleDb.OleDbException: Could not use ''; file already in use.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at RenameRecording.RenameRecordingClass.GetConnection()
at RenameRecording.RenameRecordingClass.GetEpisodeInfo(String& sEpisodeName, Int32& iEpisodeOid)

Any idea what's going on now?
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
erik
Offline

Posting Freak

Posts: 1,138
Threads: 123
Joined: Apr 2005
#36
2005-05-31, 03:25 PM
Renamerecording does not rename the file because the .wme file is create after the rename recording.
Let me take you through the step taken.

1: Comskip is run with the .mpg file in the original location, a .txt file is created
2: Renamerecording is run. This renames all files it can find with the same directory and basename but with any extension such as .mpg and .txt to a new name for which I have no way to know what.
Now we are lost because we don't know what .txt file to convert into a .wme file and we have to do it after Renamerecording because the name is changing. The solution is 3:
3: The recursive for statement (with the /R) start to search through all your video folders for a .txt file without .wme file but further having the same name and directory.
4; If such a .txt is file found then its most probably from the recording just renamed by renamerecording so we then run convert2wme on it.

As a side effect this approach will create or recreate the .wme file for any .txt file it can find in all your video directories.

Is this correct?
P4 3GHz 1GB, 250GB, nVidia dualTV, GBPVR 1.3.11, XP
Support Comskip, visit the forum and donate at http://www.comskip.org/
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#37
2005-05-31, 04:53 PM
It all seems right.
For #3, the folder name doesn't change, just the recorded .mpg name changes, from the long, date/time format, to the actual episode name.
I just did 3 more tests, and they all worked perfectly, so I have no idea what went wrong in my first test, although it's possible there WAS NO episode name, which would cause that error of course.

Thanks again for your splendid work on this! I finally get my episode names, and Womble imports the .wme and makes it MUCH easier to edit.
It's not perfect, but it works.
Because most recordings start in the middle of a commercial, or the ending of a previous show, I have to manually scan the show#1 and commercial#2 files, to find the actual starting point of the show. Not a big deal, and I can live with it, just wanted to let you know Smile
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
erik
Offline

Posting Freak

Posts: 1,138
Threads: 123
Joined: Apr 2005
#38
2005-06-01, 09:56 AM
I have released it as a plugin
You can find it here
Also take a look at the anouncement forum
P4 3GHz 1GB, 250GB, nVidia dualTV, GBPVR 1.3.11, XP
Support Comskip, visit the forum and donate at http://www.comskip.org/
Dubya
Offline

Member

Posts: 149
Threads: 37
Joined: Dec 2004
#39
2005-06-01, 01:39 PM
Hey erik, this might be a dumb question but I can't figure out how to run this batch file on already existing comskip txt files. Might you be able to help?

Dubya
erik
Offline

Posting Freak

Posts: 1,138
Threads: 123
Joined: Apr 2005
#40
2005-06-01, 02:20 PM
Make shure you have convert2wme.bat in the gbpvr root directory

The windows way:
Make shure you have convert2wme.bat in the gbpvr root directory
Create a shortcut on your desktop to convert2wme.bat by dragging convert2wme.bat to the desktop while holding ALT
Then for each file you want to convert drag and drop it on the shortcut created on on your desktop.
This will create in the same directory as the .txt file a .wme file.

The dos way:
Start a cmd.exe inside the gbpvr root directory
suppose your .txt file is d:\myvideos\This_episode 20050530.txt
enter in the cmd window
convert2wme "d:\myvideos\This_episode 20050530.txt"
You do not need the " around the file name if there are no spaces in the name.

The layzy way.
Rename the postprocessing.bat in the plugin zip file to convertall.bat and copy it insize the gbpvr root directory
update the directory name in convertall.bat to point to the root directory where you store your .txt files
run convertall
now all your .txt files are converted to .wme files Smile
P4 3GHz 1GB, 250GB, nVidia dualTV, GBPVR 1.3.11, XP
Support Comskip, visit the forum and donate at http://www.comskip.org/
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (5): « Previous 1 2 3 4 5 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mpeg-dash bgowland 2 2,353 2013-09-26, 05:43 PM
Last Post: bgowland
  Any interrest for a Comskip version that can decode VBI/CC from TS or DVR-MS? erik 10 4,254 2008-05-17, 08:10 PM
Last Post: erik
  Determining the comskip rate. pastro 2 1,655 2007-10-07, 08:05 PM
Last Post: pastro
  DVD to MPEG - target drive other than C:? MarkD 2 1,510 2006-11-12, 10:29 PM
Last Post: MarkD
  vb6, get WxH of Avi and Mpeg zehd 2 1,904 2006-06-13, 11:39 PM
Last Post: zehd
  Comskip: Can some upload short DVR-MS exmaples to test the DVR-MS input of Comskip erik 1 1,458 2006-03-25, 06:21 PM
Last Post: -stattik-
  Comskip: What next? erik 0 1,553 2006-03-15, 09:51 PM
Last Post: erik
  Looking for Comskip tester for DVB or ATSC TS input erik 3 1,973 2006-01-30, 08:32 PM
Last Post: hazydave
  Looking for a logo for Comskip erik 3 2,073 2006-01-05, 12:23 AM
Last Post: jbyram2
  Connect MPEG-2 demux filter in Directshow graph? bgowland 3 6,224 2006-01-01, 04:16 PM
Last Post: funkybro_uk

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode