[MPlayer-users] Mencoder encoding to mpeg2

Erik Slagter erik at oldconomy.com
Fri Sep 5 17:13:37 CEST 2003


> This is awesome and with a little fine tuning I may get rid of Winblows
> for capturing video but I am having a little problem I can't get audio
> with this command the video is fine but no audio and until I have audio
> I can't check if it is completely DVD compliant
> 
> mencoder tv:// -tv driver=v4l2:width=720:height=480:input=2:norm=ntsc:
> amode=1:adevice=/dev/dsp:fps=29.97 -oac pcm -ovc lavc -lavcopts
> vcodec=mpeg2video:vbitrate=4096 -of mpeg -o test.mpg
> 
> I would like a way to basically have a es-mpeg setup so that I can 
> take the .wav and convert it. -aofile gives an error that it is not
> mencoder command

> I heard that ffmpeg can natively convert to ac3 but can't find the command
> from the help info

Exactly the same problem I ran into last week. I'd like to capture v4l
into an mpeg2 ps. Someone here suggested to do it like you did, and yes,
it should work, but it doesn't.... there is no audio in the ps.

Real-time mpeg2 ps encoding using mencoder is something you can forget
about in the near future, I'm afraid, because of several limitations of
mencoder:
 - only the avi container is really supported (ugh!), forget about
mpeg-ps, it's buggy;
 - from ffmpeg/libavcodec, only the video codecs are supported (duh...)
 - so you can choose between pcm and lame (mp3) for you audio codec, of
which only pcm would be a valid combination when encoding an mpeg2 ps.

I suggested to include audio and container support from libavcodec, but
there was no response, so I don't think that's going to make it anytime
soon ;-)

There are various alternatives though:

 - record using mencoder to avi using mjpeg from libavcodec and a
leightweight audio codec of your choice or pcm, then use ffmpeg on the
file to convert it to a vob/ps with mpeg2 video and ac3 audio. You can
also use transcode for that, that will give a more choice of audio and
video codecs.
 - Use ffmpeg to record from v4l in the beginning and make it output an
mpeg2 vob/ps. High risk of loosing sync though, that's not ffmpeg best
side.
 - Use transcode to record to mpeg2/ac3 files and use tcmplex to join
them. Same goes for sync. I am almost done with a replacement import
module for v4l (for v4l2, actually) that does keep sync, like mencoder.



More information about the MPlayer-users mailing list