Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-07-2004, 01:29 PM   #1
Registered: Jul 2004
Location: Boston, MA, USA
Distribution: FreeBSD, Debian/AMD64, Ubuntu/i386
Posts: 59

Rep: Reputation: 15
MPEG2/DVD/transcode question


I would like to get a better understanding on some of the steps involved when transforming videos to make a DVD, transcode in particular.

Let me give the sequence I use first:

1) I use mencoder on a TV card

2) mencoder outputs an mpeg2 file and uses 48KHz audio
parameters: vcodec=mpeg2video:vbitrate=1800:abitrate=48

3) I use transcode on that file to split it up for mplex
transcode -i tv.mpg -export_asr 2 -ympeg2enc,mp2enc -V -M4 -o tv2

4) mplex -f 8 -o tv3.mpg tv2.*

5) then I use dvdauthor but that's not related to my question.

My question is in the transcode step. While mplex is obviously just copying the file, transcode is obviously recoding everything, doing mpeg2 encoding from scratch. The runtime of 246 minutes on an Athlon XP 2500+ leaves me to figure that.

Why is that? I understand that the transcode step is needed to extract the different streams out of the mpeg2 file. But why is it reencoding? Why can't it just copy the frames that the original mpeg2 file had?

Is there any way that I can avoid the loss of quality from the reencoding and spending the runtime?

Can I somehow use mencoder to directly generate files that are accepted by mplex?

Why is trancode so slow anyway? The mpeg2 encoder in mencoder is much faster.

Last edited by cracauer; 07-07-2004 at 01:36 PM.
Old 07-07-2004, 02:20 PM   #2
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I don't have any experience recording from video cards, but if mencoder is already outputting an mpeg2 video file (with mpeg2 audio as well), there should be no need to re-encode anything. As long as the video is in a DVD-compliant format (mpeg2 video, mpeg2 48khz audio, at a standard DVD resolution like 720x480), it should be ready for dvdauthor-ing immediately.

As for the mpeg2 encoder in mencoder, I toyed around for quite a while trying to get it to work for doing conversion to DVD, with no success; AFAIK, transcode is calling upon 'mpeg2enc' of the mjpegtools package, and yes, encoding using it is rather slow (on my Athlon 1600XP, about 4x to 5x the length of the video). I've had better luck cutting out the transcode-middleman entirely, and encoding directly using the mjpegtools applications (there's a nice HOWTO for that). If you do manage to get good-quality mpeg2 video output from mencoder, and it is faster than mpeg2enc, please let me know how you did it!

But I digress; to answer your question, it should be possible to separate the video and audio streams using only mencoder. I'm not certain of the exact syntax, but the options you will want to look into are '-oac copy' and '-ovc copy'. The mencoder manpage also mentions some options 'rawaudio' and '-rawvideo', which seem to be related to demuxing (that is, separating audio/video streams). Sorry I can't be of more assistance.

A little shameless self-promotion here: I've written a script (and GUI) for converting to DVD, VCD, etc. Not what you want for what you are doing, though you may find it useful in the future.
Old 08-02-2004, 10:17 AM   #3
LQ Newbie
Registered: Aug 2004
Posts: 8

Rep: Reputation: 0

I hope this script will help you:

#For encoding, I used the following command (this command may not work, but you got the idea):
mencoder -audio-demuxer 20 -oac lavc -ovc lavc -lavcopts vcodec=mpeg1video:vbitrate=6000:acodec=ac3:abitrate=448:aspect=4/3 -ofps=25 -srate 48000 -of mpeg -o /var/tmp/out.mpg in.avi

#For splitting (what you've been asking), use:
mencoder -dumpaudio -dumpfile /var/tmp/out.mpa /var/tmp/out.mpg
mencoder -dumpvideo -dumpfile /var/tmp/out.m2v /var/tmp/out.mpg

#to merge it back to a DVD-compatible mpg-file:

mplex -f 8 -o out.mpg /var/tmp/out.m2v /var/tmp/out.mpa

#To make a dvd-structure, use:

dvdauthor -o DVD out.mpg
dvdauthor -o DVD -T

#you can write it with isogrowifs or k3b now


Note that I used the mpeg1video instead of mpeg2video, because the mpeg2video gave problems for my dvd-player (it's like he doens't read the keyframes).

Greetings Hendrik


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VHS to MPEG2(DVD) with transcode or mencoder? jovir Linux - Software 4 01-12-2005 02:40 PM
Can any of the current Bsd systems do mpeg2 dvd capture format? maximalred *BSD 0 10-10-2004 04:05 PM
TV watching and capture in mpeg2 DVD Stephanie General 10 12-23-2003 04:08 PM
Transcode / DVD::RIP Tips? neurotic Linux - Software 1 11-28-2003 10:26 AM
transcode, libmpeg3, dvd::rip zorolowski Slackware 1 12-26-2002 04:09 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration