PDA

View Full Version : problem with script, audio isn't in sync after conversion


ricardo.santos
20th March 2007, 18:57
Hi everyone!

My apologies if i posted in the wrong "section" but since its related to avisynth i thought the best place was here .

I have a few short clips (xvid,avi) that i want to convert to Mpeg2 720.576 with permanent subs on the video.

I used the following script and "fed" it to Quenc but in the final video audio is not in sync with the video, subtitles appear in sync with the audio.

avisource("C:\teste\1.avi")
loadplugin("C:\plugins\resize.avsi")
WIDTH=720
HEIGHT=576
WIDESCREEN=1
converttoyuy2()
assumeFPS(25)
converttoyv12()
LanczosResize(WIDTH,HEIGHT)
converttoyv12()
TextSub("C:\teste\1.srt")

since i couldnt find out what was wrong i "fed" the following script to Tmpgenc plus
avisource("C:\teste\1.avi")
TextSub("C:\teste\1.srt")
and everything was in sync, but for a small 5 minute clip i had to wait more than 20 minutes for the conversion to finish.

Can anyone tell me what im doing wrong in the first script? the video frame rate of the video source is 23.976 and i would like the final video to be pal.

Thanks

davidhorman
20th March 2007, 19:10
The quick fix is to use convertfps(25)* instead of assumefps(25). The resulting video won't look great, but the alternative is to resample your audio and change the timings on the subs.

*you could also try mvtools' mvflowfps/mvflowfps2 for nicer conversion.

David

ricardo.santos
20th March 2007, 19:33
Thanks David

that solved the problem, but on scene changes,a kind of blur appears i guess that what you meant about video quality degradation?

isnt there any easy way of doing this conversion without having to resample the audio separately? Quenc can produce video and audio when converting and its fast thats why im trying to use it for this small conversions, or Tmpgenc and its slowleness is my only way out?

is there any guide on how to resample the audio separately? i could stick everything " inside" an avi to dvd program but im tryng to learn how to do it manually and if possible just with Quenc?

thanks

davidhorman
21st March 2007, 10:55
The real problem is the subs - if you change the running time of the video, they'll all be out of sync, and your only solution will be to change the timings in the .srt file.

Try ChangeFPS(25) - the video will stutter a little more but you won't get the blurred frames at scene changes.

David

ricardo.santos
21st March 2007, 11:06
Hi
thanks for the info, you said subs are the problem, i manually made this subs for this small clips, i can change them to 25fps with subtitle workshop, will that help?

Thought this would be much simpler lol

Thanks

davidhorman
21st March 2007, 13:58
Hi
thanks for the info, you said subs are the problem, i manually made this subs for this small clips, i can change them to 25fps with subtitle workshop, will that help?


It certainly will - I didn't realise you were making them yourself. Use assumefps(25,sync_audio=true) in your AviSynth script, after regenerating your subs to match the new duration. The audio will be slightly sped up, but us PAL-watchers are used to it ;)

David