View Full Version : Script that will open avi files with nandub and then re-save them in another folder?
iparout
14th March 2008, 04:00
Hi.
A few weeks ago, my HDD crushed, however I was able to recover most of my files with Easy Recovery Pro. Problem is that the recovered avis are much longer in size than they should (i.e. 900 MB for an avi that is actually 340 MB)
I have found out that when opening the big recovered avi files with Nandub and saving them without any editing (using Direct Stream Copy), the output file has the correct size.
That's why I would like to know if there is an avisynth script that will do that for me for all the avis automatically (import 1st avi in Nandub, save it using Direct Stream Copy, import the 2nd avi file e.t.c.), because the avis are way too many for me to manually use Nandub.
Thanks in advance for any help.
Terka
14th March 2008, 09:22
try autohotkey
iparout
14th March 2008, 11:18
try autohotkey
I downloaded the program but it seems like way to complicated for me. I can't understand how to properly script what I want (I have ZERO programming knowledge)
Perhaps someone could give me an idea of what the script should look like ?
Thanks !
J_Darnley
14th March 2008, 11:41
This doesn't sound like something that AviSynth can do. It doesn't control what program opens it, it can't specify what file to save it's output to and it is just the wrong tool for the job.
It sounds like you want something along the lines of a batch script like the following:
FOR %A IN (*.avi) DO <command to open "%~A" and save to "D:\Fixed Videos\%~nA">
The question you really need to ask is "What is the command to get nandub to open a video and then save it using direct stream copy to another file?" You should also describe your problem again if do ask this question.
iparout
14th March 2008, 11:52
This doesn't sound like something that AviSynth can do. It doesn't control what program opens it, it can't specify what file to save it's output to and it is just the wrong tool for the job.
It sounds like you want something along the lines of a batch script like the following:
FOR %A IN (*.avi) DO <command to open "%~A" and save to "D:\Fixed Videos\%~nA">
The question you really need to ask is "What is the command to get nandub to open a video and then save it using direct stream copy to another file?" You should also describe your problem again if do ask this question.
Thank you for your input. Perhaps someone else could help with the automation of Nandub.
Just a question though, so as to start learning some basic things : In the batch you posted, what does every parameter do ? Do I have to manually type it for every .avi I want fixed ? (I'm noob as you understand)
Zarxrax
14th March 2008, 12:26
Just use nandub's job control, under File>Job Control.
First load 1 file in and set it to direct stream copy and all, just how you want it. Then go in the job control, and choose edit>process directory.
iparout
14th March 2008, 12:33
Just use nandub's job control, under File>Job Control.
First load 1 file in and set it to direct stream copy and all, just how you want it. Then go in the job control, and choose edit>process directory.
If this works, you saved my day. Thanks a lot in advance.
J_Darnley
14th March 2008, 21:45
Just a question though, so as to start learning some basic things : In the batch you posted, what does every parameter do ? Do I have to manually type it for every .avi I want fixed ? (I'm noob as you understand)
If you still want to know, no you only have to run this once for every directory. It will look for avi files and then do the entered command for each one found. I guess you could say it translates to "for every avi in the current folder, and every sub-folder, do 'this'".
setarip_old
14th March 2008, 21:49
@iparout
Hi!
Just a quick note to let you know that you aren't limited to NanDub. You can accomplish the same thing using the standard VirtualDub to simply resave the files...
iparout
15th March 2008, 15:26
thanks all. I'll try what was suggested.
iparout
16th March 2008, 08:51
Err, I did what was suggested, however there's no Process Directory command in the jon control of VirtualDubMod 1.5.10.2 or Nandub 1.0 rc2 !
Any thoughts ?
45tripp
16th March 2008, 10:52
Err, I did what was suggested, however there's no Process Directory command in the jon control of VirtualDubMod 1.5.10.2 or Nandub 1.0 rc2 !
Any thoughts ?
First load 1 file in and set it to direct stream copy and all, just how you want it. Then go in the job control, and choose edit>process directory.
http://img523.imageshack.us/img523/8936/80686076wb5.png
iparout
16th March 2008, 21:36
Thank you very much, it worked !
Any way/program to do the same thing for asf and mpg files ?
45tripp
17th March 2008, 02:46
do what exactly?
iparout
17th March 2008, 11:31
do what exactly?
Open and resave them. asf and mpg files also appear much bigger in size after being recovered and by opening and resave them, the size is fixed. I managed to do it with asf tools, but it can't be done for many files simultaneously.
45tripp
18th March 2008, 02:59
look to cli tools.
run them in batch.
for wmv, try asfbin
for mpg,
either mencoder or ffmpeg.
iparout
18th March 2008, 12:08
look to cli tools.
run them in batch.
for wmv, try asfbin
for mpg,
either mencoder or ffmpeg.
I tried asfbin and it works ! the command for one file is
asfbin -i C:\RESTORE\DIR26\broken.avi -o C:\C:\RESTORE\repaired.avi
However, I can't seem to be able to make a command to process all files in a folder automatically. After reading through this thread, I tried
FOR %A IN C:\RESTORE\DIR26 do asfbin -i C:\RESTORE\DIR26\%A -o C:\C:\RESTORE\%nA
but it didn't work.
What's the correct command please ? (my scripting skills are below zero, as you understand)
45tripp
18th March 2008, 19:23
FOR %%A IN ("C:\RESTORE\DIR26\*.wmv") do asfbin -i "%%A" -o "C:\RESTORE\%%~nA.wmv"
assuming mpeg2
FOR %%A in ("C:\RESTORE\DIR26\*.mpg") do mencoder "%%A" -ovc copy -oac copy
-of mpeg -mpegopts format=mpeg2:tsaf:muxrate=9000 -o "C:\RESTORE\%%~nA.mpg"
iparout
19th March 2008, 02:30
FOR %%A IN ("C:\RESTORE\DIR26\*.wmv") do asfbin -i "%%A" -o "C:\RESTORE\%%~nA.wmv"
assuming mpeg2
FOR %%A in ("C:\RESTORE\DIR26\*.mpg") do mencoder "%%A" -ovc copy -oac copy
-of mpeg -mpegopts format=mpeg2:tsaf:muxrate=9000 -o "C:\RESTORE\%%~nA.mpg"
You saved my life ! If you ever come to Greece, I owe you a beer.
Thanks a lot !
iparout
20th March 2008, 12:54
FOR %%A IN ("C:\RESTORE\DIR26\*.wmv") do asfbin -i "%%A" -o "C:\RESTORE\%%~nA.wmv"
assuming mpeg2
FOR %%A in ("C:\RESTORE\DIR26\*.mpg") do mencoder "%%A" -ovc copy -oac copy
-of mpeg -mpegopts format=mpeg2:tsaf:muxrate=9000 -o "C:\RESTORE\%%~nA.mpg"
Asf worked like a charm, however, for mpeg, what if I don't remember if the stream is mpeg2 or any other (there are tons of mpg files I have, some mpeg1, some others mpeg2) ? What should I type ?
45tripp
20th March 2008, 16:21
probably looks ugly, not done this before,
but should work:
get mediainfo cli from here
http://sourceforge.net/project/showfiles.php?group_id=86862&package_id=90612
For %%A in ("C:\RESTORE\DIR26\*.mpg") do mediainfo "%%A" | find "MPEG-2" > nul & if errorlevel 1 ^
mencoder "%%A" -ovc copy -oac copy -of mpeg -mpegopts format=mpeg1 -o "C:\RESTORE\%%~nA.mpg"
For %%A in ("C:\RESTORE\DIR26\*.mpg") do mediainfo "%%A" | find "MPEG-2" > nul & if not errorlevel 1 ^
mencoder "%%A" -ovc copy -oac copy -of mpeg -mpegopts format=mpeg2:tsaf:muxrate=9000 -o "C:\RESTORE\%%~nA.mpg"
You saved my life ! If you ever come to Greece, I owe you a beer.
if you're close to Salonika, i might collect.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.