[MEncoder-users] Help with mencoder to mkv encoding

Alex Samad alex at samad.com.au
Mon Feb 25 21:27:39 CET 2008


Hi

I was wondering how I would go about creating mkv files.  I have a
script that takes my video camera source files and using mencoder
encodes them to x264 but in a mp4 container, I would like to try
encoding to a mkv container. Basically i create an AVI file and then
strip out the audio and the video with MP4Box and create a .mp4 file


	nice mencoder -quiet \
		$ASPECT \
		-alang en\
		$FILTER1 \
		-ovc $ENC1 \
		-nosound \
		-passlogfile "$PASSLOG" \
		-o /dev/null \
		"$INFILE" $ADDOPT

   	nice mencoder -quiet \
		$ASPECT \
		-alang en\
		$FILTER2 \
		$AENC \
		-ovc $ENC2 \
		-passlogfile "$PASSLOG" \
		$AUDIO \
		-o "$OUTFILE" \
		"$INFILE" $ADDOPT

	nice mencoder -quiet \
		$ASPECT \
		-alang en\
		$FILTER2 \
		$AENC \
		-ovc $ENC2 \
		-passlogfile "$PASSLOG" \
		$AUDIO \
		-o "$OUTFILE" \
		"$INFILE" $ADDOPT

	nice MP4Box -aviraw video "$OUTFILE" &
	WAITPD="$!"

	nice MP4Box -aviraw audio "$OUTFILE" &
	WAITPD="$WAITPD $!"

	wait $WAITPD

	mv "${BFILE}_audio.raw" "${BFILE}_audio.aac"

	MP4Box -add "${BFILE}_video.h264" -add "${BFILE}_audio.aac" -fps
25 -new "${BFILE}.mp4"

	rm "$OUTFILE" "${BFILE}_video.h264" "${BFILE}_audio.aac"


Is this the right way to do it or should I strip out the audio and the
video and work on the separately ? Am I loosing "stuff" by working in an
avi format and then pulling it out to place in a different container ?

So if I am to make mkv files, I use mkvmerge instead of MP4Box ?

I was wondering if there was a search archive of this mailing list. I
have tried to google stuff on mencoder & matroska but nothing leads me
to the mailing list (could be me not know how to use google :) )

-- 
She asked me, "What's your sign?"
I blinked and answered "Neon,"
I thought I'd blow her mind...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mencoder-users/attachments/20080226/a9230b3c/attachment.pgp>


More information about the MEncoder-users mailing list