NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Information Community Announcements v
« Previous 1 13 14 15 16 17 … 56 Next »
mTranscode BETA - automatic encoding of recordings

 
  • 0 Vote(s) - 0 Average
mTranscode BETA - automatic encoding of recordings
jam_zhou
Offline

Senior Member

Posts: 632
Threads: 179
Joined: Sep 2005
#31
2005-12-15, 08:52 PM
echo %newname% >>transcode_queue.txt
should there be a space??
echo %newname% >> transcode_queue.txt


would be more correct than the other one. %1 will be just the filename passed postprocessing.bat.

If you have importqueue=0 then you better have transcode_queue in the same directory as mtranscode.vbs. I don't think you are doing this.
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#32
2005-12-15, 08:57 PM
Here's another renamerecordings.log
Code:
File 'D:\Aladdin\Aladdin_20051215_12371300.csv' renamed to
     'D:\Aladdin\Do the Rat Thing.csv'
File 'D:\Aladdin\Aladdin_20051215_12371300.log' renamed to
     'D:\Aladdin\Do the Rat Thing.log'
File 'D:\Aladdin\Aladdin_20051215_12371300.mpg' renamed to
     'D:\Aladdin\Do the Rat Thing.mpg'
File 'D:\Aladdin\Aladdin_20051215_12371300.txt' renamed to
     'D:\Aladdin\Do the Rat Thing.txt'
File 'D:\Aladdin\Aladdin_20051215_12371300.VPrj' renamed to
     'D:\Aladdin\Do the Rat Thing.VPrj'
This works, but I cannot pass the renamed name to transcode_queue.txt
Mencoder works, on the original file easily.
Here is transcode_queue.txt
Code:
"D:\Aladdin\Aladdin_20051215_12371300.mpg"
Here is the portion of my .bat that does the parsing of "renamerecordings.log", passes the name to transcode_queue.txt, then runs mencoder.
Code:
REM testing rename to newname section---------------------
rem Process all the lines from the Renamerecording log file
set newname=%1
for /F "usebackq delims=' tokens=1,2,3,4,5" %%i in ("renamerecordings.log") do call :processline "%%j"  "%%l"
goto :afternewname

:processline
rem Remove
if NOT "%~x2" == ".mpg" goto :eof
set oldname=%~1
set newname=%~2

goto :eof

:afternewname

echo %newname% >> transcode_queue.txt

REM end testing rename to newname section-------------------

REM Testing mencoder section------------------
REM This is the transcoding portion
echo %1 >> transcode_queue.txt
cd "C:\Program Files\devnz\gbpvr\Transcoder\"
start /min /low mtranscode.vbs
REM end mencoder test section ------------------
:eof

Edit: Yes, I am running everything from c:\program files\devnz\gbpvr\
I was trying it all from another folder, but gave up on that idea, and modified config to reflect the change (actually just downloaded it and overwrote it).
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-12-15, 09:35 PM
After a bunch more testing, Erik's portion doesn't pass the filename properly.
The transcode log just states that it can't find the file, looking for the original filename, which doesn't exist because it's been renamed.
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-12-15, 10:13 PM
OK,

So this is how your code should look like
Remember, this is AFTER the renaming took place so the new names are in renamerecordins.log

Code:
rem Process all the lines from the Renamerecording log file
rem This will read each line in the log and icreates the transocder queue
for all lines that have an mpeg file name
for /F "usebackq delims=' tokens=1,2,3,4,5" %%i in ("renamerecordings.log") do call :processline "%%j"  "%%l"
Rem all lines are processed so nothing more to do except starting the transcode batch

REM This is the transcoding portion
cd "C:\Program Files\devnz\gbpvr\Transcoder\"
start /min /low mtranscode.vbs
REM end mencoder test section ------------------


goto :eof

:processline
This is called for each line in the log file
rem Only do something for lines where an mpeg file is renamed, otherwise do nothing
if NOT "%~x2" == ".mpg" goto :eof
set oldname=%~1
set newname=%~2
Rem Here you have to do all the processing because only here its guaranteed to have the old and the new name.
Rem If the renamerecodings.log file contains the log of renaming multiple mpegs this will be executed for each mpeg file

echo %newname% >> transcode_queue.txt

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

Senior Member

Posts: 632
Threads: 179
Joined: Sep 2005
#35
2005-12-15, 10:32 PM
I don't know how to use dos batch that well...if you look through my code however, there's a file parser function which may help you out.

I'll try to figure out a vb script later on...in the meantime good luck
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#36
2005-12-16, 01:25 AM (This post was last modified: 2005-12-16, 01:30 AM by reboot.)
I tried that Erik, and nothing happens. Renamerecordings works, but the new name doesn't get passed to transcode_queue.txt, so mtranscode.vbs produces a log:
Code:
2005-12-15-17-20-44- --------------Iteration # 1---------------
2005-12-15-17-20-44- Used Local Queue: transcode_queue.txt
2005-12-15-17-20-44- RAW   : "D:\Finding the Fallen\Finding the Fallen_20051215_17001800.mpg"
2005-12-15-17-20-44- Parsed: D:\Finding the Fallen\Finding the Fallen_20051215_17001800.mpg
2005-12-15-17-20-44- PARSED: "D:\Finding the Fallen\Finding the Fallen_20051215_17001800.mpg"
2005-12-15-17-20-44- Extension: .mpg
2005-12-15-17-20-44- File Not Found "D:\Finding the Fallen\Finding the Fallen_20051215_17001800.mpg"
2005-12-15-17-20-44- delete transcoded file from queue
2005-12-15-17-20-44- RAW   : "D:\Finding the Fallen\Finding the Fallen_20051215_17001800.mpg"
2005-12-15-17-20-44- Parsed: D:\Finding the Fallen\Finding the Fallen_20051215_17001800.mpg
2005-12-15-17-20-44- PARSED: "D:\Finding the Fallen\Finding the Fallen_20051215_17001800.mpg"
2005-12-15-17-20-44- Extension: .mpg
2005-12-15-17-20-44- File Not Found "D:\Finding the Fallen\Finding the Fallen_20051215_17001800.mpg"
2005-12-15-17-20-44- delete transcoded file from queue
2005-12-15-17-20-44- RAW   :
2005-12-15-17-20-44- Transcode queue done
2005-12-15-17-20-44- Number of transcodes: 3
2005-12-15-17-20-44- -----DONE-----
That's all that happens.
I tried with a second line
Code:
echo %newname% >>new_filename.txt
and it ALWAYS contains the original name of the file, not it's proper renamed one.
Is there any other way to get the renamed filename? Poll the folders?
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
jam_zhou
Offline

Senior Member

Posts: 632
Threads: 179
Joined: Sep 2005
#37
2005-12-16, 01:31 PM (This post was last modified: 2005-12-16, 02:43 PM by jam_zhou.)
Hey Reboot, try this...it worked for the sample you gave me. Open the file and change to point to the proper log file. You will also have to rename the output file in the debug function to transcode_queue.txt.

Run this script instead of echo %1 >> transcode queue then delete the old log or else you'll keep queueing the same set of files.

Finally, the resulting spaces in front of the first " will be parsed out in the mTranscode script.


Jam.z
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#38
2005-12-16, 03:42 PM
I don't understand half of what you posted.
I have the file, renamed to newname.vbs
Exactly what am I supposed to do with it?
Quote:Open the file and change to point to the proper log file.
What file?
Quote:You will also have to rename the output file in the debug function to transcode_queue.txt.
Huh?
Quote:delete the old log or else you'll keep queueing the same set of files.
Huh again?
You assume I know something about vbs scripts, and know more than I really do about DOS .bat files.
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
jam_zhou
Offline

Senior Member

Posts: 632
Threads: 179
Joined: Sep 2005
#39
2005-12-16, 04:02 PM
Sorry about that...I was in a bit of a hurry.

here's a new file. Just put it in the same directory as your renamerecordings.log and run it. It should be able to output a transcode_queue.txt with the proper new name.

The script looks for a line with "mpg" but not "renamed". I'll try to write a more sophisticated script later on today.

Once again, run this script instead of echo %1 >> transcode_queue.txt

Just a note about batch files. In a batch file, to change drives you have to use d:\ or e:\. For example if you were in C drive and wanted to goto d:\temp your batch file would have to be like this:

d:\
cd \temp

NOT

cd d:\temp

I learned that the hard way.
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#40
2005-12-16, 05:10 PM (This post was last modified: 2005-12-16, 05:18 PM by reboot.)
Thank you VERY much for taking all this extra time to sort this out.
I had everything working, except Erik's portion of the .bat to get the renamed filename.
I just ran this .vbs, and it successfully retrieved the last renamed filename with no trouble!
On to testing...put a line in my .bat so that the section looks like this:
Code:
RenameRecordings %1 > renamerecordings.log
REM testing rename to newname section---------------------

start /min /low getnewname.vbs

REM end testing rename to newname section-------------------
Everything works!!! Big Grin

Now for the hard stuff...is it possible to get the foldername, and pass that as well, so the newly created avi will be named, "showname_episodename.avi"?
The foldername is included in the transcode_queue.txt file...
Or am I wishing on a star?

What happens if there are 5 or 6 entries in renamerecordings.log?
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (9): « Previous 1 2 3 4 5 6 … 9 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  New LG and Samsung NextPVR Web Smart TV App available for beta testing. fred250 388 140,953 2017-04-10, 10:46 AM
Last Post: fred250
  Bluray Player Beta whurlston 23 12,193 2015-10-05, 09:32 AM
Last Post: Lao Pan
  Movies beta vik 66 31,006 2015-03-31, 03:13 AM
Last Post: Lao Pan
  Need beta testers for "NextPVR for Samsung" (client for samsung smart tvs/blurays) reven 61 27,756 2013-12-03, 10:21 AM
Last Post: martint123
  imageGrabLite Beta mvallevand 84 61,954 2013-10-04, 06:40 PM
Last Post: mvallevand
  SSPlus Screensaver - Photo Slideshow Beta ACTCMS 40 14,323 2012-12-07, 01:49 AM
Last Post: ACTCMS
  New External App : Channel Logo Tools For NPVR (Beta) systemshark 0 1,701 2011-09-03, 08:15 AM
Last Post: systemshark
  SSPlus 0.9.1 BETA - a screensaver for NPVR ACTCMS 18 6,173 2011-07-18, 12:52 AM
Last Post: johnsonx42
  System Plugin for nPVR - Early Beta imilne 176 49,055 2011-07-16, 04:31 PM
Last Post: johnsonx42
  NPVR Rename Recordings Batch File raceviper13 8 8,142 2011-04-23, 11:52 PM
Last Post: raceviper13

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

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

Linear Mode
Threaded Mode