NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums General General Discussion v
« Previous 1 … 20 21 22 23 24 … 159 Next »
Using PostProcessing.bat to create a queue?

 
  • 0 Vote(s) - 0 Average
Using PostProcessing.bat to create a queue?
OTAjunkie
Offline

Senior Member

Posts: 277
Threads: 49
Joined: Jul 2010
#1
2012-05-21, 02:43 PM
I've finally got Mencoder working to transcode TS to AVI and clean commercials.
I use these files on my phone, they're only about 325mb(1hr show),480x320 and +10db on the audio.
But if I get 2 or more instances of Mencoder running with other stuff happening, well the results are not nice.
So I'd like to create a queue file of all recordings(24hrs) and then get Mencoder to knock'em off ONE AT A TIME.
Any ideas on how to to this?

Thanks
Server:ASUS F1A75-V Pro,Radeon HD 6000,AMD A6 3670K,SSD128GB,2xWD 2Tb,W7Ultx64,5.1spks,2xHaup2250-MC,ATI650,CM7777,WG HD-8800
ClientTongue4 3.4,ATI HD4650,W7Ult
ClientTongue4 3.06,NVIDA6200,W7Ult
Client:Gateway Netbook,W7Start/XPpro
nDroid Client:Samsung Galaxy Note(synced to previous days recordings)
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#2
2012-05-21, 04:59 PM
I would try the simplest thing that I can think of ...

postprocessing.bat starts a command file called, say, dotranscode.bat ...

IF EXIST TranStop.txt in some folder then TIMEOUT for, say, 15 minutes.
COPY TranStop.txt from someplace to a folder.
Do mencoder
Delete TranStop.txt

Good Luck
ElihuRozen
Offline

Senior Member

Massachusetts, USA
Posts: 514
Threads: 51
Joined: Apr 2006
#3
2012-05-21, 06:11 PM
I'm at work & don't have the code in front of me, but when I wanted to do something similar, I had postprocessing.bat add the filename to the end of a text file. Then, in PostUpdateEPG.bat, I go through & process that list of files.

Mine is a little more complicated because I wanted to defrag, but only if the file still exists after a couple days.
ElihuRozen
Offline

Senior Member

Massachusetts, USA
Posts: 514
Threads: 51
Joined: Apr 2006
#4
2012-05-22, 12:11 AM (This post was last modified: 2012-05-22, 12:14 AM by ElihuRozen.)
Near the top of my PostProcessing.bat
Code:
cd /d "C:\Users\Public\NPVR\Scripts"
set QUEUEFILE=PostProcessingQueue.txt
Near the end of my PostProcessing.bat
Code:
rem write filename to queue for later processing
echo %1 >> %QUEUEFILE%

I was going to put my code from PostUpdateEPG.bat here, but I realize that it just called a program written in AutoIt3. That program is pretty complicated because it would check how old each file was and then only process the ones older than two days. In your case you could do something like this (bearing in mind I am writing this without knowing mencoder or fully testing it):
Code:
@echo off
cd /d "C:\Users\Public\NPVR\Scripts"
set QUEUEFILE=PostProcessingQueue.txt
set LOGFILE="..\logs\ProcessQueue.log"

for /f "delims=," %%i in (%QUEUEFILE%) do mencoder -option1 -option2 -inputFile %%i >>%LOGFILE%
The filename will be passed to mencoder in quotes. This assumes you do not have any commas in your file names. It defaulted to using a space as a delimiter, but my file names have spaces.
OTAjunkie
Offline

Senior Member

Posts: 277
Threads: 49
Joined: Jul 2010
#5
2012-05-22, 12:16 AM
Yesss! this looks very nice.
I'll have to wait until tomorrow to try it but I like what I see.

Thanks very much!
Server:ASUS F1A75-V Pro,Radeon HD 6000,AMD A6 3670K,SSD128GB,2xWD 2Tb,W7Ultx64,5.1spks,2xHaup2250-MC,ATI650,CM7777,WG HD-8800
ClientTongue4 3.4,ATI HD4650,W7Ult
ClientTongue4 3.06,NVIDA6200,W7Ult
Client:Gateway Netbook,W7Start/XPpro
nDroid Client:Samsung Galaxy Note(synced to previous days recordings)
OTAjunkie
Offline

Senior Member

Posts: 277
Threads: 49
Joined: Jul 2010
#6
2012-05-22, 01:05 AM (This post was last modified: 2012-05-22, 12:25 PM by OTAjunkie.)
I managed to get the lines into PostProcessing before comskip finished on this evenings first recording.
The QUEUEFILE is populating!
I'm unsure how to complete the Mencoder lines for the PostUpdateEPG.
Here's the two Mencoder comannds:

mencoder "%~dpn1.ts" -af volume=+10db -vf-add scale=480:320 -ofps 29 -oac faac -faacopts br=192:mpeg=4:object=2 -ovc xvid -xvidencopts
bitrate=1500:aspect=16/9:threads=2 -o "%~dpn1.avi"


mencoder "%~dpn1.avi" -edl "%~dpn1.edl" -oac copy -ovc copy -of avi -o "%~dpn1_.avi"

OR the combined command:

mencoder "%~dpn1.ts" -edl "%~dpn1.edl" -af volume=+10db -vf-add scale=480:320 -ofps 29 -oac faac -faacopts br=192:mpeg=4:object=2 -ovc xvid -xvidencopts bitrate=1500:aspect=16/9:threads=2 -o "%~dpn1.avi"



Could you save me some time and provide the correct syntax?

BTW: These commands ONLY seem to work with a copy of Mencoder that is 12,574KB, if anyone wants to use it.
Server:ASUS F1A75-V Pro,Radeon HD 6000,AMD A6 3670K,SSD128GB,2xWD 2Tb,W7Ultx64,5.1spks,2xHaup2250-MC,ATI650,CM7777,WG HD-8800
ClientTongue4 3.4,ATI HD4650,W7Ult
ClientTongue4 3.06,NVIDA6200,W7Ult
Client:Gateway Netbook,W7Start/XPpro
nDroid Client:Samsung Galaxy Note(synced to previous days recordings)
Nistrod
Offline

Member

Posts: 243
Threads: 45
Joined: Jul 2010
#7
2012-05-22, 08:54 AM
Without being a wet blanket, I can see all sorts of race conditions in the above code. The for loop probably pre-reads the queue file, so any entries added while processing is happening are ignored.
The queue file gets deleted when complete, throwing away the new entries.

You could get around this by creating trigger files for each recording that are removed when complete.
New trigger files will be processed next time around.

I was exploring mcebuddy, which seemed to integrate quite well with NPVR. Use the one at http://sourceforge.net/projects/mcebuddy2x/ not the one Google finds first (thats old).
This watches a folder for new TS files, and then converts them to mkv/mp4 or whatever, using ffmpeg or mencoder.
This queues things up, and you can specify the number of simultaneous conversions.
It all works pretty (actually very) well, but...

the conversion was, how should I put this, less than satisfactory. Poor resolution, and quite jerky.
You can tune the mencoder parameters, but I haven't got around to this yet. I dont know mencoder.

OTAjunkie has better understanding of mencoder than me, so this bit may be a breeze.
Just a suggestion.
[SIZE="1"]NPVR 2.6.2;Windows 7 Enterprise SP1;i5 750; 8GB mem;Geforce 210;Winfast DTV100 S, Winfast DTV Dongle Gold; 2 x Winfast DTV2000DS
[/SIZE]
OTAjunkie
Offline

Senior Member

Posts: 277
Threads: 49
Joined: Jul 2010
#8
2012-05-22, 11:53 AM
Nistrod Wrote:Without being a wet blanket, I can see all sorts of race conditions in the above code. The for loop probably pre-reads the queue file, so any entries added while processing is happening are ignored.
The queue file gets deleted when complete, throwing away the new entries.

This is not an issue for me because processing won't start until after the last entry is added.

But I still can't get the right syntax for the processing bat!
Server:ASUS F1A75-V Pro,Radeon HD 6000,AMD A6 3670K,SSD128GB,2xWD 2Tb,W7Ultx64,5.1spks,2xHaup2250-MC,ATI650,CM7777,WG HD-8800
ClientTongue4 3.4,ATI HD4650,W7Ult
ClientTongue4 3.06,NVIDA6200,W7Ult
Client:Gateway Netbook,W7Start/XPpro
nDroid Client:Samsung Galaxy Note(synced to previous days recordings)
ElihuRozen
Offline

Senior Member

Massachusetts, USA
Posts: 514
Threads: 51
Joined: Apr 2006
#9
2012-05-22, 01:00 PM (This post was last modified: 2012-05-22, 01:14 PM by ElihuRozen.)
This is an example of a PostUpdateEPG.bat that should work for you, but you should double-check the syntax of the mencoder options since I did a copy & paste from your post and one of the characters displayed as an emoticon. You could just copy & paste your original line(s) in the doMenucoder section.
Code:
@echo off
cd /d "C:\Users\Public\NPVR\Scripts"
set QUEUEFILE=PostProcessingQueue.txt
set LOGFILE="..\logs\ProcessQueue.log"

rem ...................................................
rem Do other postUpdateEPG processing here if necessary
rem ...................................................


for /f "delims=," %%i in (%QUEUEFILE%) do call:doMencoder %%i

rem Move the QueueFile so we can start with a new one for anything we record today
move /Y %QUEUEFILE% %QUEUEFILE%.save

rem ...................................................
rem Do other postUpdateEPG processing here if necessary
rem ...................................................


goto AfterMencoder
:doMencoder
mencoder "%~dpn1.ts" -af volume=+10db -vf-add scale=480:320 -ofps 29 -oac faac -faacopts br=192:mpeg=4bject=2 -ovc xvid -xvidencopts bitrate=1500:aspect=16/9:threads=2 -o "%~dpn1.avi" >>%LOGFILE%

mencoder "%~dpn1.avi" -edl "%~dpn1.edl" -oac copy -ovc copy -of avi -o "%~dpn1_.avi" >>%LOGFILE%

goto :eof

:AfterMencoder


rem ...................................................
rem Do other postUpdateEPG processing here if necessary
rem ...................................................


echo done
OTAjunkie
Offline

Senior Member

Posts: 277
Threads: 49
Joined: Jul 2010
#10
2012-05-22, 01:29 PM
Ok, The process has started.
I'm gonna let it run for the full queue (8 programs/7.5 hours of shows) should take about 8.5 hours real time if all goes well.

Will update on completion or other result.

Thanks so much for your help on this guys!
Server:ASUS F1A75-V Pro,Radeon HD 6000,AMD A6 3670K,SSD128GB,2xWD 2Tb,W7Ultx64,5.1spks,2xHaup2250-MC,ATI650,CM7777,WG HD-8800
ClientTongue4 3.4,ATI HD4650,W7Ult
ClientTongue4 3.06,NVIDA6200,W7Ult
Client:Gateway Netbook,W7Start/XPpro
nDroid Client:Samsung Galaxy Note(synced to previous days recordings)
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can I create FLV/SWF files from dvr-ms recordings Graham 1 1,752 2010-03-08, 10:33 PM
Last Post: luttrell1962
  Impressed...how to create? andrewdiabo 8 3,006 2006-10-01, 12:09 AM
Last Post: andrewdiabo
  Postprocessing suggestions SickBoy 3 1,955 2005-11-16, 04:46 PM
Last Post: sub
  Free Divx Create Bundle (Today Only) Jere_Jones 7 3,132 2005-09-30, 02:23 PM
Last Post: nitrogen_widget
  Adding audio to mpg file to create a DVD tkgafs 1 2,075 2005-07-18, 04:47 PM
Last Post: reboot

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

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

Linear Mode
Threaded Mode