Alt.Binz forum
Alt.Binz (English) => Help => Topic started by: musictrivianut on July 11, 2010, 02:15:04 am
-
Well, I ran a few searches (mkv, m2ts and convert) and didn't find anything, so here's hoping that someone out there might be able to help me out or point me in the right direction.
First, I will note that I am not having any problems with altbinz. It's a fantastic program. I just want to know if I can make it do what I want it to do.
Without going into specifics, what I would like is for the batch file executed after a download is finished to convert a file from mkv to m2ts. I already use the batch file to clean up the download directory (thanks to those that posted about how to do that). However, after downloading some mkv files and then discovering that they do not play natively when served to my PS3, but m2ts files are, I have been converting them one at a time using tsMuxeR. I figure, altbinz is already downloading the file, why not see if it can do the conversion also. Unfortunately, I know extremely little about batch programming and even less about how tsMuxeR does what it does.
Has anybody else out there figured out how to do this and can show me? Thanks.
-
a direct file conversion via batchfile will not be possible, the only outside chance u might have is using a batchfile to transfer the corect file automaticaly to a third party for processing.
-
Transfer the file to a third party? You mean somehow get altbinz to pass the name of the file that it just unrared to another program that will write the meta file and then run tsMuxeR?
I wish I new more programming.
<sigh> If I'm stuck doing things the hard way, that's fine and it's certainly not the fault of altbinz or the creator. I'll live ;D
Thanks.
-
not excatly. i was thinking it might be possible to use a batch script to pass the name (via $col if collection name=filename) and auto start tsmuxer or a simular software to do the conversion...
-
Yeah, that's the kind of thing I was looking for; a line or so in the batch file to tell tsMuxeR what it needs to know to mux the file to m2ts format.
-
The translation of the tsMuxeR readme file that explains commandline usage is here:
http://forum.doom9.org/archive/index.php/t-134104.html
This is somewhat outside the scope of this forum, maybe you'll have better luck getting some answers with:
http://www.google.com/search?q=tsMuxeR+commandline
-
Thank you very much. I will start there (the Russian readme wasn't doing me much good). Greatly appreciated.
-
Am still hoping that someone can help me figure out how to do this with a batch file, if possible. After reading the link given to the Execute Command and some other sites on scripting, I think I have a basic outline for what needs to happen, but for some reason, it looks like altbinz may not be passing variables correctly (or I'm not writing it correctly).
Following the instructions for Execute Command, my Default execute command (NZB #2) is "C:\Program Files (x86)\AltBinz\cleanup.bat" "$d $col".
The cleanup.bat file currently contains:
@echo off
del c:\temp\*.nfo
del c:\temp\*.srr
del c:\temp\*.srs
rem trying to convert downloaded files from mkv to m2ts using tsmuxer.exe
rem set variables
set dldir=%1
set colname=%2
set metafile=%dldir%\%colname%.meta
rem echo text >> %metafile% should write text to meta file
echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --vbv-len=500 >> %metafile%
echo V_MPEG4/ISO/AVC, "%dldir%\%colname%", fps=23.976, insertSEI, contSPS, track=1, lang=eng >> %metafile%
echo A_AC3, "%dldir%\%colname%", track=2, lang=und >> %metafile%
However, the .meta file ends up in the root directory, not in the download directory and the text written to the file is "\" with no directory or file information. Does that mean that the variables are empty?
Any ideas on what is going on? What am I doing wrong? Is there any additional information that I can give to help?
I figure, once I can get it to write the meta file correctly, it should be easy to call txmuxer with the correct parameters, have it do the conversion and then delete the original file.
Thanks.
-
Do the directory names have spaces in them? In which case try adding extra single quotation marks, e.g. "'$d' $col". And then double quotation marks e.g. here:
set metafile="%dldir%\%colname%.meta"
Deciding where the quotation marks go is a fiddly thing about batch scripting that's best to test outside of Alt.Binz first. Test with lines like:
if exist %metafile% echo Yes it exists!
-
Well, there are no spaces in the directory; everything goes right into c:\temp. I have tried all kinds of combinations for the Default Execute Command:
"C:\Program Files (x86)\AltBinz\cleanup.bat" $d $col
"C:\Program Files (x86)\AltBinz\cleanup.bat" "$d $col"
"C:\Program Files (x86)\AltBinz\cleanup.bat" "'$d' '$col'"
"C:\Program Files (x86)\AltBinz\cleanup.bat" "$d" "$col"
and they all produce the same result from the following code:
:set_logfile
set logfile=C:\temp\dldlog.txt
if not exist %logfile% echo Alt.binz Download Log >> %logfile%
:set_variables
set dldir=%1
set colname=%2
echo download directory is %dldir% >> %logfile%
echo collection name is %colname% >> %logfile%
Alt.binz Download Log
download directory is
collection name is
Just blanks, both of them. Again, if I can figure out what I'm doing wrong with passing the variables, I might be able to do what I want with the batch file and automating the conversion.
Thanks for all the help so far. I'll get it someday.
-
Hmm, odd. The only thing I can propose next is to try $d and $col on their own to see which might be causing a prob. Certainly the logging script you're using there does work.
Or maybe the Kraken can be summoned to explain exactly how these parameters are passed to cmd.exe by Alt.Binz ...
*Hecks starts the drumming*
-
I tried all the same things with the quotes using just $col with the same results, an empty variable. I really appreciate all the effort that you guys are putting into this for me. Maybe once we figure it out, I'll have something I can submit to the Code thread for everybody else that might be interested in the same thing.
-
Okay, I still have no clue why the program isn't passing variables the way that it's supposed to. I know that the Wiki (https://www.altbinz.net/wiki/Execute_Command_on_Completion (https://www.altbinz.net/wiki/Execute_Command_on_Completion)) shows that the format is supposed to be
c:\util\MyCleanupRoutine.exe "-a $d"
c:\util\CleanupAfterUnrar.bat "$d $u"
with quotes around the parameters, but not the command. But there is another thread (https://www.altbinz.net/forum/index.php?topic=3354.msg14064#msg14064 (https://www.altbinz.net/forum/index.php?topic=3354.msg14064#msg14064)) where someone else seemed to have difficulty with variables also and he posted that
"C:\My Stuff\Alt.BinZ 0.31.2 binary news reader\logdownloads.bat" $d $u
worked for him. Quotes around the batch file command, but not the parameters being passed, opposite of what is shown in the Wiki. As I mentioned, I've tried all different variations with zero results. However, I noted that the other user was on WinXP. I am using Win7, 64-bit Edition. That wouldn't have anything to do with it, would it? I mean, is there any difference in the way the two different OSes handle executing commands?
I'm just throwing things out there. Further thoughts?
-
I already use the batch file to clean up the download directory (thanks to those that posted about how to do that).
But it's working in this case?
-
Yes, it does everything else just fine, the only thing it doesn't like is the variable.
And I am using the most current version, 0.31.6, in case I hadn't mentioned it yet.
When the batch file runs, the command window just flashes by. Is there a way to prevent it from disappearing, so I can see if there is an error or something? I checked the properties for the file, but didn't see anything.
-
Yes, it does everything else just fine, the only thing it doesn't like is the variable.
So ... it doesn't like the $col variable, but $d is OK on its own when you run the cleanup script?
-
Well, there are no spaces in the directory; everything goes right into c:\temp. I have tried all kinds of combinations for the Default Execute Command:
"C:\Program Files (x86)\AltBinz\cleanup.bat" $d $col
"C:\Program Files (x86)\AltBinz\cleanup.bat" "$d $col"
"C:\Program Files (x86)\AltBinz\cleanup.bat" "'$d' '$col'"
"C:\Program Files (x86)\AltBinz\cleanup.bat" "$d" "$col"
and they all produce the same result from the following code:
:set_logfile
set logfile=C:\temp\dldlog.txt
if not exist %logfile% echo Alt.binz Download Log >> %logfile%
:set_variables
set dldir=%1
set colname=%2
echo download directory is %dldir% >> %logfile%
echo collection name is %colname% >> %logfile%
Alt.binz Download Log
download directory is
collection name is
Just blanks, both of them. Again, if I can figure out what I'm doing wrong with passing the variables, I might be able to do what I want with the batch file and automating the conversion.
Thanks for all the help so far. I'll get it someday.
Could you move cleanup.bat to lets say c:\cleanup.bat nad modify execute command.
Here, this is result of your bat file:
Alt.binz Download Log
download directory is c:\download\stinky_ranks-we_nuh_badda-(promo_cds)-2010-yvp_int
collection name is Stinky_Ranks-We_Nuh_Badda-(Promo_CDS)-2010-YVP_INT
download directory is "c:\download\1 2 3stinky_ranks-we_nuh_badda-(promo_cds)-2010-yvp_int"
collection name is "1 2 3Stinky_Ranks-We_Nuh_Badda-(Promo_CDS)-2010-YVP_INT"
First one is: "C:\Alt.Binz\cleanup.bat" $d $col
Second one is: "C:\Alt.Binz\cleanup.bat" "$d" "$col"
So it works just fine.
-
Well, the latest weirdness is that, after moving the batch file to the root directory, it won't even run. And altbinz didn't like passing either variable by itself, $d or $col. This is all very strange. It's great that the file I have works for someone, I just wish it worked for me. Would a fresh install help maybe? Would I lose my queue and preferences if I did that?
And yet again, I really appreciate the time and effort you guys are putting in to helping out one lone guy out there. It's pretty cool.
-
Okay, so I tried a fresh install, after saving my queue and RSS filters. Having the batch file in the alt.binz directory (which I put in the root directory this time) did not work, but it does seem to work if it is in the root directory. Weird.
So, I have altbinz passing at least the collection name correctly now, so the next step is to work out the kinks in getting it to start the muxing program. I'll have to finish tackling that tomorrow. I'll let you know how it goes.
Thanks again for all the tips and ideas.
-
Ussual UAC sh*t