NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) GB-PVR Support (legacy) v
« Previous 1 … 124 125 126 127 128 … 1231 Next »
Transcoding, COMSKIP and the GPBVR database

 
  • 0 Vote(s) - 0 Average
Transcoding, COMSKIP and the GPBVR database
serafis
Offline

Member

Posts: 108
Threads: 23
Joined: Apr 2007
#1
2009-05-30, 05:30 AM (This post was last modified: 2009-05-30, 05:34 AM by serafis.)
Thanks for taking the time to read this.

I'm recording NZ Freeview in .ts format (mux'd H.264 / HE-AAC) which takes up heaps of disk space, and COMSKIP doesn't seem to work either.

I've been experimenting with using postprocessing.bat to run HANDBRAKE to transcode to ffmpeg4 or xVid / mp3 in a .AVI container, and that part of it seems to work pretty well.

However, this raises two questions:
1. Will COMSKIP work on an AVI file if I run it in postprocessing.bat after the transcoding? Or do I need to transcode to MPEG2 first, then run COMSKIP, then transcode to mpeg4/MP3?
<edit> I suspect the answer to this is that COMSKIP only works on mpeg recordings but would appreciate confirmation of this</edit>

2. Is there a way of pointing the GBPVR databse at the transcoded file rather than the original .ts recording? I know GBPVR has this as an option if you set it to auto-transcode, but auto-transcoding doesn't work with H264 / HE-AAC .ts recordings. So I was wondering if there's a command I can run to do this in postprocessing.bat?

Thanks for any help.
[SIZE="1"]Near-silent budget HTPC: X-case w/ ACBel 400W quiet PSU, 2x undervolted (5V) 80mm case fans, ASUS M2A-VM-HDMI, silent Asus nVidia 9400GT, AMD X2 4800+, 2GB Corsair DDR800, Windows XP/SP3, Hauppauge HVR-900 hybrid tuner + PVR150MCE analog, GBPVR PVRX2 (latest), CyberLink H.264 PDVD(7), Monogram AAC, FFDShow video & audio, VMR9-FSE

HDMI -> Panasonic PTAX100E 100" 720p/1080i projector, S-Video -> 27" CRT TV, SP/DIF -> Denon AVR3805 (7.1) + Q-Acoustics 1030 / 1010 speakers, Harmony 525 remote[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,684
Threads: 767
Joined: Nov 2003
#2
2009-05-30, 05:48 AM
Quote:1. Will COMSKIP work on an AVI file if I run it in postprocessing.bat after the transcoding?
No, you'd have to use the H.264 version of comskip and run it prior to converting the file.

Quote:2. Is there a way of pointing the GBPVR databse at the transcoded file rather than the original .ts recording? I know GBPVR has this as an option if you set it to auto-transcode, but auto-transcoding doesn't work with H264 / HE-AAC .ts recordings. So I was wondering if there's a command I can run to do this in postprocessing.bat?
If it doesnt find a .ts recording file, but finds a file of the same name, but with .avi extension, it automatically update the database to point to the .avi file.
skinny
Offline

Member

Posts: 68
Threads: 13
Joined: May 2007
#3
2009-06-13, 08:15 AM
Hey serafis, I'd love to see how Handbrake works with postprocessing.bat. I use Handbrake for transcoding to AVIs, mainly so other older pcs/laptops around the home can view recorded programmes.
Could you post a howto on this?
serafis
Offline

Member

Posts: 108
Threads: 23
Joined: Apr 2007
#4
2009-06-14, 08:53 AM
skinny Wrote:Hey serafis, I'd love to see how Handbrake works with postprocessing.bat. I use Handbrake for transcoding to AVIs, mainly so other older pcs/laptops around the home can view recorded programmes.
Could you post a howto on this?

The explanation below assumes a basic knowledge of windows batch files and parameter substitution (and Handbrake!).

I put the following line into the Postprocessing.bat file in the GBPVR installation directory after the :continue label and before the :eof label, where it runs after Comskip finishes (the command is all on one line):

"C:\Program Files\Handbrake\HandBrakeCLI.exe" -i "%~1" -t 1 -c 1 -o "%~dpn1.avi" -f avi -p -e ffmpeg -S 1400 -2 -a 1 -E lame -B 160 -R 0 -6 dpl2 -D 1 -C 2 -v

This command runs the Handbrake CLI, converting the input .ts file (passed as the first parameter from GBPVR) into ffmpeg mpeg4 in an AVI container with a target filesize of 1400MB, and with the default audio track into mp3.

Three things to note in the above command.

1. The input file is specified as "%~1". The first parameter (usually referenced as %1) is passed from GBPVR and contains the full path and filename to process. The expression %~1 references %1 without any surrounding quotes (because I don't know if it has quotes or not). The expression "%~1" then puts quotes back around it, because the Handbrake command will need it quoted if if has any spaces or special characters in it. The result will be something like "E:\My Recordings\CSI Miami\CSI Miami 20090608.ts"

2. The output file is specified as "%~dpn1.avi". I want the transcoded file to be placed in the same directory as the source file and with the same file name, but with .avi as the extension rather than .ts. The expression %~dpn1" expands %1 to the disk, path and filename (but not the extension) of the file to be processed. The expression "%~dpn1.avi" appends the .avi extension and encloses it in quotes. The result will be something like "E:\My Recordings\CSI Miami\CSI Miami 20090608.avi"

3. I built the basic Handbrake command from the Handbrake GUI. First I set the source to the .ts file I wanted to encode. Then I set the output file to the same path and filename with .avi extension. I selected the encoding parameters and added the job to the Encode Queue. The I opened the Encode Queue window and used the "Generate Batch Script" command to create a batch file. I then copied the Handbrake command from this batch file and pasted it into Postprocessing.bat and changed the input and output filenames to replaceable parameters as above. Much easier than learning all the Handbrake switches, although I'll probably do this when I get time too.

Optionally, you could also add the following command to delete the source file once transcoded; there is a danger that if transcoding fails (and I don't know whether Handbrake returns an ERRROLEVEL in this case), the source could be deleted without the target file being complete. I do a basic check that the transcoded file exists as part of the delete though:

If exist "%~dpn1.avi" del /q "%~1"


I haven't got Comskip to work on .ts files with H.264/HE-AAC; I think I may need to make a donation to get the version that does this but haven't had time to get that far yet. So my .ts files transcode with commercials still embedded, which is a bit of a pain. For the present, I usually record analogue instead and only record Freeview if I really want the higher definition video, in which case I'll keep it in .ts format anyway.
[SIZE="1"]Near-silent budget HTPC: X-case w/ ACBel 400W quiet PSU, 2x undervolted (5V) 80mm case fans, ASUS M2A-VM-HDMI, silent Asus nVidia 9400GT, AMD X2 4800+, 2GB Corsair DDR800, Windows XP/SP3, Hauppauge HVR-900 hybrid tuner + PVR150MCE analog, GBPVR PVRX2 (latest), CyberLink H.264 PDVD(7), Monogram AAC, FFDShow video & audio, VMR9-FSE

HDMI -> Panasonic PTAX100E 100" 720p/1080i projector, S-Video -> 27" CRT TV, SP/DIF -> Denon AVR3805 (7.1) + Q-Acoustics 1030 / 1010 speakers, Harmony 525 remote[/SIZE]
skinny
Offline

Member

Posts: 68
Threads: 13
Joined: May 2007
#5
2009-06-14, 07:38 PM
Thanks serafis, that gives me a lot to play with, never did understand parameter substitution, but this helps a lot. One other question, what Postprocessing.bat file did you start with? I don't have one.. Cheers
serafis
Offline

Member

Posts: 108
Threads: 23
Joined: Apr 2007
#6
2009-06-14, 10:24 PM
There should be a sample one in the GBPVR installation directory (there is in mine) - maybe it's only created if you enable Comskip in config or something?

Sub are you able to advise here?

Slightly off-topic, but...

Replaceable parameters (and variables) merely substitute their value into the batch file wherever they're used:

%0 = full path and filename of the batch file being run
%1-9 = replaceable parameters passed as input on the command line, separated by spaces.

So if the command line was "C:\Batch Scripts\test.bat" para1 para2 "para three" para 4, then the replaceable parameters would expand as follows:

%0 = "C:\Batch Scripts\test.bat"
%1 = para1
%2 = para2
%3 = "para three"
%4 = para
%5 = 4

So in the batch file, "ECHO %1 is not equal to %2 and para 4 should be %4%5" would display the following on the screen:
"para1 is not equal to para2 and para 4 should be para4"

I don't know what the technical name for the %~..n format is, but it modifies the parameter (or the substitution variable in a FOR statement), e.g.
%~n removes quotes from parameter n
%~dn returns only the Disk part of a path/filename, if parameter n is a valid filename etc...

A full list of these modifiers can be found by typing FOR /? in a cmd window - they're on about the third and fourth screens of Help if I recall correctly.

Cheers.
[SIZE="1"]Near-silent budget HTPC: X-case w/ ACBel 400W quiet PSU, 2x undervolted (5V) 80mm case fans, ASUS M2A-VM-HDMI, silent Asus nVidia 9400GT, AMD X2 4800+, 2GB Corsair DDR800, Windows XP/SP3, Hauppauge HVR-900 hybrid tuner + PVR150MCE analog, GBPVR PVRX2 (latest), CyberLink H.264 PDVD(7), Monogram AAC, FFDShow video & audio, VMR9-FSE

HDMI -> Panasonic PTAX100E 100" 720p/1080i projector, S-Video -> 27" CRT TV, SP/DIF -> Denon AVR3805 (7.1) + Q-Acoustics 1030 / 1010 speakers, Harmony 525 remote[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,684
Threads: 767
Joined: Nov 2003
#7
2009-06-14, 10:31 PM
There is no PostProcessing.bat by default. Those that have them have manually created them, or downloaded/installed them from somewhere.
serafis
Offline

Member

Posts: 108
Threads: 23
Joined: Apr 2007
#8
2009-06-15, 08:50 AM
Thanks Sub, in a fit of "Craft syndrome" (can't remember a f.. thing) I guess I must have downloaded it from the Wiki or elsewhere whe n I was first playing around with it.

http://gbpvr.com/pmwiki/pmwiki.php/Tips/ProcessingBats
[SIZE="1"]Near-silent budget HTPC: X-case w/ ACBel 400W quiet PSU, 2x undervolted (5V) 80mm case fans, ASUS M2A-VM-HDMI, silent Asus nVidia 9400GT, AMD X2 4800+, 2GB Corsair DDR800, Windows XP/SP3, Hauppauge HVR-900 hybrid tuner + PVR150MCE analog, GBPVR PVRX2 (latest), CyberLink H.264 PDVD(7), Monogram AAC, FFDShow video & audio, VMR9-FSE

HDMI -> Panasonic PTAX100E 100" 720p/1080i projector, S-Video -> 27" CRT TV, SP/DIF -> Denon AVR3805 (7.1) + Q-Acoustics 1030 / 1010 speakers, Harmony 525 remote[/SIZE]
shadowze
Offline

Member

Posts: 69
Threads: 18
Joined: Dec 2005
#9
2009-06-15, 07:52 PM
Hi,
I get BBC HD programs in .ts files , this is how I deal with them

I use the built in remuxer from haali
excerpts from my postprocessing.bat

Code:
"%programfiles%\Haali\MatroskaSplitter\dsmux.exe" %DESTFILE% %1;0.ar=16x9;0.lang=und;1.lang=eng


this converts my recordings to mkv ( and shaves about 15% off size) , need haali mkv splitter installed

Then I point db to new file , requires sqlite3.exe to be in gbpvr dir


Code:
set db=GBPVR.DB3
set oid=
for /f "usebackq tokens=1,2 delims=," %%v in (`sqlite3 "%db%" "SELECT oid FROM recording_schedule where filename like '%%%~nx1'; " `) do set oid=%%v
sqlite3.exe -separator "," "%db%" "UPDATE RECORDING_SCHEDULE SET filename = '%DESTFILE%' where oid = '%oid%';"

Hope this helps
Main Rig:
Gigabyte X58-DS4 , i7 920 @3.6G , 3G 1600Mhz, GTX280 OC2 , Nova-TD 500 , Nova-HD-S2, 3x 300G SataII

Media Center:
Gigabyte P45 ,Q6600 , 4G 8500C5 , GTX 280 OC , Nova-T 500 , Nova-HD-S2, 1 x 250G laptop , 1 x 320G
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Huge database (+27GB) - is it a problem? pme 7 2,959 2011-01-24, 12:37 AM
Last Post: gEd
  "database disk image is malformed" during attemped EPG update! (GBPVR v.1.4.7) DaveA 4 3,317 2011-01-23, 06:35 PM
Last Post: DaveA
  Automatic Transcoding Not Working taz 3 2,220 2010-11-22, 09:01 AM
Last Post: goelectric
  GBPVR Database question - Recording Schedule David B 1 1,616 2010-11-08, 09:21 PM
Last Post: sub
  Lost recordings database keith_leitch 9 3,687 2010-09-22, 09:20 PM
Last Post: keith_leitch
  Postprocessing and the recordings database shsw 1 1,482 2010-08-29, 04:46 PM
Last Post: sub
  Lost recordings database dongna 25 7,752 2010-08-26, 10:00 AM
Last Post: martint123
  Strange database problem -- pvrx2 not seeing updates, EWA and Config.exe are. 86atc250r 5 2,387 2010-07-26, 10:09 AM
Last Post: martint123
  Comskip pcostanza 3 2,352 2010-06-02, 01:46 AM
Last Post: pBS
  Running comskip at a scheduled time? gonzo90017 4 2,101 2010-05-19, 06:09 AM
Last Post: pBS

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

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

Linear Mode
Threaded Mode