1

It seems easy to SET the video/audio PIDs when transcoding with ffprobe, or to get only streams with a specific PID - all that is in the manual.

But I want to GET them from the stream. You can see them if you have text output, it is the hex code in square brackets at the start of the stream information of an actual ts segment. e.g.

Input #0, mpegts, from '/Users/development/Movies/OC3.demo.ts':
Duration: 00:09:32.72, start: 0.040000, bitrate: 13239 kb/s
Program 1
Metadata:
service_name    : Avalpa1: MPEG2 MHP
service_provider: Avalpa
Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], 2600 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc

here [0x810]

Is there any way to get this videoPID in the programs or streams array entry of a probe of the master manifest? (when using the -show_programs and -print_format json options)

kpollock
  • 3,899
  • 9
  • 42
  • 61

1 Answers1

1

A bit late but ...
You should explicitly specify the input format. Ex:

ffprobe -v quiet -f mpegts -print_format json -show_streams rtp://239.25.67.1:1234

The result includes the PIDs as "id":

{
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
........
            "id": "0x100",
........
        },
        {
            "index": 1,
            "codec_name": "mp2",
            "codec_long_name": "MP2 (MPEG audio layer 2)",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
..........
            "id": "0x101",
            "r_frame_rate": "0/0",
.........
        }
    ]
}
mihan22
  • 11
  • 2