Opened 4 years ago

#4228 new defect

MPEG-TS (from DVB) with PAT + PMT causes ffmpeg to try analyzing all streams of a program (max analyzeduration used), no way to exclude streams

Reported by: olifre Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Not sure whether this is more a "wish" than a defect - feel free to demote as needed.

I have a MPEG-TS recording with PMT, PAT, SDT, EIT and all audio + video + teletext + subtitle PIDs recorded (I am just reworking the DVB-S/2 implementation in mpv).

On probe'ing that, ffmpeg looks into the PAT to find all stream PIDs which belong to the recorded program.
This causes ffmpeg to also "see" additional streams, such as HbbTV-data, even though these are not in the recording (I do not add them to the TS_TAP device) nor are they interesting to / understood by ffmpeg.

The problem is that these streams cause avformat_find_stream_info() to make use of the full probesize / analyzeduration. For a live-stream, this is not really useful (channel switch taking 5 seconds etc.). Of course I could just reduce the analyzeduration, but I would feel much more comfortable at being able to tell ffmpeg a "whitelist" of stream-ids it should look at, i.e. it should just ignore the additional PIDs (if user requests that).

The PAT-parsing happens in pat_cb() in mpegts.c, the PIDs are added in add_pid_to_pmt.

If there would be a way to specify such a whitelist (maybe it's already there, and I just missed it?) I would gladly use it.

Attached is a sample recording. I chose a very small filesize to be able to attach to the bugtracker, so I also had to reduce the analyzeduration to 1 s to show the described behaviour. With a larger file, the problem also happens with 5 s duration (if you want, I can upload one).

If you want a file with a TS of a full transponder recorded (i.e. also really including these HbbTV streams), I can also upload something like this (i.e. ffmpeg could of course also identify + ignore those streams, if this is the preferred solution - although then, I would also have to parse the full PAT in mpv and add those streams to the TS to give them to ffmpeg, that's why I believe the whitelist would be more appropriate).

Attachments (2)

sample.ts (2.3 MB) - added by olifre 4 years ago.
Sample recording, with PAT, PMT, SDT, EIT, Video + Audio + Teletext + Sub PIDs, but not the HbbTV-PIDs in the recording
ffprobe-20150105-230652.log (5.8 KB) - added by olifre 4 years ago.
Output of ffprobe sample.ts -analyzeduration 1000000 -report

Change History (2)

Changed 4 years ago by olifre

Sample recording, with PAT, PMT, SDT, EIT, Video + Audio + Teletext + Sub PIDs, but not the HbbTV-PIDs in the recording

Changed 4 years ago by olifre

Output of ffprobe sample.ts -analyzeduration 1000000 -report

Note: See TracTickets for help on using tickets.