Question about mplayer/mencoder
Hi all. I've been using mencoder to rip/encode dvds into avi/divx and mpg. I've been following the instruction in the encoding.html and everything seems to be going fine. Except, I realized that those avi can't be played properly under xine. It gives me a lot of green boxes on the screen. Also when I did the mpg encoder, the output mpg has no sound when I play in under mplayer, and the very same mpg file can't be played properly under xine. Is there any trick or something I've missed during the encoding? Cos what I'm worrying is files I've encoded can't be played properly on other players (players on windows for example). How can I make sure the output is friendly in general for all (most) movie players programs? Thanks. Pigeon.
Pigeon wrote:
[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html] Hi all.
I've been using mencoder to rip/encode dvds into avi/divx and mpg.
I've been following the instruction in the encoding.html and everything seems to be going fine. Except, I realized that those avi can't be played properly under xine. It gives me a lot of green boxes on the screen.
Also when I did the mpg encoder, the output mpg has no sound when I play in under mplayer, and the very same mpg file can't be played properly under xine.
Is there any trick or something I've missed during the encoding? Cos what I'm worrying is files I've encoded can't be played properly on other players (players on windows for example). How can I make sure the output is friendly in general for all (most) movie players programs?
Thanks.
Pigeon.
We're going to need more information if anyone can help you. What version are you using? What is the exact command line(s) you use to mencode your files? Also, it's good to manually insert line breaks (hit the enter key when your lines get to about 80 characters) when posting mail to a mailing list, if your mail program doesn't do it properly for you. -Corey
We're going to need more information if anyone can help you. What version are you using? What is the exact command line(s) you use to mencode your files?
Ok I should have mentioned, for some reasons I forgot to. Anyway. It is 0.90rc4. I was following the encoding.html to rip a certain section of a dvd, using 3-pass encoding. So I went: mencoder -dvd 2 -endpos <some time> -ovc frameno -o frameno.avi -oac mp3lame -lameopts vbr=3 mencoder -dvd 2 -endpos <some time> -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:aspect=16/9 -vop crop=<some args> -oac copy -o movie.avi mencoder -dvd 2 -endpos <some time> -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:aspect=16/9 -vop crop=<some args> -oac copy -o movie.avi And sorry I couldn't remember the exactly -endpos and crop arugments I've used. The output was perfect when I watch it under mplayer. But with xine, it is displaying a lot of green blocks. And then I tried to encode this avi file into mpg with: mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy movie.avi -o movie.mpg mplayer doesn't play any sound (it said "no sound") for this mpg, while xine plays it without sound either, plus the image stopped every now and then. I was just wondering there's any option I should use for encode them so that the movie file is more "compatible" with other players, like windows media player, for example. Thanks again. Pigeon.
Pigeon wrote:
[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
mplayer doesn't play any sound (it said "no sound") for this mpg, while xine plays it without sound either, plus the image stopped every now and then.
I was just wondering there's any option I should use for encode them so that the movie file is more "compatible" with other players, like windows media player, for example.
Thanks again.
Pigeon.
I don't know if this is what might be causing your green-blocks-in-xine problem, but windows players do not honor the -lavcopts aspect= option, even though it's perfectly valid. A better course with regard to compatibility would be to rescale the image before encoding, with -vop crop=a:b:c:d,scale=x:y (read the manual for which parameter does what). Here's my technique for this. Your numbers will be different. 1. $ mplayer -dvd 1 -vop cropdetect seek around a bit until you get meaningful values 2. Play the DVD with the suggested values. $ mplayer -dvd 1 -vop crop=718:368:0:54 I like to set the border style of the video window to "borderless", and look closely for any black fade-in at the edges or dark lines a few pixels in. In this case, there's a bit of fade-in at the top, so I remove two pixels from the top: $ mplayer -dvd 1 -vop crop=718:366:0:56 which looks good. 3. Find the aspect ratio with mplayer -dvd 1. Look for a line like this: VO: [xv] 720x480 => 854x480 Planar YV12 4. Since the X axis was originally scaled up, I scale Y down by the same factor: 720 / 854 * 366 = 308.57 (the 366 if from the cropping step) This gives me a resolution of 718x308.57, which is the exact same aspect ratio for the cropped data, but not multiples of 16. 5. Since multiples of 16 is better, make a quick list: $ for i in $(seq 45 -1 15) ; do echo $((16 * $i)) ; done 6. Find possible values for X and Y that are close to the exact cropped aspect ratio ( 718 / 308.57 = 2.33 ) I work my way down the list I made, starting at the first multiple below the Y resolution, and use the aspect ratio to calculate X. Hopefully this will be close to a multiple of 16 in the first few tries. 304 * 2.33 = 708.32 (kind of close to 704) 288 * 2.33 = 671.04 (very close to 672. good enough for me) If you find that you don't get near multiples of 16 without decreasing the resolution unacceptably, you can either a. live with a bit of distortion or b. revise your cropping values to shave a bit off an axis. 7. And, there we have it, 672x288. mencoder -dvd 1 -vop scale=672:288,crop=718:366:0:56 ...<whatever> ---- That may look like lots of steps, but it really only takes a few minutes. Bear in mind that if your DVD upscales the Y axis ( VO: [xv] 720x480 => 720x540 Planar YV12 ) You'll have to adjust your calculations accordingly. -Corey
That may look like lots of steps, but it really only takes a few minutes. Bear in mind that if your DVD upscales the Y axis ( VO: [xv] 720x480 => 720x540 Planar YV12 ) You'll have to adjust your calculations accordingly.
Thanks a lot. That is indeed a very detail instruction. Maybe it should go into the FAQ somewhere :) BTW, what about encoding into mpg? Is that still buggy (as mentioned in the encoding.html) What I've done what the HOWTO reckons, i.e.: mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy <other options> media.avi -o output.mpg And the output is playable under mplayer, but with no sound. And not really playable under xine (lagging, pausing itself, etc) Thanks again. Pigeon.
How to encode DV files in AVI format (codec dvsd)?
How to encode DV files in AVI format (codec dvsd)?
I've only done it with ffmpeg, and I needed a recent cvs snapshot to get audio support. I used this snapshot: ffmpeg-cvs-2003-03-02 $ ffmpeg -i infile.dv -hq -deinterlace -b 1472 -s 480x384 outfile.avi I have not tried the generated avi on another player than mplayer though. / magnus
Hello, Magnus.
How to encode DV files in AVI format (codec dvsd)?
MD> $ ffmpeg -i infile.dv -hq -deinterlace -b 1472 -s 480x384 outfile.avi I try to use latest ffmpeg, but it says "Error while opening file". DV file in AVI format (was generated by Studio DV) and it is played only in all versions of Wnds with mplayer2 by directshow filter (for recoding under Wnds needed vfw codec). Maybe I must delete RIFF header to represent it with DV file for ffmpeg? p.s. In RIFF header codec is dvsd. p.p.s. File size 2.0Gb.
participants (4)
-
Corey Hickey -
Magnus Damm -
Pigeon -
Vladimir I. Umnov