I've got several hundred 1080p60 H264 video files with .MTS file extension. Since it doesn't seem as though they will be playable under any normal circumstance, I am going to be forced to re-encode each one of them as something less demanding to play, and then replace them one by one in Premiere Pro after all the editing is done.
What I don't relish is the workflow as I envision it, which goes something like this:
1) For each of the 300+ individual files, create individual .AVS files.
2) In each of these 300+ .AVS files, specify a particular filename like so:
3) Load each of these 300+ unique .AVS files into VirtualDub, one by one, and queue a batch operation to encode as something else.Code:directshowsource("file.mts")
Now, this is just silly. There has to be a better way. Were VirtualDub able to load the .MTS files natively, that would cut the workload by about 60% right there. Or perhaps there is something which could be done on Avisynth's end to reduce the need for 300 different .AVS files with different text in each one of them. I don't know. That's why this is a newbie question. ;p
+ Reply to Thread
Results 1 to 9 of 9
Try putting this batch file in your SendTo folder. Then you can right click on any file and select SendTo -> Recode.bat. It will use x264 to renencode to an MKV file with half the dimensions (1920x1080 -> 960x540). Of course, you can change the batch file to match your needs. Maybe use SelectEven() instead of resizing. Or make an MP4 instead of MKV.
Originally Posted by Recode.bat
You can also call this from another batch file. Say, to process every file in a folder.
Oh, you'll probably also want to mux in the original the audio. You can use MkvMerge for that. If you start MMG and setup a mux you can use the Copy to Clipboard function to see the command line parameters to be used.
Last edited by jagabo; 9th May 2011 at 22:04.
I love Avisynth, but I use it because I can use it to edit, filter and transform the file in various ways by script.
If you're just doing a format conversion, use something like XMediaRecode and make a profile for what you want to get. Then you can do them all in a batch.
If you're a hardcore scripter, use ffmpeg command line. It can convert anything to anything in one line.
Avisynth all day. It's failing to properly handle the AC3 5.1 audio which these videos contain. Said audio plays back properly when viewing the original videos in a media player, so it's definitely there. But after it passes through Avisynth, it turns into six channels of complete silence (confirmed with Adobe Audition). Unfortunately, your script doesn't force Avisynth to play any nicer.
It's starting to look like my best bet will be to find a way to losslessly merge all of the hundreds of clips into one big file. At this point, I will take it. Heck, it may ultimately make things easier. They're H264+AC3 1080p60 MTS files at 28Mbps. I am aware of at least one pay solution. But I figure it's such an uncomplicated task that somebody probably already slapped it together for free in a lazy afternoon.
Post one of your videos here (if small enough) or on a filesharing site so we know what we're talking about.
There are other ways of loading AC3 into Avisynth than DirectShowSource for one thing.
Or if you can play the audio as-is, just extract and mux it with the new video.
for %%a in ("*.avi") do recode "%%a"
Or, as AlanHK suggests, you can use ffmpeg after working out the necessary command line.
for %%a in ("*.avi") do ffmpeg "%%a" yada yada yada
Are these from PannyTM-700 ? 1080p60 ?
Why are you using avisynth? are you using other filters ?
Might be easier to use ffmpeg and just copy the audio
mpeg2 i-frame is very easy resource wise (smooth to edit)
1280x720p60 I-frame mpeg2 might be a good proxy. Go smaller resolution if you want , just change the -s parameter. Use lower qscale to get higher bitrates, higher qscale to get lower bitrates. 5-7 might be a good starting point
1) place copy of ffmpeg in same folder as files to convert
2) write the following in notepad, save it, change extension from .txt to .bat
for %%a in ("*.m2ts") do ffmpeg -i %%a -vcodec mpeg2video -s 1280x720 -qscale 5 -intra -acodec copy -f mpegts %%~na.new.m2ts
This will append "new" to the output proxy files. Use a batch renamer when relinking the real files in premiere, or batch rename the proxies and keep the "master" separate from the "proxy" in separate folders (if they have the same name and extension, you just have to pick the 1st one and all of them will be automatically swapped when relinking the files)
Last edited by poisondeathray; 10th May 2011 at 00:30.
Avisynth because Virtualdub couldn't load the files natively. I did use a bicubicresize, but I also tried it without the filter. As far as I could tell, Avisynth was simply not handling the audio correctly. I was aware of a version of Avisynth 2.5 with a direct stream copy feature, but I really, really did not want to juggle more versions of Avisynth after all the headaches which ensued during my attempts to get multithreading working, and my subsequent triumph in returning to a stable, functional install.
All that remains is to confirm within Premiere Pro that both the original and the post-ffmpeg versions of the videos share the same luma values (for the most part) and total frames (because, in my experience at least, interframe video is dodgy in this regard, and converting one to another only enhances this concern).