On Sun, 8 Feb 2004, Dragon_at_work wrote:

> I think that the problem is in the way I generate and use silence. 

        I agree and have an idea what the problem might be (on the other
        hand I could be off base (again) ;)).

> Below is how I use silence. But, mplayer claims that the 1s of silence (wav) 
> that I had generated is only 0.9s. If that was not enough, sum.m2v = 108 
> seconds (only JPEG shots). Yet, sum.wav = 110.2s. 

        The difference might be related to the accuracy of timing on the 
        system - when a program asks for 1 second it can be a tick or two
        of the clock off.

        Since silence is 0 in a wave file and we know the sample rate needed
        why not use 'dd' and '/dev/zero' to create _precisely_ the number
        of silence samples needed.

        44100 samples/sec, 2 channels, 2 bytes per sample so the number of 
        zero bytes needed are 176000 per second.   For finer granularity
        such as .1 second it's 17600 bytes per .1 second.

        dd if=/dev/zero of=1sec-silence.pcm bs=17600 count=10

        Then convert the raw file to .wav as you were doing.  

        That will be more accurate than trying to record 1s +/- the difference
        caused by the kernel's scheduling accuracy/latency.  

        Hopefully that's what the problem is ;)

        My preference would be to use a sound editor ('snd' and 'SoundStudio'
        are a couple opensource ones I've dabbled with) to construct the
        soundtrack.

        Cheers,
        Steven Schultz



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to