In mpegtools packaged with linux-dvb driver you can find mplex program which can do what you want.
The doc says it can mux 1 video + 1 audio but in fact, the subroutines are able to handle 2 audio PES streams. Have a look at the code (domplex subroutine).
In case it may help you, here is a patch I proposed more a few months ago in this Maillist:
You may need to adapt this patch to the latest mplex version as it may have changed a bit.
========================================================================
--- mplex.cpp Wed Jun 27 14:21:48 2001
+++ ../../../DVB/apps/mpegtools/mplex.cpp Fri May 10 23:45:29 2002
@@ -240,7 +240,7 @@
printf (" --help, -h: print help message\n");
printf (" --type, -t: set output type (MPEG2, DVD,
SVCD (default), MPEG1, VCD, XSVCD)\n");
printf (" --of, -o: set output file\n");
- printf (" --input_stream, -i: set input stream type
(PS_STREAM (default), TS_STREAM, ES_STREAM (needs 2 input files audio
video))\n");
+ printf (" --input_stream, -i: set input stream type
(PS_STREAM (default), TS_STREAM, ES_STREAM (needs 2 or 3 input files
<audio1> [ <audio2> ] <video>))\n");
printf (" --temp_dir, -d: directory for temporary
demux files\n");
printf (" --audio_delay, -a: set audio delay in ms\n");
printf (" --video_delay, -v: set video delay in ms\n");
@@ -332,6 +332,10 @@
} else if (optind == argc-2 && !strcmp(inpt,"ES_STREAM")) {
strcpy(AudioFilename,argv[optind]);
strcpy(VideoFilename,argv[optind+1]);
+ } else if (optind == argc-3 && !strcmp(inpt,"ES_STREAM")) {
+ strcpy(AudioFilename,argv[optind]);
+ strcpy(Audio1Filename,argv[optind+1]);
+ strcpy(VideoFilename,argv[optind+2]);
} else {
usage(argv[0]);
}
@@ -404,7 +408,11 @@
if (ptsdiff > 0) video_delay_ms += ptsdiff/90;
else audio_delay_ms += -ptsdiff/90;
- domplex(1,1);
+ if (strlen(Audio1Filename))
+ domplex(1,2);
+ else
+ domplex(1,1);
+
if (strcmp(inpt,"ES_STREAM")){
unlink(AudioFilename);
unlink(VideoFilename);
========================================================================
Have fun !!
Patrick.
Olaf Beck wrote:
Hello Folks,
I'm doing some work with a proprietary MPEG stream (TIVO - DirecTv). The PS stream or what ever you would like to call it is of proprietary nature but the PES stream is following the MPEG specs to some extent.
I now have code in a early stage and it looks like it will be quite easy to extract two PES streams from the "TIVO-PS" stream. One audio (either AC3 or MPEG) and one Video. I want to extact the PES stream since it will enable me to keep the PTS information so the final PS stream is in sync.
Now for what all I have seen in forms of Open Source muxers is muxers that only can mux ES streams or at least thats what a quick look tells me. Does anyone know of a way to mux PES streams?
Cheers Olaf
PS: Yes, I could naturally modify a OSS muxer to take to PES streams but I rather spend time coding on the extraction.
-- Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as subject.
