[FFmpeg-user] select stream depending on pmt changes

Patrick Fischer info at patrick-fischer.de
Fri Jul 19 22:45:47 CEST 2013


Hello

I have a problem with dvb streams which have changes for the stream pid.
On some tv channels, two or more programs share the video pid for the 
most time of a day. But on some hours the program use a local window 
with local content.
This is known as pmt switch or pmt changes.

Ok take a look at some ffmpeg -i ... snapshots:

Now the Program 28726 has the vPID 0x191

Input #0, mpegts, from 'http://192.168.1.2:3000/TS/S19.2E-1-1051-28726.ts':
   Duration: 26:30:43.85, start: 34320.807400, bitrate: 0 kb/s
   Program 28726
     Metadata:
       service_name    : Test-R
       service_provider: ARD
     Stream #0.0[0x191]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 
64:45 DAR 16:9], 15000 kb/s, 37.50 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0.1[0x192](deu): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
...
   Program 28724
     Metadata:
       service_name    : arte
       service_provider: ARD
   Program 28725
     Metadata:
       service_name    : PHOENIX
       service_provider: ARD


Now the Program 28726 has the vPID 0x1f5

Input #0, mpegts, from 'http://192.168.1.2:3000/TS/S19.2E-1-1051-28726.ts':
   Duration: N/A, start: 35760.215422, bitrate: 15192 kb/s
   Program 28726
     Metadata:
       service_name    : Test-R
       service_provider: ARD
     Stream #0.0[0x1f5]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 
64:45 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0.1[0x1f6](deu): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
...
   Program 28724
     Metadata:
       service_name    : arte
       service_provider: ARD
   Program 28725
     Metadata:
       service_name    : PHOENIX
       service_provider: ARD






And if ffmpeg got a good snapshout (pmt change was within the 
detectiontime )
i can see that there are both vPID's (0x1f5 and 0x191) are within the 
stream.

Input #0, mpegts, from 'xhx':
   Duration: 00:00:00.39, start: 34367.271400, bitrate: 4762 kb/s
...
   Program 28724
     Metadata:
       service_name    : arte
       service_provider: ARD
   Program 28725
     Metadata:
       service_name    : PHOENIX
       service_provider: ARD
   Program 28726
     Metadata:
       service_name    : Test-R
       service_provider: ARD
     Stream #0.0[0x1f5]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 
64:45 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0.1[0x1f6](deu): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
   No Program
     Stream #0.2[0x191]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 
64:45 DAR 16:9], 15000 kb/s, 50 fps, 25 tbr, 90k tbn, 50 tb
     Stream #0.3[0x192]: Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s


So now i hope i could describe the situation.
What did i want?
I want ffmpeg to detect the pmt switch and select the right Stream for 
output.
If this is not possible, a good beginning would be that i can put both 
PID's into the output ts file. (PMT is also needed)

The Channel Test-R is a test channel on Astra which switch each min from 
PHONEIX to Arte and back.
I would like to record this channel and store it including the right video.

Best Regards
Patrick


More information about the ffmpeg-user mailing list