Log in

View Full Version : Help with Adjusting FPS


trevlac
27th June 2005, 16:25
Instead of doing little tests ( how i usually get things to work) I'd thought I'd just ask some AVS guru's :D


My videoNow player normally plays 18fps video, 17640 sample rate audio.

To get there, I use ChangeFPS(18) and resampleAudio(17640). Works great.

But now I want to fake out the player and try to get it to work with 9 FPS video and 1/2 rate audio. Trying to push the limits of crappy video. The trick is the player still plays at the same speed, so I need to make the vid/audio in slow motion/low pitch to get it to play back correctly.

So instead of the 18fps above ... I thought I'd do:
ChangeFPS(9) and resampleAudio(8820).

This reduces the info in 1/2, but it would play back at 2x speed and pitch.

Then do I add?
AssumeFPS(4.5,sync_audio=true)

Will that do what I want? I want 1/2 the number of frames, but normal playback speed. It's a bit of a pain to test becasue I have to burn a disc.

Thanks

BTW: The player is a portable video player for kids ... you can get them for ~ $25 ... and hack them for fun.

mg262
27th June 2005, 17:16
I'm not completely sure I follow the problem... I'm going to try and answer but from experience on the capturing forum, I think what I'm about to say may be elementary to you (and not what you're looking for) -- sorry if it is.
______________

If you use ChangeFPS and resampleAudio, the perceived playback speed *on a PC* will not be affected. I.e. as well as changing the number of frames/samples per second, those functions will record the new frame rate/sample rate so that players will play back properly. So to someone who isn't sensitive to video/audio quality, the following .AVS files play back identically in any media player:

1)
aviSource("whatever.avi")

2)
aviSource("whatever.avi")
ChangeFPS(22) #silly frame rate
resampleAudio(84820) #silly sample rate

Similarly, just using one of these (e.g. ChangeFPS(22) on its own) will not cause A/V desync.

It may be that your standalone player assumes the video is at 18 FPS without checking the recorded value, in which case feeding it video that is really 9 FPS will cause it to playback at perceived 2x speed (i.e. the same thing you get when you press 2x on a DVD player). If this is the case, I think this is what you want:

#start with source at some random FPS, audio rate

ChangeFPS(9)
resampleAudio(8820)

#now have vlq vid, (9 FPS 8820 Hz)
#but the player can only handle 18 FPS 17640 Hz input so...

ChangeFPS(18) #this will duplicate frames to produce 18fps
resampleAudio(17640)

The video will actually be 18fps, but since frames are duplicated:
AABBCCDDEEFFGGHH
it will be exactly the same as playing
ABCDEFGH
at 9fps.

Something similar happens with the audio, although it's not perfect (because I think resampleAudio will do something more sophisticated than duplicating samples). The video will compress better because every other frame is a duplicate, which may be what you are aiming for?

I'm sorry I couldn't be more concretely helpful... case of me misunderstanding, I think. If you can spell out the problem more simply I can try and be more helpful -- or you can wait for someone better qualified to answer. In any case, I think it would be best to wait for someone to confirm/correct this before burning a disc.

trevlac
27th June 2005, 17:55
I'm not completely sure I follow the problem... I'm going to try and answer but from experience on the capturing forum, I think what I'm about to say may be elementary to you (and not what you're looking for) -- sorry if it is.

Hi mg262. I was just talking to someone about your new color filter. I really want to give it a try.


I'm fairly sure my question reveals my complete lack of understanding of frame rate changes :D I believe your answer as shown that I can't do what I want to do.

But some more info ... just in case there is some 'magic' out there.

I want to save on frames ... but not change the appearence of the playback. But I'm gettting the idea I can't do that because my player plays back at a fixed rate. Namely 18 fps. So ... I have to give it 18 frames. And if these 18 frames don't represent 1 second's worth of real time, the motion will be off.

The root of my confusion was my complete lack of understanding of audio. I was using that nifty avs function Timestretch(). With that I can correct the pitch of the audio, after I resample. But I guess the tempo was still fast.

I have done 15fps and it doesn't look too bad. But I was thinking ... can you fix the rate so it is proper?

I just learned the answer is "Ahh... no."

Thanks