Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] mpegtools (mplex) and 2 audio tracks



Here is a small patch for mpegtools to activate 2 audio streams support
in mplex program.

It is already built in domplex routine ; You have to use ES_STREAMS.For
instance :

extract_pes 001.vdr E0 | pes2aud_es > 001_ES.V
extract_pes 001.vdr C0 | pes2aud_es > 001_ES.A1
extract_pes 001.vdr C1 | pes2aud_es > 001_ES.A2

then

mplex -t DVD -i ES_STREAM 001_ES.A1 001_ES.A2 001_ES.V -o test.mpg

I have tested with a fake second audio track using the same ES_STREAM
twice. It worked with MPlayer using '-aid 0' or '-aid 1'.
Maybe there can be a problem with second track because of too large
buffer size on second track ( i had that problem once during previous
tests).


I don't know if it works with AC3 streams. If you have recordings with
AC3 you can test it !!



=======================================
--- 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);
=======================================


Patrick Gueneau


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.


Home | Main Index | Thread Index