View previous topic :: View next topic |
Author |
Message |
gondoi Tux's lil' helper


Joined: 27 Mar 2003 Posts: 138 Location: San Angelo, TX
|
Posted: Thu May 15, 2003 5:41 pm Post subject: mencoder, telecine, deinterlace, and audio sync |
|
|
Hi, I'm trying to encode The End of Evangelion, and I'm having some troubles.
I figured out it was interlaced, that was easy. But when i tried the deinterlacing options they all looked bad. ( the best one was median deinterlace, but it was still bad ) I started reading up on interlacing, and i found a few people who feel that deinterlacing is just bad in general, and that it should be played with the inverse interlace or something.. can't remember the exact wordings. Anyway, I figured out that I can play the movie with this comand Code: | mplayer -dvd 1 -sid 1 -vop detc=dr=1 | and it looks beautiful. And per the man pages suggestion I tried the encode with the detc=dr=1.
Well, that didn't work so well, I am doing a 3 pass encode with mencoder and when i get some output the audio is way off the video.. it just seems to keep falling further behind the longer you watch.
Although with the above command it works fine throughout the whole movie, it's just with the encode that the sync gets off.
Anyway, the doc says that dr=1 drops some frames... but that you should use it for encoding... just for grins i tried dr=0 so that it wouldn't drop frames, but it still has audio out of sync.
btw, I'm using Mplayer version 0.90rc5-3.2.2. (latest stable ebuild)
Anyone have any idea on this problem?
Thanks,
gondoi |
|
Back to top |
|
 |
commanderfoxtrot n00b

Joined: 07 Dec 2002 Posts: 40 Location: University of Durham, UK
|
Posted: Thu May 15, 2003 9:50 pm Post subject: Audio probs |
|
|
It sounds as if you are not properly converting DVD audio (48KHz) to "normal" audio (44KHz), but just coping the samples. You need to look at the mplayer/mencoder man page under resampling filters. |
|
Back to top |
|
 |
gondoi Tux's lil' helper


Joined: 27 Mar 2003 Posts: 138 Location: San Angelo, TX
|
Posted: Fri May 16, 2003 2:13 am Post subject: mencoder command used for audio rip |
|
|
I'll look at the Docs but I'll go ahead and post what i'm doing.
Let me know if you need to know more.
Code: | mencoder -dvd 1 -aid 131 -ofps 29.97 -ovc frameno -o frameno.avi -oac mp3lame -lameopts abr:br=$abr:vol=8 -fps 29.97 |
This is the command I use when ripping a dvd. This works perfectly fine with other movies (Matrix, etc.) Also, if I do NOT use the detc=dr=1 command or if I just use a normal deinterlace command (i.e. lavcdeint) the sound syncs fine with evangelion. Only after using the detc instead of the lavcdeint command, does the audio get out of sync on encode.
BTW, I just use -aid 131 and -fps 29.97 for Evangelion because that is the options needed for this one.
Thanks,
gondoi
 |
|
Back to top |
|
 |
gondoi Tux's lil' helper


Joined: 27 Mar 2003 Posts: 138 Location: San Angelo, TX
|
Posted: Fri May 16, 2003 2:34 pm Post subject: resampling |
|
|
With more tests I have noticed that even regular movies are off a bit.. just barely though. Maybe half a second or so.
I tried resampling to 44KHz, but that didn't help. Does anyone know what could be causing my audio to be out of sync with my video? |
|
Back to top |
|
 |
Tuna Guru


Joined: 19 Jul 2002 Posts: 485 Location: Berlin
|
Posted: Fri May 16, 2003 4:12 pm Post subject: |
|
|
i dont know much about mencoder and inverse telecine (IVTC). but as far as is know its a pulldown technique that 'removes' some duplicated frames, that have been added to reach NTSC specs (30fps per second with displaying 60 half pictures each second). ok.. there are a lot of good sites out there that try to tell you what all this stuff means, but to summarize.. IVTC normally pulls down your movie from 29.97 fps to 23.97 fps, which is quite good to our normal film specs (24fps). but sice your still 29.97 fps.. maybe A/V sync suffers from that? or from that leftover 0.03 fps after pulldown? unfortunately i dont have eva dvds - i dont have ny anime dvds :/ but i like to know about your experiences and hopefully successful encodes.. maybe extract the audio.. encode the video.. and check both files playtime.. maybe the riddle's secret is kept there. |
|
Back to top |
|
 |
Klepper n00b

Joined: 11 Apr 2003 Posts: 10
|
Posted: Sat May 17, 2003 1:57 pm Post subject: |
|
|
It's a bit more complicated and I haven't come up with a working solution either. Audio and Video never sync, although it's only about 1-2 secs for the whole movie.
When you give a different framerate with -ofps mencoder keeps all the frames and just speeds up and slows down the movie. This applies for audio too.
When using -detc mencoder cuts out the duplicate frames and changes the framerate without changing the speed.
The right setting for detelecine is -vop detc=dr=1 -ofps 23.976 (also try switching -fps 29.97). But this will slow down the audio by factor 30/24 as nothing is cut out there.
So you'll have to encode audio and video seperately.
i.e. encoding the audio at normal framerate to keep normal speed and encoding the video with detelecine, as detelecine keeps the original speed automatically (by cutting out frames)
Code: |
audio: mencoder -dvd ... -ovc frameno -o frameno.avi -oac mp3lame -lameopts ...
video: mencoder -dvd ... -oac copy -ofps 23.976 -vop detc=dr=1 -ovc ...
|
_________________ ALONE, adj.
|
|
Back to top |
|
 |
gondoi Tux's lil' helper


Joined: 27 Mar 2003 Posts: 138 Location: San Angelo, TX
|
Posted: Sun May 18, 2003 12:32 am Post subject: Update |
|
|
Just an update here... I've been searching the Mplayer-user lists.. and it seems that a few people have submitted this as a bug. From what I've found so far, there wasn't a problem before, but since some release (not sure which one) the encoding of dvds has become out of sync. I have not found anything in the lists (yet) about a fix either. When/if I find something, I'll update this thread.
gondoi |
|
Back to top |
|
 |
phypor n00b


Joined: 25 Jun 2002 Posts: 68 Location: Texas
|
Posted: Sun May 18, 2003 2:32 am Post subject: Re: Update |
|
|
gondoi wrote: | Just an update here... I've been searching the Mplayer-user lists.. and it seems that a few people have submitted this as a bug. From what I've found so far, there wasn't a problem before, but since some release (not sure which one) the encoding of dvds has become out of sync. I have not found anything in the lists (yet) about a fix either. When/if I find something, I'll update this thread.
gondoi |
im one that has seen a/v sync issues on certain dvds with newer versions of mencoder (which otherwise gives near perfect results)
going back to _rc3 or before should let you rip/enc these without a/v prollems, but the newer advanced lavc/pp options arent there (notably *cmp,trell,qpel,hqdn3d)
with the latest mencoder, ive ripped spiderman maybe 20 times or more with differnet settings and never got it to produce results with proper a/v sync.
~phypor _________________ ALWAYS stay away from tanks enguled in fire.
- 2000 Emergency Response Guidebook, pg307 |
|
Back to top |
|
 |
gondoi Tux's lil' helper


Joined: 27 Mar 2003 Posts: 138 Location: San Angelo, TX
|
Posted: Sun May 18, 2003 6:17 am Post subject: _rc3 ebuild |
|
|
In that case, does anyone know where I could get a _rc3 ebuild?? The lowest I have in my mplayer directory is _rc4. I will go ahead and try that one and see if that version is early enough to work, but I figure that it may not knowing my luck .
Anyway, If it doesn't work, and nobody knows where to get the ebuild I'll just have to try and find the source and compile it that way.
Thanks for the info. |
|
Back to top |
|
 |
gondoi Tux's lil' helper


Joined: 27 Mar 2003 Posts: 138 Location: San Angelo, TX
|
Posted: Sun May 18, 2003 7:40 am Post subject: _rc3 |
|
|
Alright, this is about to drive me crazy...
I've downloaded the old _rc3 release, with no luck.
I still has the same delay. I found a post on the user list that says something about the 2003 01 16 cvs release was when someone noticed it. So I'm probably going to try that version and then the one for the 15th. Hopefully, I can find a version that has a good a/v sync.
Perhaps I'll even try the latest cvs... but we'll see. it's late for now, I'll have to try it tomorrow. |
|
Back to top |
|
 |
Tuna Guru


Joined: 19 Jul 2002 Posts: 485 Location: Berlin
|
Posted: Thu May 22, 2003 4:33 pm Post subject: |
|
|
ok its me again. luckily i got my first ntsc dvd into my hands. ok its not anime but nearly as cool: brazil criterion collection. wohoo!
anyway curious about that stupid ntsc and ivtc technique i though i give it a try, and here are my results:
Code: | mencoder brazil.vob -oac pcm -noaspect -vop scale=608:320,crop=710:346:6:66 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=600:vhq:v4mv:vmax_b_frames=2:vpass=1 -ofps 23.97 -o brazil.avi |
that one gave a nice video converted to 23.97 fps and audio in sync! as you may have noticed i dont have any -vop detc=dr=1 though it is stated in the man page that i should use it for mencoder. but with that option i got a lot of duplicated frames and my final video was very jerky.
instead plainly using that one above gives me that:
Code: | demux_mpg: 3:2 TELECINE detected, enabling inverse telecine fx. FPS changed to 23.976! |
sounds nice eh? from time to time.. about 10 or 20 times within the movie i got this on some scene changes:
Code: | demux_mpg: Progressive seq detected, leaving 3:2 TELECINE mode
few frames later...
demux_mpg: 3:2 TELECINE detected, enabling inverse telecine fx. FPS changed to 23.976! |
hm ok.. maybe that introduces some slight audio delay over time.. but i cant confirm that. on first look everything seems to be in sync fine.
i also got a couple of dropped frames.. about 50 maybe.. dunno why.. but since the final product is as expected i suppose they are intentional.
EDIT:
oh yeah the outcomming movie uses pcm sound... hehe thats rather huge of course.. the next steps i did were:
Code: | mplayer brazil.avi -aop list=volnorm -vo null -vc null -ao pcm -aofile brazil.wav
oggenc -q0 brazil.wav
ogmmerge -A brazil.avi brazil.ogg -o brazil.ogm |
and guess what.. it is still in sync! |
|
Back to top |
|
 |
gondoi Tux's lil' helper


Joined: 27 Mar 2003 Posts: 138 Location: San Angelo, TX
|
Posted: Thu May 22, 2003 5:03 pm Post subject: audio encode |
|
|
Hmmm.. maybe that means it is the LAME that causing the problem.. not sure. Maybe I'll try the ogg when I get a chance (I prefer ogg anyway, have my music encoded with it).
BTW, what needs to be merged to have oggenc and oggmerge? I have 'oggvorbis' and 'encode' both in my USE variable.. but I don't seem to have those programs anywhere.
Thanks,
gondoi |
|
Back to top |
|
 |
Tuna Guru


Joined: 19 Jul 2002 Posts: 485 Location: Berlin
|
Posted: Thu May 22, 2003 5:26 pm Post subject: |
|
|
hm.. i would wonder if it would be LAME's fault.. only FHG under windows was buggy in that behaviuor afaik. maybe the problem accurs when you dont encode video and audio at the same time. so that audio chunks wont fit in the stream anymore and have to be relocated. if your still having trouble ask the mplayer guys.. they normally know what the code
Code: | * media-sound/vorbis-tools
Latest version available: 1.0-r1
Latest version installed: 1.0-r1
Size of downloaded files: 415 kB
Homepage: http://www.xiph.org/ogg/vorbis/index.html
Description: tools for using the Ogg Vorbis sound file format |
Code: | * media-sound/ogmtools
Latest version available: 1.0.1
Latest version installed: 1.0.1
Size of downloaded files: 183 kB
Homepage: http://www.bunkus.org/videotools/ogmtools/
Description: These tools allow information about (ogminfo) or extraction from (ogmdemux) or creation of (ogmmerge) OGG media streams. |
|
|
Back to top |
|
 |
gondoi Tux's lil' helper


Joined: 27 Mar 2003 Posts: 138 Location: San Angelo, TX
|
Posted: Fri May 23, 2003 2:24 am Post subject: New Developments |
|
|
Ok, Now I've got some weird stuff goin on... good weird stuff though.
Things are working for me now. Strange, but at least things work the way I want them now, at least so far. I am going to do more tests. Unfortunatly, I didn't have all the variables in control so I'm not so sure what has changed. I do know this though. I have emerged dvd::rip and transcode. Mencoder started encoding in sync AFTER emerging those. I'm assuming one has emerged something over something else mencoder uses... not sure.
Anyway, I got the ogm ones working too, I was excited about that, but then I tested the MP3 one more time with lame... and it worked.
So once again, I'm not entirely sure what has changed, but I do know I am using the same options I was using before when it did NOT work.
Anyway, there is that... |
|
Back to top |
|
 |
Tuna Guru


Joined: 19 Jul 2002 Posts: 485 Location: Berlin
|
Posted: Fri May 23, 2003 8:39 am Post subject: |
|
|
hehe ok.. now send over the NGE DVDs.. pleeaasssee?  |
|
Back to top |
|
 |
|