Project

General

Profile

Actions

Bug #2442

open

streamdev server: TS streaming of live stream does not contain PAT/PMT

Added by Xcoder over 7 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Server - HTTP Streaming
Target version:
-
Start date:
10/23/2016
Due date:
% Done:

0%

Estimated time:

Description

Similar to Bug #1780, there are no PMTs sent when streaming certain channels to VLC using HTTP. Strange ist that some channels work, some not, but all are received well when viewed live directly on VDR. Currently it only happens on DVB-C channels. I have DVB-S as well and never experienced this problem with S.

DEBUG is enabled. Obviously streamdev gets PMTs, therefore upstream everything seems fine. How are PMTs handled? I did not found code which sends PMTs. Are they modified in streamdev or are the respective PIDs just forwarded?

Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.298 [11100] constructor hsRequest
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.298 [11100] command GET /C-1-79-9001 HTTP/1.1
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] command Host: core:3000
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] command User-Agent: VLC/2.2.4 LibVLC/2.2.4
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] command Range: bytes=0-
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] command Connection: close
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] command Icy-MetaData: 1
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] command
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] process
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] before channelfromstring: type(C-1-79-9001) filespec(C-1-79-9001) fileext()
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.300 [11100] Channel found. Apid/Dpid is 0/0
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] Initializing Remuxer for full channel transfer
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] Creating Receiver to respect changed pids
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] cStreamdevPatFilter("Nat Geo HD")
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] OUT: |HTTP/1.1 200 OK|
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] OUT: |Content-Type: video/mpeg|
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] OUT: |Connection: close|
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] OUT: |Pragma: no-cache|
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] OUT: |Cache-Control: no-cache|
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] OUT: |Server: VDR-2.2.0 / streamdev-server-0.6.1-git|
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] OUT: |Date: Sun, 23 Oct 2016 13:29:06 GMT|
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] OUT: ||
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] streamer start
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] start writer
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] start streamer
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11100] cStreamdevLiveStreamer::Attach()
Oct 23 15:29:06 core vdr[11059]: SDEV: 91354.569 [11285] Writer start
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.049 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.049 [11073] Creating Receiver to respect changed pids
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.049 [11073] cStreamdevLiveStreamer::Attach()
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.049 [11073] Killing live receiver
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.160 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.160 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.271 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.381 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.381 [11073] cStreamdevPatFilter PMT scanner adding PID 144 (ISO/IEC 14496-10 Video (MPEG-4 part 10/AVC, aka H.264))
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.381 [11073] cStreamdevPatFilter PMT scanner: adding PID 155 (ISO/IEC 13818-1 Private PES data) AC3
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.381 [11073] cStreamdevPatFilter PMT scanner: adding PID 156 (ISO/IEC 13818-1 Private PES data) AC3
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.381 [11073] Creating Receiver to respect changed pids
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.381 [11073] cStreamdevLiveStreamer::Attach()
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.381 [11073] Killing live receiver
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.382 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.492 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:08 core vdr[11059]: SDEV: 91356.603 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
...
Oct 23 15:29:10 core vdr[11059]: SDEV: 91358.489 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:10 core vdr[11059]: SDEV: 91358.489 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:10 core vdr[11059]: SDEV: 91358.600 [11073] cStreamdevPatFilter: PMT pid for channel Nat Geo HD: 164
Oct 23 15:29:10 core vdr[11059]: SDEV: 91358.628 [11100] Desctructing Live streamer
Oct 23 15:29:10 core vdr[11059]: SDEV: 91358.628 [11100] cStreamdevLiveStreamer::Detach()
Oct 23 15:29:10 core vdr[11059]: SDEV: 91358.675 [11100] stop streamer
Oct 23 15:29:11 core vdr[11059]: SDEV: 91358.776 [11100] stop writer
Oct 23 15:29:11 core vdr[11059]: SDEV: 91358.776 [11100] destructing writer
Oct 23 15:29:11 core vdr[11059]: SDEV: 91358.776 [11285] Max. Transmit Blocksize was: 228420
Oct 23 15:29:11 core vdr[11059]: SDEV: 91358.786 [11100] Killing live receiver
Oct 23 15:29:11 core vdr[11059]: SDEV: 91358.786 [11100] Desctructing streamer
Actions #1

Updated by Xcoder over 7 years ago

Sorry, bug title is misleading. PATs are delivered and they point to the PMT PID 164. But no TS packets with PID 164 are delivered to VLC.

Actions #2

Updated by Xcoder over 7 years ago

I added some debug code at the end of cStreamdevPatFilter::Process():

               pids[npids++] = pmtPid; 
#if 0           
                pids[npids++] = 0x10;  // pid 0x10, tid 0x40: NIT 
#endif
                pids[npids++] = 0x11;  // pid 0x11, tid 0x42: SDT 
                pids[npids++] = 0x14;  // pid 0x14, tid 0x70: TDT 
                pids[npids++] = 0x12;  // pid 0x12, tid 0x4E...0x6F: EIT 
                for (SI::Loop::Iterator it; pmt.streamLoop.getNext(stream, it); )
                        if (0 != (pids[npids] = GetPid(stream)) && npids < MAXRECEIVEPIDS)
                                npids++;

                pids[npids] = 0;
                m_Streamer->SetPids(pmt.getPCRPid(), pids);

                for (int j = 0; j < npids; j++) Dprintf("cStreamdevPatFilter: adding PID 0x%02x (%d)\n", pids[j], pids[j]);
        }       
}

It seem that the correct PIDs are added to m_Streamer:

Oct 25 23:01:27 core vdr[12530]: SDEV: 291294.920 [12546] cStreamdevPatFilter: adding PID 0xa4 (164) // PMT
Oct 25 23:01:27 core vdr[12530]: SDEV: 291294.920 [12546] cStreamdevPatFilter: adding PID 0x11 (17)  // SDT
Oct 25 23:01:27 core vdr[12530]: SDEV: 291294.920 [12546] cStreamdevPatFilter: adding PID 0x14 (20)  // TDT
Oct 25 23:01:27 core vdr[12530]: SDEV: 291294.920 [12546] cStreamdevPatFilter: adding PID 0x12 (18)  // EIT
Oct 25 23:01:27 core vdr[12530]: SDEV: 291294.920 [12546] cStreamdevPatFilter: adding PID 0x90 (144) // Video
Oct 25 23:01:27 core vdr[12530]: SDEV: 291294.920 [12546] cStreamdevPatFilter: adding PID 0x9b (155) // Audio 1
Oct 25 23:01:27 core vdr[12530]: SDEV: 291294.920 [12546] cStreamdevPatFilter: adding PID 0x9c (156) // Audio 2

But I receive still only the PAT and the Video/Audio streams...

Actions #3

Updated by Xcoder over 7 years ago

Another intermediate step... cStreamdevLiveReceiver::Receive() is getting TS packets with table ID 0x02 (PMT) and the correct PID. Therefore I assume that everything outside streamdev-server is working well.

Oct 26 23:04:53 core vdr[10881]: SDEV: 377901.645 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41a0002
Oct 26 23:04:54 core vdr[10881]: SDEV: 377901.769 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41b0002
Oct 26 23:04:54 core vdr[10881]: SDEV: 377901.771 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41c0002
Oct 26 23:04:55 core vdr[10881]: SDEV: 377902.936 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41b0002
Oct 26 23:04:55 core vdr[10881]: SDEV: 377903.060 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41c0002
Oct 26 23:04:55 core vdr[10881]: SDEV: 377903.062 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41d0002
Oct 26 23:04:55 core vdr[10881]: SDEV: 377903.185 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41e0002
Oct 26 23:04:56 core vdr[10881]: SDEV: 377904.186 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41c0002
Oct 26 23:04:56 core vdr[10881]: SDEV: 377904.309 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41d0002
Oct 26 23:04:56 core vdr[10881]: SDEV: 377904.312 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41e0002
Oct 26 23:04:56 core vdr[10881]: SDEV: 377904.475 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a41f0002
Oct 26 23:04:56 core vdr[10881]: SDEV: 377904.478 [11369] cStreamdevLiveReceiver: received PMT - PID 164 0x4740a4100002

Why are this packets not seen by the HTTP client?

Actions #4

Updated by Xcoder over 7 years ago

Hmm, now I'm puzzled. It's not possible to reproduce the above. No PMT packets appear at cStreamdevLiveReceiver::Receive() for the non working channels. Thy seem to get lost upstream...

Actions #5

Updated by Xcoder over 7 years ago

The cStreamdevLiveReceiver::Receive() seems to receive the PMT PIDs but not continuously. This was the reason that I first saw the PMTs but latter not. On some channels no PMTs come in for 40 sec and then 2-5 arrive and then silence for the next 40 secs.

I see nothing that the PIDs are changed within cStreamdevLiveReceiver. Therefore it must be a problem somewhere else. I receive all channels using the satip-plugin. I have to check there.

Actions #6

Updated by Xcoder over 7 years ago

Root cause identified: core VDR cPatFilter::Process() is iterating through all PMTs per transponder. This triggers calls to cDevice::OpenFilter()/CloseFilter() with the PIDs of the PMTs. Therefore PMTs for the current channel are enabled/disabled continuously. On some channels the PMTs are interrupted long enough and VLC does never start to play the streams.

But can be closed because not related to sreamdev...

Actions #7

Updated by Xcoder over 7 years ago

Back to streamdev... After trying to zero in the root cause at my cDevice, which is provided by the satip-plugin I have a new finding. the PMT packets are delivered by cSatipDevice::GetTSPacket(). But in the cDevice::Action() they are lost because no attached Receiver returns true for WantsPid().

Some help how to further investigate the problem would really be welcome...

Actions

Also available in: Atom PDF