View Full Version : problems synching audio in flv!
kananga
11-29-2005, 02:32 PM
hi
am trying to do something that by all accounts should be simple and stress-free (he says tearing the last remaning hairs from his head)
got a short piece of video with sound as a quicktime movie. its of a person giving an interview.
i want to embed in a flash movie so the web page doesnt require QT plugin.
exporting the video as a .FLV works fine but when i bring it into flash and export the movie the audio goes out of sync with the video. This is the most annoying flash bug i've found in all my years of using flash.
please can anyone help me cos its really doing my head in! the audio definitely is in synch on the source video
have also tried bringing in the video track without audio and importing this separately so can jig the audio forward or back in the tiomeline so as to fudge the synching myself - but of course flash runs differently from browser to browser and accross different platforms.
have also tried running the .FLV externally but the same thing happens :(
farafiro
12-12-2005, 09:52 AM
Just make sure that the FLV doesn't start unless it's fully loaded
Flash Gordon
12-19-2005, 05:06 AM
I am having the same problem. I tired preloading the embedded FLV fully before playing it but still the audio of a 17 second clip ends up 1.5 seconds ahead. This is happening locally. (I can't even image what it would be like on the web).
My FLV setting:
video codec: Sorsen Spark
Quality: High
Frame rate: same as source
Resize video: 180 width | 182 Height
Encode audio: MPEG Layer III (MP3)
Data rate: 128 kbps (stereo)
Crop: "a little here and there"
WHY?
farafiro
12-19-2005, 09:19 AM
show me the embeded vid preloading script
Flash Gordon
12-19-2005, 07:07 PM
Thanks for the reply "Faffy"!
The darnest thing: In frustration i delete my FLA last night, so I tried to recreate it to post my code here, and now the audio IS lining up fairly well (it isn't perfect but I guess that is to be expected). For anyone else here is my preloading code:
stop();
createTextField("_txt", 99, 10, 10, 300, 30);
onEnterFrame = function () {
_l = _root.getBytesLoaded();
_t = _root.getBytesTotal();
percent = (_l/_t)*100;
if (!isNan(percent)) {
if (_l>0) {
_txt.text = Math.round(_l)+"/"+Math.round(_t);
}
if (_l == _t) {
delete this.onEnterFrame;
_txt.text = "";
play();
}
}
};
farafiro
12-20-2005, 04:06 AM
if this was what u were trying to do, so I gues this is the problem coz FLV has its own preloading .... hmmmm functions
FLVPlayback.bytesLoaded
FLVPlayback.bytesTotal
FLVPlayback.complete
and u can see this greate example from Flash's help
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object):Void {
trace("State is " + eventObject.state + "; ready to play");
// display the no. of bytes loaded at this point
trace("Bytes loaded: " + my_FLVPlybk.bytesLoaded);
};
my_FLVPlybk.addEventListener("ready", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";
trace("Bytes loaded: " + my_FLVPlybk.bytesLoaded); // -1 if loading not begun
303 maddec
01-29-2006, 03:07 PM
Hi there, I had the same kind of problem about desynchronisation.
But it isn't linked to flash.
In fact you should be aware that it can be dependent to the version of quicktime you are using!!!
I've decided to go from a simple quicktime version to a pro version, as soon as as I installed the pro version, I had synch problems.
Then I desinstalled it and put back the simple quicktime available for free online, and now all works perfectly again!
schwinghammer
11-07-2006, 02:06 PM
I FIGURED IT OUT!!!! AND IT'S SOOOO SIMPLE!!!!
GET THIS:
exporting a video file will normally set it to NTSC standard framerate which is about 30fps. the flash movie i'm making is set to 20 fps, so therefore, the QT movie was running 1/3 slower than it should have.
when you export your video from QT make the frame rate match up with your flash movie.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.