Page 1 of 1

[VLCKit] save rtps stream to ts file not working as it should

Posted: 18 Mar 2015 20:46
by marcus.fritze
Hi,

I use VLCKit and try to create a mac app. I want to save a network stream to a local ts file.

The ts file is created in the correct folder, but the file is only about 150KB and only 1-2 seconds long. But I didn't stopped the recording.

In the example is a rtsp online stream. Normally, I use a local network stream.

When I try to save this example stream (and my local network stream) as a ts file via the VLC.app, this works without any problems. But my code is not working.

Do I miss something?

Here is the code snippet (in Swift language):

Code: Select all

import Cocoa import VLCKit class TestController: NSViewController, VLCMediaPlayerDelegate { var vlcStreamSession:VLCStreamSession! [..] func createTSFile() { var urlString:String = "http://daserste_live-lh.akamaihd.net/i/daserste_de@91204/master.m3u8" var mediaURL:NSURL = NSURL(string: urlString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)!)! var vlcMedia:VLCMedia = VLCMedia(URL: mediaURL) var vlcMediaStream:VLCMedia = VLCMedia(URL: mediaURL) //https://wiki.videolan.org/VLC_command-line_help vlcMedia.addOptions(["network-caching=10000" : NSNull()]) self.vlcStreamSession = VLCStreamSession() self.vlcStreamSession.streamOutput = VLCStreamOutput(filePath: "/Users/marcus/Desktop/vlc-output-app.ts") self.vlcStreamSession.media = vlcMedia self.vlcStreamSession.startStreaming() } }
Any help is appreciated. Thanks

Marcus

Re: [VLCKit] save rtps stream to ts file not working as it should

Posted: 29 Mar 2015 15:51
by marcus.fritze
here is the debug output from xcode:

Code: Select all

[0000000101c0abd8] ts demux debug: pid[5101] unknown [0000000101c0abd8] ts demux debug: pid[5106] unknown [0000000101c0abd8] ts demux debug: pid[5104] unknown [0000000101c0abd8] ts demux debug: PATCallBack called [0000000101c0abd8] ts demux debug: new PAT ts_id=1019 version=11 current_next=1 [0000000101c0abd8] ts demux debug: * number=0 pid=16 [0000000101c0abd8] ts demux debug: * number=10301 pid=5100 [0000000101c0abd8] ts demux debug: temporary receiving program 10301 [0000000101c0abd8] ts demux debug: * number=10302 pid=5110 [0000000101c0abd8] ts demux debug: * number=10303 pid=5120 [0000000101c0abd8] ts demux debug: * number=10304 pid=5130 [0000000101c0abd8] ts demux debug: pid[5102] unknown [0000000101c0abd8] ts demux debug: pid[5103] unknown [0000000101c0abd8] ts demux debug: pid[5105] unknown [0000000101c0abd8] ts demux debug: PMTCallBack called [0000000101c0abd8] ts demux debug: new PMT program number=10301 version=3 pid_pcr=5101 [0000000101c0abd8] ts demux debug: * pid=1170 type=0x5 ISO/IEC 13818-1 private_sections [0000000101c0abd8] ts demux debug: - descriptor tag 0x6f [0000000101c0abd8] ts demux debug: => pid 1170 content is *unknown* [0000000101c0abd8] ts demux debug: * pid=2171 type=0xb ISO/IEC 13818-6 type B [0000000101c0abd8] ts demux debug: - descriptor tag 0x13 [0000000101c0abd8] ts demux debug: - descriptor tag 0x66 [0000000101c0abd8] ts demux debug: - descriptor tag 0x52 [0000000101c0abd8] ts demux debug: => pid 2171 content is *unknown* [0000000101c0abd8] ts demux debug: * pid=5101 type=0x1b ISO/IEC 13818-1 Reserved [0000000101c0abd8] ts demux debug: - descriptor tag 0x52 [0000000101c0abd8] ts demux debug: => pid 5101 has now es fcc=h264 [0000000101c0abd8] ts demux debug: enabling pid 1170 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 2171 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10302 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10303 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10304 [0000000101c0abd8] ts demux debug: * pid=5102 type=0x3 ISO/IEC 11172 Audio [0000000101c0abd8] ts demux debug: - descriptor tag 0x52 [0000000101c0abd8] ts demux debug: - descriptor tag 0xa [0000000101c0abd8] ts demux debug: found language: deu [0000000101c0abd8] ts demux debug: => pid 5102 has now es fcc=mpga [0000000101c0abd8] ts demux debug: enabling pid 1170 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 2171 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5102 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10302 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10303 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10304 [0000000101c0abd8] ts demux debug: * pid=5103 type=0x3 ISO/IEC 11172 Audio [0000000101c0abd8] ts demux debug: - descriptor tag 0x7f [0000000101c0abd8] ts demux debug: - descriptor tag 0x52 [0000000101c0abd8] ts demux debug: - descriptor tag 0xa [0000000101c0abd8] ts demux debug: found language: mis [0000000101c0abd8] ts demux debug: => pid 5103 has now es fcc=mpga [0000000101c0abd8] ts demux debug: enabling pid 1170 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 2171 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5102 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5103 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10302 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10303 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10304 [0000000101c0abd8] ts demux debug: * pid=5104 type=0x6 ISO/IEC 13818-1 PES packets containing private data [0000000101c0abd8] ts demux debug: - descriptor tag 0x52 [0000000101c0abd8] ts demux debug: - descriptor tag 0x56 [0000000101c0abd8] ts demux debug: * ttxt type=Teletext lan=deu page=100 [0000000101c0abd8] ts demux debug: * Stream Component Identifier: 3 [0000000101c0abd8] ts demux debug: => pid 5104 has now es fcc=telx [0000000101c0abd8] ts demux debug: enabling pid 1170 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 2171 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5102 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5103 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5104 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10302 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10303 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10304 [0000000101c0abd8] ts demux debug: * pid=5105 type=0x6 ISO/IEC 13818-1 PES packets containing private data [0000000101c0abd8] ts demux debug: - descriptor tag 0x59 [0000000101c0abd8] ts demux debug: - descriptor tag 0x52 [0000000101c0abd8] ts demux debug: * Stream Component Identifier: 6 [0000000101c0abd8] ts demux debug: => pid 5105 has now es fcc=dvbs [0000000101c0abd8] ts demux debug: enabling pid 1170 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 2171 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5102 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5103 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5104 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5105 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10302 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10303 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10304 [0000000101c0abd8] ts demux debug: * pid=5106 type=0x6 ISO/IEC 13818-1 PES packets containing private data [0000000101c0abd8] ts demux debug: - descriptor tag 0x6a [0000000101c0abd8] ts demux debug: - descriptor tag 0x52 [0000000101c0abd8] ts demux debug: - descriptor tag 0xa [0000000101c0abd8] ts demux debug: * Stream Component Identifier: 17 [0000000101c0abd8] ts demux debug: found language: deu [0000000101c0abd8] ts demux debug: => pid 5106 has now es fcc=a52 [0000000101c0abd8] ts demux debug: enabling pid 1170 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 2171 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5102 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5103 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5104 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5105 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5106 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10302 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10303 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10304 [0000000101c0abd8] ts demux debug: * pid=5108 type=0x6 ISO/IEC 13818-1 PES packets containing private data [0000000101c0abd8] ts demux debug: => pid 5108 content is *unknown* [0000000101c0abd8] ts demux debug: * pid=5172 type=0xb ISO/IEC 13818-6 type B [0000000101c0abd8] ts demux debug: - descriptor tag 0x13 [0000000101c0abd8] ts demux debug: - descriptor tag 0x66 [0000000101c0abd8] ts demux debug: - descriptor tag 0x52 [0000000101c0abd8] ts demux debug: => pid 5172 content is *unknown* [0000000101c0abd8] ts demux debug: enabling pid 1170 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 2171 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5102 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5103 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5104 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5105 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5106 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5108 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5172 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10302 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10303 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10304 [0000000101c0abd8] ts demux debug: Creating delayed ES [00006100001c0ce8] core input debug: selecting program id=10301 [000000010202f0b8] core decoder debug: looking for packetizer module matching "any": 23 candidates [000000010202f0b8] core decoder debug: using packetizer module "h264" [0000000101c0abd8] ts demux debug: Default program is 10301 [0000000102032ab8] core decoder debug: looking for packetizer module matching "any": 23 candidates [0000000102032ab8] copy decoder error: invalid ES type [0000000102032ab8] core decoder debug: no packetizer modules matched [0000000102032ab8] core decoder error: Codec ` ' (No description for this codec) is not supported. [0000000102032ab8] core decoder debug: killing decoder fourcc ` ', 0 PES in FIFO [000000010281ceb8] core decoder debug: looking for packetizer module matching "any": 23 candidates [000000010281ceb8] copy decoder error: invalid ES type [000000010281ceb8] core decoder debug: no packetizer modules matched [000000010281ceb8] core decoder error: Codec ` ' (No description for this codec) is not supported. [000000010281ceb8] core decoder debug: killing decoder fourcc ` ', 0 PES in FIFO [000000010281ceb8] core decoder debug: looking for packetizer module matching "any": 23 candidates [000000010281ceb8] core decoder debug: using packetizer module "mpeg_audio" [000000010281a2b8] core decoder debug: looking for packetizer module matching "any": 23 candidates [000000010281a2b8] core decoder debug: using packetizer module "mpeg_audio" [000000010281d4b8] core decoder debug: looking for packetizer module matching "any": 23 candidates [000000010281d4b8] core decoder debug: using packetizer module "copy" [000000010281dab8] core decoder debug: looking for packetizer module matching "any": 23 candidates [000000010281dab8] core decoder debug: using packetizer module "a52" [000000010506cab8] core decoder debug: looking for packetizer module matching "any": 23 candidates [000000010506cab8] copy decoder error: invalid ES type [000000010506cab8] core decoder debug: no packetizer modules matched [000000010506cab8] core decoder error: Codec ` ' (No description for this codec) is not supported. [000000010506cab8] core decoder debug: killing decoder fourcc ` ', 0 PES in FIFO [000000010506cab8] core decoder debug: looking for packetizer module matching "any": 23 candidates [000000010506cab8] copy decoder error: invalid ES type [000000010506cab8] core decoder debug: no packetizer modules matched [000000010506cab8] core decoder error: Codec ` ' (No description for this codec) is not supported. [000000010506cab8] core decoder debug: killing decoder fourcc ` ', 0 PES in FIFO [0000000101c0abd8] ts demux debug: enabling pid 1170 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 2171 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5102 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5103 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5104 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5105 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5106 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5108 from program 10301 [0000000101c0abd8] ts demux debug: enabling pid 5172 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 5101 from program 10301 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10302 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10303 [0000000101c0abd8] ts demux debug: enabling pcr pid 8191 from program 10304 [0000000101c0abd8] ts demux warning: first packet for pid=5101 cc=0xe [0000000101c0abd8] ts demux warning: first packet for pid=5106 cc=0x6 [0000000101c0abd8] ts demux warning: first packet for pid=5102 cc=0x4 [0000000101c0abd8] ts demux warning: first packet for pid=5103 cc=0x4 [00006100001c0ce8] core input debug: Buffering 0% [00006100001c0ce8] core input debug: switching to async mode [0000000101c0abd8] ts demux warning: first packet for pid=5104 cc=0x2 [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 3% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 6% [00006100001c0ce8] core input debug: Buffering 9% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 12% [000000010281ceb8] mpeg_audio decoder debug: MPGA channels:2 samplerate:48000 bitrate:256 [000000010281a2b8] mpeg_audio decoder debug: MPGA channels:2 samplerate:48000 bitrate:256 [0000000100718c48] core stream output debug: adding a new sout input (sout_input:0x6200000295e0) [0000000100718c48] core stream output debug: adding a new sout input (sout_input:0x638000032520) [0000000104f62f28] core mux debug: adding a new input [0000000104f62f28] ps mux debug: adding input codec=mpga [0000000104f62f28] ps mux debug: - lang=deu [0000000104f62f28] core mux debug: adding a new input [0000000104f62f28] ps mux debug: adding input codec=mpga [00006100001c0ce8] core input debug: Buffering 15% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010281dab8] a52 decoder debug: A/52 channels:6 samplerate:48000 bitrate:448000 [0000000100718c48] core stream output debug: adding a new sout input (sout_input:0x600000028d00) [0000000104f62f28] core mux debug: adding a new input [0000000104f62f28] ps mux debug: adding input codec=a52 [0000000104f62f28] ps mux debug: - lang=deu [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 18% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 21% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 24% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 27% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 30% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 33% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [0000000101c0abd8] ts demux warning: first packet for pid=5105 cc=0x8 [00006100001c0ce8] core input debug: Buffering 36% [00006100001c0ce8] core input debug: Buffering 39% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 42% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 45% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 46% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [00006100001c0ce8] core input debug: Buffering 48% [00006100001c0ce8] core input debug: Buffering 51% [00006100001c0ce8] core input debug: Buffering 54% [000000010202f0b8] h264 decoder warning: waiting for SPS/PPS [000000010202f0b8] h264 decoder debug: found NAL_SPS (sps_id=0) [000000010202f0b8] h264 decoder debug: found NAL_PPS (pps_id=0 sps_id=0) [000000010202f0b8] h264 decoder debug: Seen SEI recovery point, 0 recovery frames [00006100001c0ce8] core input debug: Buffering 56% [00006100001c0ce8] core input debug: Buffering 60% [000000010202f0b8] h264 decoder debug: Recovery from SEI recovery point complete [0000000100718c48] core stream output debug: adding a new sout input (sout_input:0x628000020120) [0000000104f62f28] core mux debug: adding a new input [0000000104f62f28] ps mux debug: adding input codec=h264 [00006100001c0ce8] core input debug: Buffering 63% [00006100001c0ce8] core input debug: Buffering 65% [00006100001c0ce8] core input debug: Buffering 69% [00006100001c0ce8] core input debug: Buffering 72% [00006100001c0ce8] core input debug: Buffering 75% [00006100001c0ce8] core input debug: Buffering 78% [00006100001c0ce8] core input debug: Buffering 81% [00006100001c0ce8] core input debug: Buffering 83% [00006100001c0ce8] core input debug: Buffering 87% [00006100001c0ce8] core input debug: Buffering 90% [00006100001c0ce8] core input debug: Buffering 93% [00006100001c0ce8] core input debug: Buffering 96% [00006100001c0ce8] core input debug: Buffering 99% [00006100001c0ce8] core input debug: Stream buffering done (1020 ms in 750 ms) [00006100001c0ce8] core input debug: Decoder wait done in 0 ms
It seems that no codec is found in the stream???!!

I have no idea what the error is.