PDA

View Full Version : Question about fps control on playback time


pirata
28th May 2003, 15:10
Hi everybody.

With the advent of Matroska, you can enhance your DVD backups with additional audio tracks, which can be really useful if you have to learn a language that's not bundled in the DVDs sold in your country.

Until now, I'd probably found an audio track in, say italian (25fps) for my movie (23.976). Since the container was OGM, I'd have to reencode to OGG for the sake of playability -it is so in my system, maybe not in yours-. In the reencoding, I'd convert from 25 to 23.976. It would take time and efforts.

But, I can use the track as is, be it VBR/CBR MP3, AC3, OGG or MPC. I don't have to reencode, so the last remaining problem is the frame rate difference.

My plan is to multiplex the video and the audio tracks without altering them, keeping the original qualities and frame rates (and not bothering with any time-consuming conversion of any type). On mux time you do synching for all audio tracks as needed (i.e. set the video track from 23.976 to 25 and mux with italian audio; experiment with delays until synch is achieved; afterwards mux video at 23.976 and italian track at 25fps with found delay). Then, on playback time, you select the frame rate of the video channel to fit that of the audio track currently being played. Note that the rate at which the audio track is played would is its original rate. The changes on playback time affect only the video track. I hope matroska, with its time stamps, can deal with this.

Here is my question: is there the possibility, either in Windows (be it using some trick with Zoom Player, TCMP or some Directshow filter) or in Linux (mPlayer)


Thanks

Sirber
28th May 2003, 16:20
Isn't sound independ of frame rate?

pirata
28th May 2003, 17:59
I don't know. The most versatile thing I've saw till now is ReClock filter, and both sound and video are treated the same way as for speed. Video and audio are not independent. Maybe I could tell the ReClock programmer to observe my askings. Maybe there are switches in mPlayer os ZP or TCMP for it).

avih
28th May 2003, 23:44
Originally posted by Sirber
Isn't sound independ of frame rate?

theoretically, it is, but practically, when a film is converted to pal, and plays at 25fps, it's 4% shorter in time (clip played at 25 instead of 24 fps), so the audio track from an 25fps clip is shorter as well, and will get out of sync if played with a non 25fps video.

CaptainCarrot
29th May 2003, 00:06
Hey pirata, you're double posting! Same post in the matroska-thread!

Sirber
29th May 2003, 00:19
Originally posted by avih
theoretically, it is, but practically, when a film is converted to pal, and plays at 25fps, it's 4% shorter in time (clip played at 25 instead of 24 fps), so the audio track from an 25fps clip is shorter as well, and will get out of sync if played with a non 25fps video.

Ok... I understand. The film will be longer if converted to 24 FPS from 25 FPS. I think with a tool like CoolEdit, you can resample the soundtrack to the desired lenght...

avih
29th May 2003, 00:43
sure. you could do all sorts of stuff with the audio, i just explained that the audio is not entirely independant of the video.

Sirber
29th May 2003, 01:14
I know :D

It's independant but we need to have it in sync.

Atamido
29th May 2003, 01:37
To answer the Matroska portion of this, no. This is independant of the container, and it is more difficult to change the video framerate of a video in Matroska than AVI. In AVI, it is one setting at the beginning that determines the playback rate. In Matroska every frame has a video stamp, so you would have to change every single timecode for that track (IE, rewrite the whole file). I feel a lashing for 'Matroska pimping' coming on.

Do as Sirber suggested and stretch one of the audio tracks. But when you do, here are some things to keep in mind.

Assume you have a movie of whatever framerate, and an audio track that is set for 24fps and another audio track that is set for 25fps...and assume that the audio tracks have the same settings, then:

Your original 24fps audio should (in theory) be about 4% better because there will be 4% more samples, because it is 4% longer.

Stretching 25fps out to the 24fps length will generate samples to fill in the gap.

Shrinking 24fps to 25fps length will throw out samples to close the gap.

The original audio will be the 24fps audio, while the 25fps will be higher pitched because it is played faster.

You can set the video to whatever framerate you want your audio at, the video won't care.

pirata
29th May 2003, 02:12
@CaptainCarrot: yes I've double posted because I supposed nobody would get interested in this issue. I guess the best is to close the discussion here and continue posting in the Matroska forum. For your attitude, I guess that this thing I did is deemed as something worse than than a bad practice... do you think they'll kick me off the forum or something? :-(

@all: go to the Matroska thread, but I tell you in advance my thoughts. Even at 30fps, I guess every PC could deal with the simple computations that lead to the time stamps values, even in real time, and schedule the frames on time... but if it is that easy, why do we write them down in advance?!?! Why to use time stamps, anyway...?