Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] video merge - audio and video out of sync
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3337
Location: de

PostPosted: Tue Dec 09, 2008 10:14 pm    Post subject: [solved] video merge - audio and video out of sync Reply with quote

Hi,

I tried to merge 2 xvid/avi videos. After the merge process I recognized that the audio track isn't synchron to the video track anymore. The difference is about 1 second.

First trial was with mencoder:
Code:
mencoder *.avi -ovc copy -oac copy -o Movie.avi

I got the error messages:
Code:
Erfolg: Format: 0  Daten: 0x0 - 0x2bc8a800
AVI-Dateiformat erkannt!
[aviheader] Videostream gefunden, -vid 0
[aviheader] Audiostream gefunden, -aid 1
VIDEO:  [XVID]  640x272  12bpp  25.000 fps  1055.1 kbps (128.8 kbyte/s)
[V] Dateiformat:3  fourcc:0x44495658  Größe:640x272  fps:25.000  ftime:=0.0400
Videocodec: Framecopy (640x272 12bpp fourcc=44495658)
Audiocodec: Framecopy (Format=55 chans=2 Rate=48000 Bits=0 B/s=19447 Sample-0)
Schreibe Dateikopf...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Schreibe Dateikopf...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Pos:   0.9s     22f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [0:299]
Frame übersprungen!
Pos:   1.2s     32f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [72:268]
Frame übersprungen!
Pos:   1.6s     42f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [57:247]
Frame übersprungen!
Pos:   2.0s     52f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [70:232]
Frame übersprungen!
Pos:   2.3s     62f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [60:220]
Frame übersprungen!
Pos:   2.7s     72f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [53:211]
Frame übersprungen!
Pos:   3.0s     82f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [48:205]
Frame übersprungen!
Pos:   3.4s     92f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [43:199]
Frame übersprungen!
Pos:   3.8s    102f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [40:195]
Frame übersprungen!
Pos:   4.1s    112f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [37:192]
Frame übersprungen!
Pos:   4.5s    122f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [34:190]
Frame übersprungen!
Pos:   4.9s    133f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.082 [32:187]
Frame übersprungen!
Schreibe Dateiindex...( 8%) 2648.40fps Trem:   0min 695mb  A-V:0.064 [705:155]
Schreibe Dateikopf...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.


Ok, that's the reason. The first frames of video 1 are corrupt, thus mencoder skips that frames.

Next attempt was avidemux. But when I just loaded the 1st video and played it in avidemux, I got the same problem. Video and audio were out of sync. Playing the same video in mplayer works perfectly synchron without errors.

So my question is: How can I force mencoder or avidemux not to skip the first frames.


Last edited by musv on Tue Dec 09, 2008 11:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Tue Dec 09, 2008 10:25 pm    Post subject: Reply with quote

If you have transcode installed, try using the avimerge command to merge the two avi files. You might need to use the "-c" option too.
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3337
Location: de

PostPosted: Tue Dec 09, 2008 11:17 pm    Post subject: Reply with quote

Thx, it worked. avimerge showed me
Code:
[avimerge] Dropping 10 frames

but video and audio seems synchronized.
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Tue Dec 09, 2008 11:22 pm    Post subject: Reply with quote

It probably had to drop the video frames in order to keep the audio sync'd up. That's what the "-c" option is for. Glad it worked. :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum