Link to home
Start Free TrialLog in
Avatar of alateos
alateos

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of danlein
danlein
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alateos
alateos

ASKER

I already have mkvmerge... but how can i use it to make the mpeg-2 file?
oh.  in that case, use mkvtovob and then just rename to mpg.
Avatar of alateos

ASKER

is that part of the same set of tools? if so, i'll try it tomorrow
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
Avatar of alateos

ASKER

will do tx for the advice
Avatar of alateos

ASKER

it says "Unsupported video codec: MPEG2"
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?
Avatar of alateos

ASKER

My main goal is to have a bunch of video (.m2v) and audio (.wav) muxed then encoded as an AVI or MPEG-2 file.
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.
Avatar of alateos

ASKER

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.
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
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.
Avatar of alateos

ASKER

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.
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
Avatar of alateos

ASKER

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.

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.
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
Avatar of alateos

ASKER

Rick,

You have it correct. The final application is a proprietary editing software.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alateos

ASKER

Rick... are TMPGEnc and Vegas considered freeware with a command line option? I'm a programmer and can streamline the process.
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
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!