yuv4mpeg API audio extensions
David McNab <[email protected]> Sun, 21 Oct 2007 06:38:34 +1300
| Newsgroups | gmane.comp.video.mjpeg.devel |
|---|---|
| Message-ID | <1192901914.6560.17.camel@rebirth> |
Hi, I've been contemplating the limitation of the yuv4mpeg stream format, in respect of its lack of audio support. It's occurred to me that (at least in theory) audio interleaving support could be added easily to the yuv4mpeg stream format, by having every nth frame be specially tagged, and containing raw audio data instead of video data. For example, consider a PAL 4:2:0 frame, where the Y plane is 414270 bytes long. Each frame has a time duration of 40ms (@25fps). If audio is sampled at 44100 samples/sec, as 16-bit stereo, then 40ms worth of audio would require 44100/25 * 4 bytes, which is 7056 bytes. Therefore, with a specially tagged yuv4mpeg frame, the Y plane of 414270 bytes could accommodate enough raw audio data to correspond to 58 video frames. If the Cb and Cr planes are also used for stashing audio data, then you could store enough audio data for the duration of 86 video frames. I'm willing to work on some patches to the mjpegtools yuv4mpeg api to add support for audio muxing/demuxing. How does this idea sit with the mjpegtools community? I can implement this idea totally within my application layer (so it doesn't require yuv4mpeg api changes), or we can talk about how the API could be extended so as to cause minimal or zero breakage to existing apps. Does this idea find some resonance among the mjpegtools developer community, or does it horrify, or something in between? Thoughts? Cheers David ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/