MPEG-2 Multiplexer needed

Here's my scenario:

- I have a bunch of .m2v (video) and .wav (audio) files (about 1000). I would like to put each pair together and create MPEG-2 files out of them. Is there any tool out there that does that?

- If there is such a tool, does it have a command line in which one can submit jobs to it?
alateosAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

danleinCommented:
mkvmerge works wonderfully, and has the option to show you the command line so you can edit and replace filenames at your convenience.  This is located under the "muxing" menu, and "show command line"

download it here:
http://www.bunkus.org/videotools/mkvtoolnix/downloads.html#windows
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
alateosAuthor Commented:
I already have mkvmerge... but how can i use it to make the mpeg-2 file?
0
danleinCommented:
oh.  in that case, use mkvtovob and then just rename to mpg.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

alateosAuthor Commented:
is that part of the same set of tools? if so, i'll try it tomorrow
0
danleinCommented:
nah, its mkv2vob, a completely separate install.  download link is below.  From what i remember, it basically rewrites the mkv header to make it a compatible mpg stream for applications like ps3 streaming, etc, but doesn't encode if your source is compliant.  It has an option to convert an entire directory, which should make your life easier.  Let me know how it goes.

http://www.3r1c.eu/mkv2vob/mkv2vob.exe
0
alateosAuthor Commented:
will do tx for the advice
0
alateosAuthor Commented:
it says "Unsupported video codec: MPEG2"
0
danleinCommented:
k.. let's not use that then.

can you test one one file just renaming the mkv extension to mpg.  can i ask what your main goal is?
0
alateosAuthor Commented:
My main goal is to have a bunch of video (.m2v) and audio (.wav) muxed then encoded as an AVI or MPEG-2 file.
0
danleinCommented:
ok.  i just tried this.. and it works for me.  download ffmpeg from here:

http://www.videohelp.com/download/ffmpeg-0.5.7z

extract the files, then from a command line, browse to the folder you just extracted and run the following:

ffmpeg -i c:\input.mkv -target ntsc-dvd -b 2000k c:\outfile.mpg

obviously, replace input.mkv and outfile.mpg with the correct name.
0
alateosAuthor Commented:
tx danlein.. is there any way to do TRUE constant bitrate with ffmpeg? I already tried setting the -minrate and -maxrate to the same as -b rate.... but the file still looks as a vbr file.
0
trick6612Commented:
Alateos,

If you are looking to change the bit rate, you would need to re-encode the MPEG-2 files.  This will result in a loss of image quality.  SImply muxing the MPEG-2 file with the WAV file will not result in re-encoding the MPEG-2 video.

TMPGEnc is a good tool for the kinds of things you are trying to do.

http://www.tmpgenc.net/en/index.html

Rick
0
danleinCommented:
Trick6612:

I agree TMPGEnc is a good tool, however, loading all those files into it is painstaking.  Trying to avoid it based on OP with 1000 files.  ffmpeg is a very versatile tool

alateos:

as far as i know, it is not possible for TRUE constant bitrate.  for mpeg2, this usually isnt the case, because vbr allows for smaller file size (better compression) with a comparable image quality.  If this is not acceptable, I could try to hunt down something else.
0
alateosAuthor Commented:
danlein... I would really appreciate it if you could find something that would produce files with CBR, through a command line (as ffmpeg), and in which you could encode several files at the same time.
0
trick6612Commented:
Alateos,

I am still curious about your interest in CBR...  why do you want to reduce the quality of your videos while making the file size larger at the same time?

Rick
0
alateosAuthor Commented:
Rick... I have a program that would read the file much faster if it were CBR. I could save half the time of re-encoding... hence my need for CBR.
0
danleinCommented:

You can try using mpeg2enc, but you'll have to download the source and compile it yourself.  I believe it has an option to force CBR.

you can also try out mencoder.  I have used this briefly, and does a very good job as well.
0
trick6612Commented:
Alateos,

I am still confused.  The original files are in MPEG2 format (.m2v files), right?  And the original files are VBR, right?  So you want to spend hours and hours re-encoding the files using some tool that will re-encode the VBR files into larger, lower quality CBR files, so that you use them in another program that reads CBR files faster than VBR files.  Is that right?  What does this other program do?  Is it just a video player or something?  Maybe if you can explain what you are really trying to accomplish, I can provide a better answer.

Keep in mind that the only way to change between VBR and CBR is to completely re-encode/re-render the MPEG files into new files.  Re-encoding MPEG files ALWAYS results in some loss in quality.  

Rick
0
alateosAuthor Commented:
Rick,

You have it correct. The final application is a proprietary editing software.
0
trick6612Commented:
Alateos,

OK, then you are looking to do more than just mux the MPEG files with the WAV files.  You are also looking to re-encode the files from VBR to CBR so that you can use them in some unspecified proprietary editing software that wants CBR files over VBR files.  

TMPGEnc can re-encode your files.  Other video editing applications like Sony Vegas can also do the job.  With Vegas, for example, you could combine your audio files with the video and simultaneously re-encode them in new CBR MPEG files.  With Vegas' scripting and batch processing features, I would imagine you could set up a batch process to do this for all of your 1000 individual files.

Rick
0
alateosAuthor Commented:
Rick... are TMPGEnc and Vegas considered freeware with a command line option? I'm a programmer and can streamline the process.
0
trick6612Commented:
Alateos,

No, these are both applications you are legally supposed to pay for.  I believe you could probably get away with downloading a trial version of Sony Vegas and using it to do what you want to do, as long as you can finish within the trial period.

Rick
0
danleinCommented:
alateos,

that's the best i've got for freeware command-line stuff.. rick is correct if you can go with the trial of Vegas, you can tweak out a script to bang out all your files at CBR.  Good luck and thx!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MultiMedia Applications

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.