View Full Version : Audio/Video Out Of Sync
XerXes
12-24-2006, 07:26 PM
I seem to be having issues with 9 out of 10 video files I convert. The audio is ahead of the video by about 1 second. I tried asinc 1 or what ever it was and that did not help. Some videos will encode fine, but most will not. I have tried disabling everything in the background and let it encode by itself. Is there anyway to sync up the sound? The preconverted files work just fine.
Thanks!
acidraven
12-25-2006, 12:33 PM
Ok kind of a long shot on this one. But I know some times programs have problems if the original file has VBR encoded audio. Try opening the original file in Virtual Dub (http://www.virtualdub.org/) and see if it complains about the audio. In the file menu there is a save to wav command that will let you save the audio out uncompressed. Then we put the file back together, In the video tab you would want to set it to direct copy, on the audio set it to use a file. then save it as a new avi file. that might work in is competently from memory, but tI remember havening to do that with some files for PSPvideo9. Beyond that it depends on what kind of files they are to begin with. and are you playing the files on your computer first or on your ps3, I would think that you might notice a time lag in your audio playing games or watching a dvd on the ps3 if that is a problem, but it never hurts to ask right.
XerXes
12-26-2006, 01:36 PM
Thanks for the reply. I spent all last night trying to figure this thing out and this is what I came up with.
Only videos that are encoded in Xvid are affected. Which in these days its either Xvid or Divx anymore.
In order to fix the sync problem I need to use AVC encoding. I was using SP. Also the audio bitrate needs to be at least 256 to sync up properly and the "-async 1" needs to be enabled. Only with these options will the movie sync up. Any other types of videos will work with any settings but Xvid needs the above settings.
Maybe its just my computer or it could be a common thing but I dont seem to be having any problems anymore. But with the async 1 on it almost tripples the encoding time. Dead mans chest took almost 6 hours to encode on my Pentium 965. Does Red Kawa take advantage of 4 logical processors?
Thanks for your reply.
acidraven
12-27-2006, 11:08 AM
unfortunately most software dose not use multi core CPU's and none right now use 64bit. Now taking a look of the FFmpeg Documentation (The Command line tool that this is a front end for) http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html#SEC15 I see the `-threads count' option. It should be possible to use that in the custom flags of your encoder profile. Now part of that will depend on how well windows distributes your threads. I don't have a Multi core possessor so I really can't check it out. You should be able to use the task manager in windows to see how much of each of your cores usage is so that should be able to give you a good idea at a glance if it works with a quad core I would try -threads 4 or maybe 5 if you see 3 of the 4 cores running at 100% If it works I would make a thread about it saying that it works and that possibility of adding an other box to the setup of profiles or to the main system to auto add the flag.
As I said that is only an idea and I have no idea of what it will do.
XerXes
12-28-2006, 10:43 PM
As far as threads, I know that its only using 1 thread. My guess is that even a single HT processor would not be used to its full potential with video 9. But thats ok, I just encode the videos while im sleeping or at work. Video 9 only uses about 20 percent of my total cpu power according to windows Performance Task Manager. So I know there is more power to be unlocked with video 9. I wish there where at least a setting to allow video 9 to use more cpu cycles.
At any rate, im really enjoying this program and look forward to updates.
acidraven
12-29-2006, 01:45 PM
Now is that 20% just because it use using one core of your system? mine always uses what it takes to get to 100% but then I have only one core. The "-threads #" option was an idea on how to use your system better. I don't know how well it works I don't have multi core, so need someone with a multi-core system and some knowledge to do testing to see if it works, or how it works.
Moogle
12-29-2006, 03:34 PM
Interesting idea!
As I have an AMD Athlon X2 4200 (in simpler terms, a dual core Athlon), here's some testing results using the custom flags section of the profile:
1 Thread: 55 seconds of footage processed in 1 minute (default setting for PS3V9)
2 Threads: 79 seconds
3 Threads: 73 seconds
1 Thread (redux): 55 seconds
From this you can see that going to 2 threads has an obvious beneficial impact. The console actually reports the two streams (Video and Audio) that it needs to work on, which probably explains a lot of why dualcore is boosting efforts. 3 threads obviously gets bogged down as one core is forced to handle two processes. I'm fairly certain both cores are being used in 2 thread mode as the CPU fan gets rather noisy. As another small bit of evidence towards time savings, consider that the time estimater, after having run for 5 minutes, shows the following:
1 thread: 25min
2 thread: 16min
It's hard to say if 4 threads would work equally as well on a quad core (there could be dependencies within each thread that bog it down too much) but there is a very obvious advantage to adding -threads 2 to PS3V9 profiles right now if you have a dual core machine.
XerXes
12-30-2006, 07:45 AM
Jesus that did it for Sure.
Here is a break down of my test results for encoding a 5 minute video
1 thread - 6 min 14 sec - Cpu usage ~20% (1 Core)
2 thread - 4 min 3 sec - Cpu Usage ~48% (2 Cores)
4 thread - 3 min 13 sec - Cpu Usage ~61% - 75% (Fluctuated alot) (2 Cores + 2 HT)
Going any more threads made no difference. As you can see here that there are still things that can be done with video 9 to take advantage of multi thread, multi core processors. I topped out at 75% cpu usage but it made a world of difference when encoding files. My native CPU clock is 3.46 GHZ. Its overclocked to 4 GHZ.
From what I gather a 2 thread processor would not benefit to much from using the 2 threads, but an actual dual core processor really makes a difference. In my case, adding the extra 2 threads does help, but not by much.
acidraven
12-30-2006, 01:35 PM
I didn't know how the multi thread would work, I know on some things like a compiler on linux that you go number of processors +1 because 1 just manages the others. Also If in the task manager you can see/assign processes to cores try and see if you can make sure they are being distributed between all of them and not ending up on one core even two of your threads on the same core will not show an increase. (I don't know how well windows handles that. There will also come a time where you reach the maximum amount of data that your hard drive is able to do. but that is a long time from now. and is more of an issue when you are dealing with close to non compressed footage.
Now XerXes is that 70% went to video 9 or that only 70% of your CPU was used. if it is that 70% of your total cpu was used then something is odd there, but if 70% was going to video 9 but 100% of your cpu was being used that is normal if you have other things going on your computer.
Yea the difference between 2 core vs 2 core with HT is small, I know we are going to start seeing true quad code chips soon but they are going to be expensive. I will not be surprised if a similar test on one of the quads would be along the line of 1 or 2 min for that 5 min video. Video encoding is supposed to be one of the things that benefits the most from multi core/cpu. since the data can be sub divided till it gets close to it's frame rate without effecting the whole.
I think I need to start a topic for the multi core thing so we can pass that information on because there is no way to know that it is here, so I am going to C&P those parts of this thread to a new message. and hopefully it can be stickied or a new box added to the settings (I think settings would be better personally, or maybe some code to detect cores)