View Full Version : How to encode many (300+) MPGs in one batch?
Markstar
11th July 2006, 07:58
Hi!
I have about 300+ MPGs here, all are pretty short (around 5 minutes) but have different sizes (in resolution and in MB) and some are even interlaced.
So what would be the best and EASIEST way to reencode those (rather oversized) files?
For a single file I would load it up in DGIndex, then go on to either NanDub or GK and adjust the remaing settings (resolution, bitrate) there. But for that many files this would take forever! :(
Isn't there an easier way to just load them up in a queue or something? I know I can do batch processing in GK but I would still have load and save every project file seperately. :confused:
Thanks in advance!
Edit: To make it easier let's assume that I have 300 non-interlaced files, all with the same resolution and length. :)
Guest
11th July 2006, 13:30
So what would be the best and EASIEST way to reencode... Please read and follow forum rules, specifically, rule 12: do not ask what's best. Thank you.
http://forum.doom9.org/forum-rules.htm
Markstar
11th July 2006, 14:30
Sorry, looks like I chose the wrong words and should have taken more time to write this (as also can be seen by the spelling mistake in the topic :o ).
Well, in my case I'm not asking for which codec to use or anything like it!
I'm only interested in possible solutions, not a discussion on which is better (I can judge that myself)!
And sorry, while it's not a good idea to ask for what is best, it is surely feasible to ask for what people consider the easiest.
Again, I'm not looking for a discussion, just some suggestions on batch-processing a lot of files. ;)
Edit: Actually, I find it very sad that a statement that, imo, was clearly not asking for a flame war about what is best still gets snapped at. Sure, especially the doom9 forum needs to watch that the members follow the rules (like not posting illegal stuff), but jump on the first siight of any kind of comparison is overdoing it a little imho. It's not like I'm posting "Dude, what's better - DivX or XviD?".
Oh well, maybe somebody will answer me anyway...
Daodan
11th July 2006, 15:17
Well, since the clips have different characterisics you would need some wonder detector plus a script to make different filtering for what it detects as interlaced, etc. I think this is rather hard if not impossible. What I suggest is to at least group them on frame size, interlaced or not, etc, and import them in a avisynth script like : clip1 = mpeg2source(xxx), clip2 = mpeg2source (xxy), etc. And than at the end unite the similar ones with group1 = alignesplice (clip1, clip4, clip167675).tdeint().denoiseme(). And at the end: allignedsplice(group1, group2, etc)
And just make sure that every group ends up with the same frame size and frame rate, and this you should be able to encode as one file...or you want them separately? In that case I think I'm offtopic.
Markstar
11th July 2006, 15:32
Thanks for replying, Daodan.
Yes, indeed, I wanted to keep them seperately. And yes, I already thought about making at least 2 seperate groups - one interlaced one non-interlaced, which should not be too much of an effort.
The thing is that my destination size can always be the same, as well as the resolution (I guess I would have small AR errors but that wouldn't be much of a problem). So basically I can set all files to the same settings, all I need is a way to encode them one after another without the need to load up each file seperately in DGIndex and GK. Especially DGIndex would take forever when doing it one by one.
I will edit the first post to clarify what I mean...:D
Edit: I have also edited the topic and hope I made myself clear now. :o
check
11th July 2006, 16:57
you could run them through a tool such as MeGUI. with a simple avs script you would need to change only the input line for every file (assuming an interlaced and non-interlaced group). Once you've done this, setup your video and audio encoding parameters in MeGUI, load the avs, click 'enqueue' and move onto the next one. I did this for 70 odd music videos which took me probably 3hrs work.
CWR03
11th July 2006, 17:19
And sorry, while it's not a good idea to ask for what is best, it is surely feasible to ask for what people consider the easiest.
The spirit of rule 12, "do not ask what's best," is to minimize the type of answer that can be one-sided or subjective. That would include asking "what's EASIEST," as the answer to that question would also be subjective. Instead, you could ask for different ways to perform the task at hand - that way any answer you get, as long as it works, will be correct and won't spark any controversy. You could also ask "which do you prefer out of this group of methods" once you have a viable list, as that particular subjective question can't be met with debate.
Markstar
11th July 2006, 18:34
Thanks check,
*looking at your MeGUI link* ... *looking at AviSynth tutorial*...
Hmm, learning how to set up the right AviSynth-script and manually creating/editing over 300 files seems a bit too much. Isn't there an another way???
@CWR03: I get your point but still think that the question what is the easiest is not really subjective. Right now there is 'only' check's solution (thanks again) and if there were somebody with a way where I only need to press and "Add"-button and then select the files, bitrate and resolution, this would be an easier way, no matter how you look at it. The only subjective part is if you are familiar with a particular program, but then again this still won't affect the overall time-complexity (for # movies -> infinity).
ammck55
11th July 2006, 22:31
Markstar--You obviously feel you've been mistreated, but after you've been around the Forum awhile, you'll find that almost everybody that asks for the "best", or "easiest" solution gets pointed to the rules. You're a sharp guy, and obviously, if you'd read the rules in the first place, you wouldn't have put yourself in this position. Shake it off and have some fun, this is a great place to learn, and hopefully, come back to and share your knowledge. This is the Newbies Forum, after all. :)
ammck55
Markstar
11th July 2006, 23:14
It's just that the description of my problem seems overly compicated when I'm not using the easiest term (no pun intended).
Sure, I could also describe my problem as:
"How do I encode 300 (or n > 300) MPG-files with the least number of mouse-clicks?"
But then one might get the impression that I want to write a science paper out of this. :o
Yes, I'm over it, but still afraid nobody else (other than check) will actually answer to my problem. Hmm, maybe I should register under a new name and post in a different section? :sly: Otoh, having just registered then I would probably be referred to the Newbies again... :p
Anyway, I hope somebody who is reading this get's beyond the rules argument and has a solution to my little problem. :(
smok3
11th July 2006, 23:23
To make it easier let's assume that I have 300 non-interlaced files, all with the same resolution and length.
virtualdubmod -> video/filters/'add some' -> press f4, then edit/processdir
(well, that should be enough info to make you dangerous.)
BigDid
11th July 2006, 23:47
...Sure, I could also describe my problem as:
"How do I encode 300 (or n > 300) MPG-files with the least number of mouse-clicks?"...:(
Hi,
AutoGK? has batch, once settings done can be re-used, Gui with a few mouse clicks.
Divx or xvid restricted, some possible audio synchs with new DVD protections (should not be your concern)
What else? no Avisynth filtering with base version but can be done with the AGK-Pal or AGK-Tweaker addition.
Key words: easiest and "few mouse clicks" :)
Did
ilovejedd
12th July 2006, 00:22
I use 2xExplorer (http://netez.com/2xExplorer/) as my main file manager instead of Windows Explorer. Aside from 2-pane management, it also has the nifty ability to create a batch file based on selected files (select files then CTRL+B). For example, I can use the following template to convert ffmpeg supported files to NTSC VCD standard compliant mpg files.
ffmpeg -y -i "$N" -target vcd "$B.mpg"
Say I have the following files selected:
Veronica Mars s1e01.avi
Veronica Mars s1e02.avi
Veronica Mars s1e03.avi
Veronica Mars s1e04.avi
Veronica Mars s1e05.avi
Veronica Mars s1e06.avi
Veronica Mars s1e07.avi
2xExplorer will give me this batch file which I can save, edit, and/or execute:
ffmpeg -y -i "Veronica Mars s1e01.avi" -target vcd "Veronica Mars s1e01.mpg"
ffmpeg -y -i "Veronica Mars s1e02.avi" -target vcd "Veronica Mars s1e02.mpg"
ffmpeg -y -i "Veronica Mars s1e03.avi" -target vcd "Veronica Mars s1e03.mpg"
ffmpeg -y -i "Veronica Mars s1e04.avi" -target vcd "Veronica Mars s1e04.mpg"
ffmpeg -y -i "Veronica Mars s1e05.avi" -target vcd "Veronica Mars s1e05.mpg"
ffmpeg -y -i "Veronica Mars s1e06.avi" -target vcd "Veronica Mars s1e06.mpg"
ffmpeg -y -i "Veronica Mars s1e07.avi" -target vcd "Veronica Mars s1e07.mpg"
ammck55
12th July 2006, 04:04
Anyway, I hope somebody who is reading this get's beyond the rules argument...
There's no argument, here. You broke a rule and it was pointed out. I just checked and since you've not been struck, you really don't have a beef, so let this part of the discussion end, now. I hope you get your solution, but stop sniping on the rules.
Guest
12th July 2006, 04:30
Edit: Actually, I find it very sad that a statement that, imo, was clearly not asking for a flame war about what is best still gets snapped at. Sure, especially the doom9 forum needs to watch that the members follow the rules (like not posting illegal stuff), but jump on the first siight of any kind of comparison is overdoing it a little imho. It's not like I'm posting "Dude, what's better - DivX or XviD?". Striked for rule 3. I'm stricter than ammck55. :)
I said "please" and "thank you" in my first post, and I did not strike you for your post. That is hardly "snapping at". Also, my post is a copy-and-paste that I use for ALL posts asking for "best" anything that I happen upon. Most people take it in stride, realizing that our rule set is a major factor in making Doom9 the quality place that it is.
Please take further discussion to PM or appeal your strike through the normal channels. Thank you.
Hmm, maybe I should register under a new name and post in a different section? I wouldn't do that if I were you. See rule 14.
Markstar
12th July 2006, 08:50
The comment about re-registering was meant as a joke! Sorry, I probably should have pointed that out. Also, I apologize that I broke the rules and I'm sorry if I offended someone. :( I will try to be even more careful in the future. :o
virtualdubmod -> video/filters/'add some' -> press f4, then edit/processdir
(well, that should be enough info to make you dangerous.)Thanks smok3, but sorry, I don't quite understand what you mean. :o Yes, I'm familiar with VirtualDubMod (I've used the Job Control many times before), but if I press F4 after adding the filters, all I get is the empty Job Control Window. Of course I could save the the file first (F7) in batch mode, but this would mean I would have to manually -acodec mp3 -ab 64-acodec mp3 -ab 64load and save every single file. :( What do you mean by "edit/processdir"???
@ilovejedd: Wow, ffmpeg looks like a powerful program and might be a feasible solution! :cool:
It looks like it is possible to process audio as well so maybe I can even demux the audio streams (*.mpa), compress them, and then join both files at the end. All I need now is the correct command line syntax to make it work. I think I have found the appropriate commands for the video enoding
ffmpeg -i example.mpg -s cif -b 800 (-deinterlace) test.avi
there is also the command "-vcodec", for example "-vcodec mpeg4" (this means encoding to DivX, right. So what would be the right option to encode to the actual MPEG-4?)?
and audio encoding (the extracted audio file)
ffmpeg -i test.mpa -acodec mp3 -ab 64 test.mp3 -map 0:0I don't know what the "-map 0:0" is for (it's from the example on the FFmpeg webpage). Isn't mapping = assigning the order of the streams. Why do I need to map anything in a audio file?
So would this work:
ffmpeg -i example.mpg -s cif -b 800 (-deinterlace) -acodec mp3 -ab 64 test.avi ??? (can't try it out until tonight :( ). Anyways, if I'm on the right track I guess I could figure out the details later or ask again in the appropriate category ("DivX Encoding"?).
Thanks a lot so far!
smok3
12th July 2006, 12:14
http://somestuff.org/proc_dir.png
Markstar
12th July 2006, 14:26
:eek: - You know, in the many years I've been using VirtualDub/NanDub/VirtualDubMod, I've never noticed that there is a menu up there!!! :o All I ever used in the Job Control window were the buttons on the right. :rolleyes:
Thank you! That might do the trick as well - I think I'm going to try out both solutions though as I might even get a 75% smaller audio stream with FFmpeg. :cool:
@ilovejedd: If I read the FFmpeg documentatoin correctly there isn't even a need to create a batch file because FFmpeg supports using placeholders:
ffmpeg -i /tmp/test%d.Y /tmp/out.mpg Or is that only in Linux? :scared: Then of course I would create that file - it's not a lot of work after all. ;)
smok3
12th July 2006, 14:54
hehe, yeah, took me a while to find that thing as well.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.