streaming audio and video with VLCKit

This forum is about all development around libVLC.
kermit666
New Cone
New Cone
Posts: 4
Joined: 01 Oct 2010 20:29

streaming audio and video with VLCKit

Postby kermit666 » 01 Oct 2010 21:36

Hi all!

I am trying to preview an audio-video stream in Cocoa using QTKit. I succeeded in showing the video, but no audio is heard. This is the code I use:

Code: Select all

// Allocate a VLCVideoView instance and tell it what area to occupy rect = NSMakeRect(0, 0, 0, 0); rect.size = [otherPersonView frame].size; otherPersonVLCView = [[VLCVideoView alloc] initWithFrame:rect]; [otherPersonView addSubview:otherPersonVLCView]; [otherPersonVLCView setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable]; otherPersonVLCView.fillScreen = YES; otherPersonPlayer = [[VLCMediaPlayer alloc] initWithVideoView:otherPersonVLCView]; NSString *streamName=@"mystream.sdp"; NSString *otherPersonURL=[NSString stringWithFormat:@"rtsp://%@/%@", ip, streamName]; NSString *myURL=[NSString stringWithFormat:@"rtsp://127.0.0.1/%@", streamName]; //------------------------------- //set stream view [otherPersonPlayer setMedia:[VLCMedia mediaWithURL:[NSURL URLWithString: otherPersonURL]]]; [otherPersonPlayer play];
When I play the stream in VLC I hear audio normally so I'm doing something wrong in the code, probably.

Do I need to do something with VLCAudio? Does the audio stream need to be a separate stream? If so, how would I play only the audio? So far I haven't managed to find much documentation about VLCKit apart from the doxygen generated text.

I tried doing something like this, but it also didn't work:

Code: Select all

VLCAudio *audio = [[VLCAudio alloc] init]; audioPlayer = [[VLCMediaPlayer alloc] init]; NSString *someRadio = [NSString stringWithFormat:@"http://4353.live.streamtheworld.com:80/WQHTFMAACCMP3"]; //------------------------------- //set audio view [audioPlayer setMedia:[VLCMedia mediaWithURL:[NSURL URLWithString: someRadio]]]; [audioPlayer play];
If nobody knows how to do it in VLCKit, libvlc would maybe also be useful.

Thanks in advance!
Drazen

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: streaming audio and video with VLCKit

Postby Jean-Baptiste Kempf » 11 Oct 2010 00:31

Can you share the messages?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kermit666
New Cone
New Cone
Posts: 4
Joined: 01 Oct 2010 20:29

Re: streaming audio and video with VLCKit

Postby kermit666 » 12 Oct 2010 21:47

Sure!

Once the program starts playing the stream, it prints this line repeatedly for the first few seconds (and then stops printing anything for the rest of the duration):
"number of reference frames exceeds max (probably corrupt input), discarding one"

I don't know if those are all the messages I can get. Is there maybe a way to get verbose output or to see some logs?

The stream is rtsp and is outputed by the Darwin Streaming Server and the Quick Time Broadcaster (though I plan to switch to VLC completely once I find the time to learn more about streaming in VLC; QT Broadcaster is very unstable). VLC player can play both the video and the audio.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: streaming audio and video with VLCKit

Postby Jean-Baptiste Kempf » 13 Oct 2010 01:15

-vvv to get verbose
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kermit666
New Cone
New Cone
Posts: 4
Joined: 01 Oct 2010 20:29

Re: streaming audio and video with VLCKit

Postby kermit666 » 13 Oct 2010 12:28

Here is the complete -vvv output I get from opening the stream in VLC, letting it play for a few seconds and closing it (I got a seg fault when I closed it - that sometimes happens when I run VLC from terminal and try to close it with ctrl+C):

http://pastebin.com/3ebLpLv1


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests