PDA

View Full Version : Muxing m2v and wav?


bassgoonist
20th November 2009, 09:40
I have a 1920x1080 m2v that I want to mux with a 44.1/16 wav, how would I go about doing that?

MrC
20th November 2009, 14:17
You can use ffmpeg

ffmpeg.exe -i video.m2v -vcodec copy -i audio.wav -acodec copy muxfile.mpg

;)

Bye

bassgoonist
20th November 2009, 16:08
I get this error a bunch of times:
[mpeg @ 0x625030]buffer underflow i=1 bufi=3534 size=4096
[mpeg @ 0x625030]packet too large, ignoring buffer limits to mux it

Let me explain the whole thing here. I started by trying to make a simple slide show of jpegs for a wav file in premiere but all it would do when I did export media is give me the audio and the video separately. If anyone knows how to make premiere work right...let me know.

Ghitulescu
23rd November 2009, 10:10
Premiere (even the "light" Elements) is an overkill for doing this job, and depending on your pictures it might not even be the best to do this kind of job.

I'm sure that in the printed manual that comes with every legal copy this issue is mentioned. I have an old version so it might be of no help for the new ones. Mine is in Export submenu. Which version do you have?

bassgoonist
23rd November 2009, 22:23
I got it through the school, and I didn't get a manual, and I had made this work once before so i dunno...I was just getting really frustrated trying to read the help. I have CS4.

Blue_MiSfit
26th November 2009, 03:34
Try IFOEdit's "Author new DVD" mode. It's very easy, and simple :)

~MiSfit

Ghitulescu
26th November 2009, 13:23
I think 44k1 is out of specs if you indend to use it for anything else than a PC. You may need to convert it to 48k for standalones (use SSRC, sox, audition or [almost] any commercial audio editor).

manolito
28th November 2009, 19:50
I get this error a bunch of times:
[mpeg @ 0x625030]buffer underflow i=1 bufi=3534 size=4096
[mpeg @ 0x625030]packet too large, ignoring buffer limits to mux it

I got the same error using ffmpeg with the command line provided by MrC. My source was a 720x480 m2v and a 16/48 wav file. Resulting mpg file totally unusable.

After a lot of testing I found that mencoder would mux my elementary streams just fine. I used this command:
mencoder -oac copy -ovc copy -of mpeg -mpegopts format=dvd:tsaf -o output.mpg input.m2v input.wav

For non-DVD compliant output you should probably delete the -mpegopts format=dvd:tsaf parameter from the command line.

Additional finding: With this command even a raw PCM audio file will be muxed correctly without the need to convert it to WAV first.

Cheers
manolito

netmask
29th November 2009, 06:30
The demo of Womble will do it. You might have to rename the M2V to MPV.

MrC
1st December 2009, 13:57
@manolito

if the streams are dvd compliant then the ffmpeg command line should be:

ffmpeg.exe -i video.m2v -vcodec copy -i audio.wav -acodec copy -f vob muxfile.mpg

There is also Imago-MPEG Muxer that has a GUI.

;)

Bye

Ghitulescu
1st December 2009, 14:11
How can a 1920x1080 stream be DVD compliant?

manolito
1st December 2009, 21:56
@manolito

if the streams are dvd compliant then the ffmpeg command line should be:

ffmpeg.exe -i video.m2v -vcodec copy -i audio.wav -acodec copy -f vob muxfile.mpg

There is also Imago-MPEG Muxer that has a GUI.

;)

Bye
Sorry, no success. The -f vob parameter makes no difference, I get the same errors.
[vob @ 0x2150810]buffer underflow i=1 bufi=3698 size=4096
[vob @ 0x2150810]buffer underflow i=1 bufi=3645 size=4096
[vob @ 0x2150810]packet too large, ignoring buffer limits to mux it
I am using the following version of ffmpeg:
FFmpeg version SVN-r18709, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming
w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e
nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl
e-libfaac --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheo
ra --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid -
-enable-libschroedinger --enable-libx264
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.27. 0 / 52.27. 0
libavformat 52.32. 0 / 52.32. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on Apr 28 2009 04:04:42, gcc: 4.2.4This is the version which comes with the latest WinFF 1.1.

And the Imago muxer (just like mplex) does not accept WAV files for audio.

Cheers
manolito

MrC
3rd December 2009, 14:08
@manolito

Yes you are right, even with a more recent build (r19159), output mpeg file has audio with a wrong samplerate and playback is completely messed up.

We could have found a mpeg2 muxing releated bug in FFmpeg, but only with WAV format. I will report it to the developers team.

Quite interesting that using matroska container (-f matroska), output file playback is fine.

:)

Bye

manolito
2nd March 2011, 21:15
Hard to believe that this thread is already more than one year old...:eek:

Recently I needed to do just that (muxing m2v and wav), and this time I decided to tackle this issue once and for all (using only free or low cost software).


Results first. Here is what works:
Womble MPEG Video Wizard DVD, Mplex, MuxMan, MPEG StreamClip, and to some degree also VOB2MPG.

Stuff which does not work:
Imago (as expected),
FFMPEG, MenCoder, TMPGEnc Plus, IfoEdit and Rejig.


Here come the details:

FFMPEG:
See previous posts. Always buffer problems, I tried at least 4 different versions, modified the command line, no luck.

MenCoder:
The command line from my previous post seems to work at first glance. But the resulting file only plays in MPC(HC), other players (WMP, VLC) have no audio. MediaInfo does not detect any audio stream in the file.

TMPGEnc:
Contrary to what was mentioned in some previous posts TMPGEnc does NOT support WAV audio.

IfoEdit and Rejig:
The authoring part of these two apps seem to be based on the same code, the results are identical. Both cannot create a muxed MPG file, they create a DVD structure in one step. Playing this DVD structure in any software player results in just very loud audio noise.

______________________________________________________________


Mplex:
Mplex cannot directly mux WAV files, they must be converted to LPCM first. This can be done with eac3to:
eac3to.exe input.wav output.lpcm

(Note: The extension has to be .lpcm, .pcm will not work with Mplex)

The command line for muxing should look like this:
Mplex.exe -f 8 -o output.mpg input.m2v input.lpcm


Womble MPEG Wizard DVD:
Works, but the option is a little hard to find. Under 'Tools' there is the 'MPEG Multiplexer', and this is what I naturally tried first. No luck here, only MPEG audio is supported.

To make it work you have to import the video and audio streams into the time line, then click on 'Export'. But now the 'Details' window tells you that audio will be converted to MP2. The reason is that the default templates are set up this way. You could now alter the templates, but the easier way is to click the 'Export' button in the top right corner toolbar. Here you will find an 'Audio' tab where you can specify 'LPCM' as your audio format.

MuxMan:
State of the art muxing engine. Creates a DVD structure only, no muxed MPG file is available.

MPEG StreamClip:
My favorite. Comes from the Apple world, needs QuickTime plus the MPEG2 decoding plugin. Can create muxed MPG files from a VTS, but also muxes elementary streams directly. Catch: The audio file must be in the AIFF format, WAV is not supported. But any decent Wave Editor can convert a WAV file to AIFF, and I even found a small app called WAV2AIFF which does just that.

VOB2MPG:
Creates MPG files from a VTS. If you used MuxMan to create a DVD structure from your elementary streams, you can use VOB2MPG to convert it to an MPG file.

VOB2MPG has two different modes, one is called VOBSET mode, the other one IFO mode. In VOBSET mode the conversion seems to go well, but the resulting file plays with loud audio noise (like IfoEdit and Rejig). In IFO mode everything works well, but (at least in the free version) this mode is painfully slow.


My tests consisted of doing the conversions with different tools and playing the resulting files through some software players and one standalone DVD player. This does not tell you anything about the quality of the muxing engines of those apps. To test this you would have to use some professional DVD compliance checking software (Sir Didymus, can you hear me?...;))

Anyways, IMO MuxMan and MPEG StreamClip really stand out from all the rest.


Cheers
manolito

Midzuki
3rd March 2011, 02:36
...

Stuff which does not work:
Mplex and Imago (as expected),

mplex requires LPCM audio,
and IMHO it's not that difficult to convert .WAV to .LPCM :)

manolito
3rd March 2011, 21:17
@Midzuki,

thanks for the correction, I edited my post...

Cheers
manolito

netmask
4th March 2011, 23:25
Just a comment on Womble - I have done this quite often ie rename m2v to mpv and select linear pcm under the audio tab.General
Complete name : C:\Users\Netmask\Desktop\Untitle.mpg
Format : MPEG-PS
File size : 2.92 GiB
Duration : 59mn 5s
Overall bit rate : 7 080 Kbps
Writing library : (c) 1998-2008 Womble Multimedia, Inc. / MPEG Video Wizard (08/2008) / Dec 31 2008

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, BVOP : Yes
Format settings, Matrix : Default
Format settings, GOP : M=3, N=12
Duration : 59mn 5s
Bit rate mode : Variable
Bit rate : 5 403 Kbps
Nominal bit rate : 6 642 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.521
Stream size : 2.23 GiB (76%)
Writing library : (c) 1998-2008 Womble Multimedia, Inc. / MPEG Video Wizard (08/2008) / Dec 31 2008

Audio
ID : 160 (0xA0)
Format : PCM
Format settings, Endianness : Big
Format settings, Sign : Signed
Muxing mode : DVD-Video
Duration : 59mn 5s
Bit rate mode : Constant
Bit rate : 1 536 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Stream size : 649 MiB (22%)

Menu

manolito
5th March 2011, 11:51
@netmask,

thanks for setting me straight on this issue. Womble does indeed work, but only after some experimentation plus reading the help file. The natural way to do multiplexing with Womble is to use the MPEG Multiplexer tool, but this tool does not support WAV or LPCM audio. You have to import the elementary streams into the time line first and then export them.

Corrected my post...

Cheers
manolito

LouAnne
31st July 2012, 18:15
@manolito
Thanks for researching the problem and for posting your results. I had the same issues as the OP, only my files were dvd compliant, and this thread helped me find a solution.

I originally tried MPEG StreamClip, but it crashed just after opening the m2v file. I tried a few things but never figured out why.

I then tried Womble MPEG Video Wizard DVD. I like Womble because it produces an mpeg file and it seems to do a straight multiplex without any reencoding. The resulting mpeg looks good on YouTube, so I'm happy.

@netmask
Thanks for such crucial information such as to rename the m2v file to mpv and also, how to locate the lpcm audio option.