Receiving MPG2 Program Stream via RTP

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
mdnight41
New Cone
New Cone
Posts: 3
Joined: 27 May 2009 21:00

Receiving MPG2 Program Stream via RTP

Postby mdnight41 » 27 May 2009 21:10

I am working on a software application that streams an MPG2 program stream from a proprietary linux based system to a PC. The PC based application that receives the video is currently set up to use VLC. I have some questions about how the RTP header should be configured.

1) What RTP payload type should be used. RFC-3551 uses type 32 for MPG2 elementary video stream and type 33 for MPG2 Transport Stream but does not define what to use for MPG2 Program Stream. I have seen other forum post that indicate that 96 should be used, however, this is a dynamically defined type in RFC-3551 so I wasn't sure if it was the best type to use.

2) When should the marker bit be set. According to RFC-2550 the M bit should only be set whenever the time stamp is discontinuous from the last packet. When streaming an elementary stream, the marker bit was set whenever the last RTP packet of a frame was transmitted. Does VLC expect this same behavior for the marker bit when transmitting a program stream?

Rémi Denis-Courmont
Developer
Developer
Posts: 15336
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Receiving MPG2 Program Stream via RTP

Postby Rémi Denis-Courmont » 28 May 2009 16:36

Yes, a dynamic payload type is needed. It does not really matter what value, so long as it is consistent with the SDP. I think VLC ignores the M bit.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mdnight41
New Cone
New Cone
Posts: 3
Joined: 27 May 2009 21:00

Re: Receiving MPG2 Program Stream via RTP

Postby mdnight41 » 01 Jun 2009 15:24

Thanks for the response, however, I am still not able to get VLC to play the MPG2 program stream that I am sending. I am using a payload type of 96 and I suspect that VLC does not know what a type 96 is and therefore, doesn't know what to do with the packets once they have been received by the RTP layer. I used your comment about "being consistent with the SDP" to look up what exactly an SDP is, however, I am not sure how to get VLC to read it, so one more question.

1) How do I get VLC to understand that the payload type 96 is an MPG2 program stream?

Rémi Denis-Courmont
Developer
Developer
Posts: 15336
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Receiving MPG2 Program Stream via RTP

Postby Rémi Denis-Courmont » 01 Jun 2009 20:44

You must "open" the SDP. (You cannot use the rtp:// syntax for dynamic types)
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mdnight41
New Cone
New Cone
Posts: 3
Joined: 27 May 2009 21:00

Re: Receiving MPG2 Program Stream via RTP

Postby mdnight41 » 02 Jun 2009 15:28

I am new to VLC so forgive my ignorance of the proper syntax to receive the stream, but here is the command line I am using to invoke VLC:

Code: Select all

vlc -vvv file://c:\transfer\streaming\mobile.sdp
and here is the contents of mobile.sdp

Code: Select all

v=0 o=- 10000 1 IN IPV4 10.1.8.2 s=mstream c=IN IPV4 10.1.8.2 t=0 0 m=video 1234 RTP/AVP 96 a=rtpmap:96 MP2P/90000 a=framerate:30
When I launch this command, the VLC player opens, however, no video is displayed. So here are the questions.

1) Are the contents of the mobile.sdp file correct? Do I need an m=audio line also even though the program stream contains both audio and video?
2) When I play the video file directly using VLC to play the file, it plays without errors, however, when I play the received stream there are numerous errors displayed, see the message log below. Is the problem the video that is being streamed or is it the SDP or is it the way VLC is being launched? If the video is the problem, can you take a look at it and let me know what is wrong?

Code: Select all

main debug: CPU has capabilities 486 586 MMX MMXEXT SSE SSE2 FPU main debug: looking for memcpy module: 3 candidates main debug: using memcpy module "memcpymmxext" main debug: thread 4568 (Interaction control) created at priority 0 (../../src/interface/interaction.c:382) main debug: thread started main debug: Creating an input for 'Media Library' main debug: Input is a meta file: disabling unneeded options main debug: `file/xspf-open://C:\Documents and Settings\MarkNightingale\Application Data\vlc\ml.xspf' gives access `file' demux `xspf-open' path `C:\Documents and Settings\MarkNightingale\Application Data\vlc\ml.xspf' main debug: creating access 'file' path='C:\Documents and Settings\MarkNightingale\Application Data\vlc\ml.xspf' main debug: looking for access module: 2 candidates access_file debug: opening file `C:\Documents and Settings\MarkNightingale\Application Data\vlc\ml.xspf' main debug: using access module "access_file" main debug: TIMER module_Need() : 2.000 ms - Total 2.000 ms / 1 intvls (Avg 2.000 ms) main debug: Using AStream*Stream main debug: pre-buffering... main debug: received first data for our buffer main debug: creating demux: access='file' demux='xspf-open' path='C:\Documents and Settings\MarkNightingale\Application Data\vlc\ml.xspf' main debug: looking for demux module: 1 candidate playlist debug: using XSPF playlist reader main debug: using demux module "playlist" main debug: TIMER module_Need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) main debug: `file/xspf-open://C:\Documents and Settings\MarkNightingale\Application Data\vlc\ml.xspf' successfully opened main debug: looking for xml module: 2 candidates main debug: using xml module "xml" main debug: TIMER module_Need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) playlist debug: parsed 0 tracks successfully main debug: removing module "xml" main debug: EOF reached main debug: control type=1 main debug: removing module "playlist" main debug: removing module "access_file" main debug: TIMER input launching for 'Media Library' : 7.000 ms - Total 7.000 ms / 1 intvls (Avg 7.000 ms) main debug: waiting for thread initialization main debug: thread started main debug: thread 4644 (preparser) created at priority 0 (../../src/playlist/thread.c:79) main debug: waiting for thread initialization main debug: thread started main debug: thread 4656 (fetcher) created at priority 0 (../../src/playlist/thread.c:108) main debug: waiting for thread initialization main debug: thread started main debug: thread 4652 (playlist) created at priority 0 (../../src/playlist/thread.c:117) main debug: rebuilding array of current - root Playlist main debug: rebuild done - 0 items, index -1 main debug: looking for interface module: 1 candidate main debug: using interface module "hotkeys" main debug: TIMER module_Need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) main debug: thread 4668 (interface) created at priority 0 (../../src/interface/interface.c:168) main debug: thread started main debug: adding item `mobile.sdp' ( file://c:\Transfer\Streaming\mobile.sdp ) main info: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. main debug: looking for interface module: 3 candidates main debug: using interface module "qt4" main debug: TIMER module_Need() : 3.000 ms - Total 3.000 ms / 1 intvls (Avg 3.000 ms) main debug: thread 4816 (interface) created at priority 0 (../../src/interface/interface.c:168) main debug: thread started main debug: starting new item main debug: processing request item null node Playlist skip 0 main debug: rebuilding array of current - root Playlist main debug: rebuild done - 1 items, index -1 main debug: creating new input thread main debug: Creating an input for 'mobile.sdp' main debug: waiting for thread initialization main debug: thread started main debug: thread 4704 (input) created at priority 1 (../../src/input/input.c:370) main debug: `file://c:\Transfer\Streaming\mobile.sdp' gives access `file' demux `' path `c:\Transfer\Streaming\mobile.sdp' main debug: creating demux: access='file' demux='' path='c:\Transfer\Streaming\mobile.sdp' main debug: looking for access_demux module: 1 candidate main warning: no access_demux module matching "file" could be loaded main debug: TIMER module_Need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) main debug: creating access 'file' path='c:\Transfer\Streaming\mobile.sdp' main debug: looking for access module: 2 candidates access_file debug: opening file `c:\Transfer\Streaming\mobile.sdp' main debug: using access module "access_file" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: Using AStream*Stream main debug: pre-buffering... main debug: received first data for our buffer main debug: creating demux: access='file' demux='' path='c:\Transfer\Streaming\mobile.sdp' main debug: looking for demux module: 52 candidates sap debug: SDP origin not supported: - 10000 1 IN IPV4 10.1.8.2 sap warning: invalid SDP live555 debug: RTP subsession 'video/MP2P' main debug: thread 5164 (stream out) created at priority 1 (../../src/input/demux.c:358) live555 debug: setup start: 0 stop:0 live555 debug: play start: 0 stop:0 main debug: using demux module "live555" main debug: thread started main debug: TIMER module_Need() : 17.000 ms - Total 17.000 ms / 1 intvls (Avg 17.000 ms) main debug: creating demux: access='' demux='ps' path='' main debug: looking for a subtitle file in c:\Transfer\Streaming\ main debug: `file://c:\Transfer\Streaming\mobile.sdp' successfully opened main debug: control type=1 main debug: looking for demux module: 2 candidates main debug: using demux module "ps" main debug: TIMER module_Need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) ps debug: es id=0xf8 format unknown main debug: selecting program id=0 ps debug: es id=0xff format unknown qt4 debug: Error while initializing qt-specific localization qt4 debug: Updating the stream status: 3 main debug: looking for decoder module: 34 candidates main debug: using decoder module "mpeg_audio" main debug: TIMER module_Need() : 4.000 ms - Total 4.000 ms / 1 intvls (Avg 4.000 ms) main debug: thread 5236 (decoder) created at priority 2 (../../src/input/decoder.c:217) main debug: thread started mpeg_audio debug: waiting for PTS main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5256 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started ps debug: es id=0xfa format unknown ps debug: es id=0xf4 format unknown main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5296 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started ps debug: es id=0xf5 format unknown ps debug: es id=0xfe format unknown main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5324 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started ps debug: es id=0xf1 format unknown main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5352 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5380 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started ps debug: es id=0xf6 format unknown mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5408 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5436 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5464 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5492 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5520 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started ps debug: es id=0xf3 format unknown ps debug: es id=0xf2 format unknown ps debug: es id=0xfc format unknown ps debug: es id=0xf0 format unknown ps debug: es id=0xf7 format unknown main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5564 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5592 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started ps debug: es id=0xfb format unknown main debug: looking for decoder module: 34 candidates main debug: using decoder module "libmpeg2" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5620 (decoder) created at priority 0 (../../src/input/decoder.c:217) main debug: thread started mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: free bitrate mode mpeg_audio debug: frame too big 977 > 976 (emulated startcode ?) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode (no startcode on following frame) mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode mpeg_audio debug: emulated startcode ps debug: es id=0xf9 format unknown ps debug: es id=0xbd1e format unknown live555 debug: StreamClose main debug: EOF reached main debug: finished input main debug: dying input qt4 debug: Updating the stream status: 8 main debug: dying input main debug: dying input main debug: dying input main debug: thread ended main debug: thread times: real 0m8.843806s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5164 joined (../../src/input/demux.c:385) main debug: removing module "mpeg_audio" main debug: thread ended main debug: thread times: real 0m8.750056s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5236 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpga', 0 PES in FIFO main debug: looking for decoder module: 34 candidates main debug: using decoder module "mpeg_audio" main debug: TIMER module_Need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) main debug: thread 5232 (decoder) created at priority 2 (../../src/input/decoder.c:217) main debug: thread started main debug: removing module "mpeg_audio" main debug: thread ended main debug: thread times: real 0m0.000000s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5232 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpga', 1 PES in FIFO main debug: looking for decoder module: 34 candidates main debug: using decoder module "mpeg_audio" main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) main debug: thread 5240 (decoder) created at priority 2 (../../src/input/decoder.c:217) main debug: thread started main debug: removing module "mpeg_audio" main debug: thread ended main debug: thread times: real 0m0.000000s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5240 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpga', 1 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m7.015669s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5520 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m5.812537s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5592 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m7.250046s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5436 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m7.343797s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5408 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m4.953156s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5620 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m7.734424s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5352 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m8.750056s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5256 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m5.906287s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5564 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m7.218796s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5464 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m7.734424s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5380 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m8.109426s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5324 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m8.515679s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5296 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: removing module "libmpeg2" main debug: thread ended main debug: thread times: real 0m7.078170s, kernel 0m0.000000s, user 0m0.000000s main debug: thread 5492 joined (../../src/input/decoder.c:248) main debug: killing decoder fourcc `mpgv', 0 PES in FIFO main debug: Program doesn't contain anymore ES main debug: removing module "ps" main debug: removing module "live555" main debug: removing module "access_file" main debug: thread ended main debug: dead input main debug: thread times: real 0m8.859431s, kernel 0m0.093750s, user 0m0.078125s main debug: thread 4704 joined (../../src/playlist/engine.c:244) main debug: TIMER input launching for 'mobile.sdp' : 29.000 ms - Total 29.000 ms / 1 intvls (Avg 29.000 ms) main debug: starting new item main debug: changing item without a request (current 0/1) main debug: nothing to play

Rémi Denis-Courmont
Developer
Developer
Posts: 15336
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Receiving MPG2 Program Stream via RTP

Postby Rémi Denis-Courmont » 02 Jun 2009 17:34

I can't help you. It depends on your setup.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Rémi Denis-Courmont
Developer
Developer
Posts: 15336
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Receiving MPG2 Program Stream via RTP

Postby Rémi Denis-Courmont » 24 Jun 2009 19:11

This is an SDP that VLC (or rather live555) will recognize for MPEG2-PS over RTP:

Code: Select all

v=0 o=- 14838476476135618965 14838476476135618965 IN IP4 camera.example.com s=Example PS stream i=N/A c=IN IP4 192.0.2.1 t=0 0 a=tool:ACME RTSP server a=recvonly a=type:broadcast a=charset:UTF-8 m=video 5004 RTP/AVP 96 b=RR:0 a=rtpmap:96 MP2P/90000
where 192.0.2.1 is the IP address of the receiver and 5004 the destination port of RTP packets. I left RR bandwidth to 0 but if the server is capable of sending RTCP-SR, you should remove that line (b=RR:0).

That being noted, I'm afraid PS over RTP reception is badly broken; I can only get the audio track for an A/V. I do not if this is a problem with my server setup, the VLC client, the live555 library, or just that PS over RTP is fundamentally screwed. MPEG is not really my area of expertise.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 63 guests