>> Hmm... I'd think it would be simpler to just pass a single filename,
>> because usually you'll be using a different demuxer/muxer for the video and
>> audio files if you keep them separate (e.g. mux_avi for video, mux_wav for
>> audio). The core would create two (de)muxer instances, one for each
>> separate file, and pass just the video frame or just the audio frame to the
>> (de)mux routine as appropriate.
>
>That's good for demuxers, but not so good for muxers. There is a couple of
>issues:
>1) encoder core code (src/encoder.c) uses single-instance multiplexor and
>runs it, as well as A/V encoders, in a single thread. This happens both on
>OMS and in NMS-powered code. I'm pretty satisfied of this situations because
>it's work quite well, it's clean enough and... We need to join streams at
>some point in processing pipeline!
Why? If you're outputting the audio to a separate file, it doesn't
make sense to try and keep them in sync anyway. It's easy enough to create
a second multiplexor instance if we're outputting a separate audio stream,
and call the multiplexor twice instead of once, like the (incomplete) patch
below. Or we could just drop support for separate audio export completely;
the main reason for it (MPEG) will go away once we have MPEG multiplexing
support, and if anyone really needs it we can tell them to do the audio run
separately: transcode ... -o foo.wav
So I'm still in favor of only one file argument (and no audio/video
flag) to open().
--- src/encoder.c 27 May 2006 11:26:30 -0000 1.39
+++ src/encoder.c 5 Jun 2006 03:23:33 -0000
@@ -415,6 +415,7 @@
.vid_mod = NULL,
.aud_mod = NULL,
.mplex_mod = NULL,
+ .mplex_aud_mod = NULL,
/* rotor_data explicitely initialized later */
#else /* not defined TC_ENCODER_NG */
.ex_a_handle = NULL,
@@ -718,7 +719,12 @@
}
ret = tc_module_multiplex(data->mplex_mod,
- data->venc_ptr, data->aenc_ptr);
+ data->venc_ptr,
+ data->mplex_aud_mod ? NULL : data->aenc_ptr);
+ if (data->mplex_aud_mod && ret == 0) {
+ ret = tc_module_multiplex(data->mplex_mod,
+ NULL, data->aenc_ptr);
+ }
if (ret < 0) {
tc_log_error(__FILE__, "error multiplexing encoded frames");
data->error_flag = 1;
--Andrew Church
[EMAIL PROTECTED]
http://achurch.org/