Streaming to Real Player Mobile *for newbies*

About encoding, codec settings, muxers and filter usage
Dotslash
New Cone
New Cone
Posts: 9
Joined: 26 Nov 2009 11:08
Location: Johannesburg, South Africa

Streaming to Real Player Mobile *for newbies*

Postby Dotslash » 26 Nov 2009 11:24

Hi,

I'd like to start a quick discusssion/tutorial which explains all the elements of streaming to mobile devices, but in simplified detail.
Lets say the target device is a Nokia S60 device with Real Player mobile, which can play mp4 format and for simplicity lets assume a wifi network and not 3G/GPRS.

Firstly, a couple of quick questions to clarify some concepts:
1. What is the difference between rtp and rtsp?
2. Why stream through rtsp, and not http? Cant my nokia can receive streams through http?
3. Is it possible to use ONLY vlc to perform this streaming operation(without Darwin Streaming Server or Real Media's Helix server)

Concerning the encoding/encapsulation:
To start off, i'd like to get the encoding parameters right. To check this, I can simply use vlc to stream to a file(or just encode a file) with the specified codec and parameters, and then copy the file to the phone's memory and see if the file can be played.
I've tried numerous combinations, but haven't succeeded yet. Please provide a working example, since this is a crucial step.

Once the encoding parameters are correct, please explain the steps to set up a working server briefly

Thanks in advance

lunatictr
New Cone
New Cone
Posts: 9
Joined: 04 Oct 2009 23:22

Re: Streaming to Real Player Mobile *for newbies*

Postby lunatictr » 28 Nov 2009 23:27

1. What is the difference between rtp and rtsp?
2. Why stream through rtsp, and not http? Cant my nokia can receive streams through http?
3. Is it possible to use ONLY vlc to perform this streaming operation(without Darwin Streaming Server or Real Media's Helix server)
hi
I've been working on this scenario for 2,5 months, tried lots of stuff but cannot accomplish anything about this. but at least I can share my experience, it's really hard to find help about this.

1. rtsp is supported by nokia s60 phones, but rtp is not. so that's why you have to stream in rtsp protocol.
2. rtsp = real time streaming protocol , as you can see you can get real time streams with this ( video on demand or live content, I'm working on live content ), http is a transfer based protocol, you can watch video by http protocol also, but in order to do this, first you have to download the video, then watch the video.
3. yes but your computer must not be behind a firewall, at least that was the answer when I asked this question.


Currently I can stream in rtsp protocol by only using vlc media player, I can get the audio from realplayer in my nokia phone, but I cannot get the video. I try it with quicktime on another pc in my WLAN, I can get both audio and video, but streaming to mobile ? have no f.... idea...
Vlc is good cause it can both do the streaming and encoding.

here's my batch script to do the rtsp streaming.

Code: Select all

call "C:\Program Files\VideoLAN\VLC\vlc.exe" dshow://vdev="Chicony USB 2.0 Camera" adev="" -vvv --audio --sout "#transcode:rtp" --sout-rtp-dst="192.168.1.4" --sout-rtp-name="MHSS" --sout-rtp-sdp="rtsp://192.168.1.4:554/webcam.sdp" --sout-transcode-vcodec="mp4v" --sout-transcode-vb="400" --sout-transcode-width="144" --sout-transcode-height="176" --sout-transcode-fps="5" --sout-transcode-aenc="ffmpeg" --sout-transcode-acodec="mp4a" --sout-rtp-mp4a-latm --sout-transcode-ab="32" --sout-transcode-samplerate="16000" --sout-transcode-channels="2"
I'm working on windows vista.I've tried darwin streaming server and vlc together, but I got some problems from darwin streaming server side, it didn't see the relay from vlc ( sdp file was being created, but dss didn't see this ).
I've checked for flash media server, wowza media server, but they are not free, only trials, since I'm a student and working on this case for final year project ( wish I'ld choose something less complicated and easier ), I cannot afford to buy those kind of products.
I've checked real producer and helix server, documentations were poor, or let's say that I cannot find good and understandable tutorials about them, and also streaming url's are too complicated in it.

Last, I'm coding in java for mobile part ( project is a little bit complicated, webcam is on a electric circuit I designed which has a step motor, turns to left or right according to client commands which is listened by server and sent to microcontroller through rs232 serial port etc.etc.), playing rtsp streams in java is also little bit complicated, there are codes that you can find when you search in google, but I couldn't manage them to work.

guess I'll stay in university for a while :) hope these information are useful for you, and someone who did this kind of project can help both of us :)

Dotslash
New Cone
New Cone
Posts: 9
Joined: 26 Nov 2009 11:08
Location: Johannesburg, South Africa

Re: Streaming to Real Player Mobile *for newbies*

Postby Dotslash » 30 Nov 2009 07:50

Hi,

Thanks! I'm sure that will help me. I'll give it another try tonight.
2. rtsp = real time streaming protocol , as you can see you can get real time streams with this ( video on demand or live content, I'm working on live content ), http is a transfer based protocol, you can watch video by http protocol also, but in order to do this, first you have to download the video, then watch the video.
I've used http for live content before, since it was the only protocol i could get windows media player to accept. And I'm still 70% sure the nokia reaplayer can show live feeds through http, since i've opened real-time internet tv links with an http:// link. (But this might just be a rtsp link in disguise?). I'm not 100% sure about this, but its worth looking into.
Currently I can stream in rtsp protocol by only using vlc media player, I can get the audio from realplayer in my nokia phone, but I cannot get the video.
Thats good news(for me anyways). This means we only need to get the video encoding right. I think nokia's realplayer is very fussy when it comes to the right width, size, bitrate, framerate, etc...
And like I said before, I tried numerous different combinations of encoding a video file with vlc, and then copying it on the phone's memory. But I couldnt get the file to open properly.
I think VLC's mp4 codec doesn't produce compatable output for our situation. Maybe its possible to use an external codec?
Last, I'm coding in java for mobile part ( project is a little bit complicated, webcam is on a electric circuit I designed which has a step motor, turns to left or right according to client commands which is listened by server and sent to microcontroller through rs232 serial port etc.etc.), playing rtsp streams in java is also little bit complicated, there are codes that you can find when you search in google, but I couldn't manage them to work.
I'm guessing you're an engineering student? Im final year Electronic Engineer, and we work with those things alot. My project is vehicle tracking using a GPS module and a GPRS module to send/receive data. I can do all kinds of cool stuff already, like switch the car on/off, switch headlights on/off, change radio volume/channel, etc...
This mobile streaming thing is just a side project i'm very interrested in, so i'll also try and help you in any way I can.
But it would be nice if a guru on this forum would help us out...

ILEoo
Developer
Developer
Posts: 91
Joined: 05 Nov 2008 16:29

Re: Streaming to Real Player Mobile *for newbies*

Postby ILEoo » 09 Dec 2009 10:06

1. rtsp is supported by nokia s60 phones, but rtp is not. so that's why you have to stream in rtsp protocol.
Most mobile phones support rtp (even nokia ones ;) you just mixed up on what they are, rtsp is used for signaling stream-data (sdp-files, where stream is basicly) rtp is used to deliver actual stream (video/audio packets).

Http-streaming ain't actually that well supported in mobile-phones. For transcoding something like that could work for you

Code: Select all

--sout="#transcode{vcodec=h264,venc=x264{profile=baseline,level=1.3},vb=240,width=240,height=180,fps=25,acodec=mp4a,ab=64}:rtp{mp4a-latm,sdp=rtsp://0.0.0.0:5554/mystream.sdp}"
that's just that sout-part, you need to define your own input things and stuff, then just try to connect with your mobile to rtsp://you.vlc.ip:5554/mystream.sdp (easiest to make small webpage with that link).

Dotslash
New Cone
New Cone
Posts: 9
Joined: 26 Nov 2009 11:08
Location: Johannesburg, South Africa

Re: Streaming to Real Player Mobile *for newbies*

Postby Dotslash » 03 Jan 2010 15:33

Lunatictr my friend, YOU ARE AWESOME!
Dunno if the other "gurus" on this forum just dont know how to do it, or if they just dont want to help.
But thanks alot! It works 100%.
At last!

Dotslash
New Cone
New Cone
Posts: 9
Joined: 26 Nov 2009 11:08
Location: Johannesburg, South Africa

Re: Streaming to Real Player Mobile *for newbies*

Postby Dotslash » 03 Jan 2010 15:34

hehe, i meant ILEoo. :lol:
But thanks to lunatictr too. :D

Dotslash
New Cone
New Cone
Posts: 9
Joined: 26 Nov 2009 11:08
Location: Johannesburg, South Africa

Re: Streaming to Real Player Mobile *for newbies*

Postby Dotslash » 03 Jan 2010 17:31

Oh, and just a few notes:

-Max resolution of phone: 640x360 (Not supported). The following does work: 240x180 and 320x240
-Bandwidth (audio and video) has to be multiple of 8 (I think), and Nokia moans about insufficient bandwidth if I set my video bw above 1200.

Currently, i am using the following commandline :

Code: Select all

C:\Program Files (x86)\VideoLAN\VLC>vlc.exe dvb-t://frequency=554000000 --sout="#transcode{vcodec=h264,venc=x264{profile=baseline,level=1.3},vb=800,width=320,height=240,fps=25,acodec=mp4a,ab=128}:rtp{mp4a-latm,sdp=rtsp://0.0.0.0:5554/mystream.sdp}"
And it works perfectly.
For those who dont understand :
-South African digital tv (dvb-t) signal on 554Mhz. Change this to your country's freq(in Hz). You can choose the channel later in the gui: Playback->program->channel.
-vb=800 : video bitrate of 800 looks perfect for that resolution on my nokia 5800. Any higher, and my audio starts stuttering for some reason. ab=128 : audio bitrate of at least 128 for good quality sound.

Now i'm just trying to figure out how I can put each channel on that TS on a different sdp or stream.
So i can access Channel 1 on rtsp://myIP:5554/Channel1.sdp, Channel 2 on rtsp://myIP:5554/Channel2.sdp, etc

My tv card is capable of handling each stream on its own, and at the same time, since the software I recieved with it can display up to 6 live channels at the same time.
However, if I open another instance of vlc and open the tv card, the video/audio stutters like crazy on both.
Any help would be appreciated!

Dotslash
New Cone
New Cone
Posts: 9
Joined: 26 Nov 2009 11:08
Location: Johannesburg, South Africa

Re: Streaming to Real Player Mobile *for newbies*

Postby Dotslash » 06 Jan 2010 12:12

I have an idea... but im gonna need some help on this:

I want to open my dvb-t card, and stream the entire Transport Stream over the network. All the channels on that dvb-t frequency.
So when I open the stream on another pc, I can go Playback->program-> and choose the channel. Or something similar to this approach.

The I can open each separate channel in a separate instance of vlc and then stream it again over rtsp to my mobile like mentioned in my above posts.

This is seems like lots of effort to accomplish my goal, but so far it looks like the only way.
The reason for doing it like this is that it seems like only one instance of vlc can open my capture card. And by doing it like this, only one instance uses my capture card to stream all the channels to other vlc instances who choose a channel and then stream it separately over rtsp.

Does this make sense? And is this possible?
I'll continue to go down my dark and lonely road, but some assistance would my very very appreciated! :?

bashar
New Cone
New Cone
Posts: 8
Joined: 08 Apr 2010 19:31

Re: Streaming to Real Player Mobile *for newbies*

Postby bashar » 08 Apr 2010 21:47

I get the RTSP stream to work internally only, if I try to access the RTSP URL from outside the network then it won't work. Did you guys get it to work OUTSIDE the network as well ? and if yes, how ?

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

Re: Streaming to Real Player Mobile *for newbies*

Postby Rémi Denis-Courmont » 10 Apr 2010 09:56

Make sure the server is not firewalled.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Mihakinen
New Cone
New Cone
Posts: 2
Joined: 30 Apr 2010 03:47

Re: Streaming to Real Player Mobile *for newbies*

Postby Mihakinen » 30 Apr 2010 03:52

Hello everyone!

I've been trying ILEoo's suggestion for my Nokia 5800, this is my command-line script:

Code: Select all

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --play-and-stop "C:\temp\test.avi" --sout="#transcode{vcodec=h264,venc=x264{profile=baseline,level=1.3},vb=240,width=240,height=180,fps=25,acodec=mp4a,ab=64}:rtp{mp4a-latm,sdp=rtsp://0.0.0.0:5554/mystream.sdp}, dst=display"
I am running Win 7 Pro x64 and all firewalls are off, my WLAN has no encryption but everytime I try to connect to rtsp://192.168.1.2:5554/mystream.sdp I always get "Unable to connect" from RealPlayer...

What could be wrong?

Thanks!

Mihakinen
New Cone
New Cone
Posts: 2
Joined: 30 Apr 2010 03:47

Re: Streaming to Real Player Mobile *for newbies*

Postby Mihakinen » 30 Apr 2010 03:59

False alarm guys, for some reason after 10 tries it decided to start working... How's that for consistency? :P Might be worth to mention that it works with the firewall on...

wassy
New Cone
New Cone
Posts: 4
Joined: 29 May 2010 01:18

Re: Streaming to Real Player Mobile *for newbies*

Postby wassy » 29 May 2010 01:45

Guys,

I've been toying with the idea of turning my phone into a sort of apple airport equivalent to stream audio to another place in my house. I havent perfected it yet, but I just wanted to say thanks to everyone who has contributed on here. Thanks to you ive got audio streaming from my laptop to my nokia 5800. First step done, now I just need to alter it to stream my whole sound card output and not just individual files so that it won't break if ppl start changing tracks and messing about. Im sure it should be fairly easily done to capture all the output destined for my soundcard? anyway, no time to google it tonight, sleep is calling and dreams of the party im going to throw. :D

Many Thanks

Si

simon272
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Apr 2010 15:38
VLC version: 1.0.1
Operating System: FreeBSD
Contact:

Re: Streaming to Real Player Mobile *for newbies*

Postby simon272 » 08 Aug 2010 01:18

Can't get it working on FreeBSD, any changes in --sout section for my OS ?
... For tests I set firewall to "allow any from any to any", but this is not good solution, so I d like to know which port(s) used.

Thanks!

de_prince
Blank Cone
Blank Cone
Posts: 11
Joined: 09 Aug 2010 06:52

Re: Streaming to Real Player Mobile *for newbies*

Postby de_prince » 09 Aug 2010 07:15

Make sure the server is not firewalled.
I did try that, but, that would be similar to private IP implementation, how to traverse the NAT in public network?

I tried rtsp://stream.zoovision.com/live.sdp to be played in my PC's RealPlayer SP and it worked just fine. However, in S60 it only showed the title "live" so it can not pass through UDP port for the multimedia data, so I think RealPlayer SP can negotiate to use TCP or is it? Or does my S60 need to open port:554? Since in RealPlayer setting I can only set to 1024 as the lowest UDP port opened.

I am trying to force VLC streaming server to connect to whatever port/protocol available in S60 RealPlayer, but how to do that? I captured the communication between server (VLC) and S60 (my E63 Nokia phone) by using Wireshark, and that led me to httpd.c in src folder, this is (I think) where TCP negotiation begins for RTSP. How does this work? And what other things that I need to take into consideration?

This would be the problem http://discussion.forum.nokia.com/forum ... post477089

anyone tried this for your public network? viewtopic.php?f=4&t=32290&hilit=s60

some info, http://www.ietf.org/mail-archive/web/mm ... 04457.html http://www.yourmuze.fm/forum-topic/noki ... -the-phone

In advance I thank thee.

simon272
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Apr 2010 15:38
VLC version: 1.0.1
Operating System: FreeBSD
Contact:

Re: Streaming to Real Player Mobile *for newbies*

Postby simon272 » 09 Aug 2010 20:28

I got it work! but it works very strange... I have FreeBSD based Internet gateway with VLC streaming server (24/7 streaming). Server have 2 physical interfaces (LAN and WAN), LAN interface have two IP's 192.168.0.1 and 192.168.0.15 (...please don't ask me for - long story). WAN interface have dedicated IP address.
Firewall allow any connections (TCP and UDP) from/to 192.168.0.0/24 subnet via LAN interface. WAN interface firewalled and only several ports open (http, videolan-http, ssh), also TCP/UDP 554 port open. Also any connection from this server to any host is allowed. In this configuration HTTP streaming works fine (8080 port).

VLC args: transcode{vcodec=mp4v,width=192,height=144,vb=400,fps=20,acodec=mp4a,ab=32,channels=1}:rtp{mp4a-latm,sdp=rtsp://0.0.0.0:554/live.sdp}"

I can watch this stream on any computer in local network, but can't via Internet.
whet I open 'rtsp://192.168.0.15/live.sdp' in VLC player RTSP-server opens several connections:
tcp4 0 0 192.168.0.15.rtsp 192.168.0.253.3845 ESTABLISHED
udp4 384 0 192.168.0.1.38100 192.168.0.253.3849
udp4 384 0 192.168.0.1.60535 192.168.0.253.3847
udp4 0 0 192.168.0.1.38099 192.168.0.253.3848
udp4 0 0 192.168.0.1.60534 192.168.0.253.3846

192.168.0.1.38099 - this connection have highest bit rate (close to stream bit rate).

I'm trying to find out which ports additionally used - but no luck, so I unable to make additional firewall rules. Please advice.

Kind regards!
Last edited by simon272 on 09 Aug 2010 20:57, edited 2 times in total.

de_prince
Blank Cone
Blank Cone
Posts: 11
Joined: 09 Aug 2010 06:52

Re: Streaming to Real Player Mobile *for newbies*

Postby de_prince » 09 Aug 2010 20:32

Glad that you are in that level now. Let us see how we can stream through Internet. Keep up posted with your endeavors and successful hacks.

Thanks!

simon272
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Apr 2010 15:38
VLC version: 1.0.1
Operating System: FreeBSD
Contact:

Re: Streaming to Real Player Mobile *for newbies*

Postby simon272 » 09 Aug 2010 20:38

Also I find this table:
Image
But firewall rules based on it don't resolves problem, possible some one get RTSP-server works with firewall :cry: please help !

de_prince
Blank Cone
Blank Cone
Posts: 11
Joined: 09 Aug 2010 06:52

Re: Streaming to Real Player Mobile *for newbies*

Postby de_prince » 10 Aug 2010 06:06

I found an interesting discussion
http://88.191.250.119/viewtopic.php?f=4 ... a75f9f730e

and a resource
http://service.real.com/firewall/fdev.html

and lastly,
http://service.real.com/firewall/adminfw.html

I hope this will lead to solution :)

simon272
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Apr 2010 15:38
VLC version: 1.0.1
Operating System: FreeBSD
Contact:

Re: Streaming to Real Player Mobile *for newbies*

Postby simon272 » 10 Aug 2010 22:35

... So much time spend and no result. RTSP streaming with VLC works great in local network, but not on Internet. Tested more then 1000 times in different configurations of firewall and with out it at all, but no luck. Also I can't play RTSP steam on VLC-player through Internet.If some one can tell me what is so specific in this protocol (RTSP).

Dear Developers! Please advise, what I should change in my scheme to get it worked through Internet.

Kind regards!

P.S. If some one have have link to live RTSP stream (with video of course) which I can test with my 3G Nokia - please let me know.

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

Re: Streaming to Real Player Mobile *for newbies*

Postby Rémi Denis-Courmont » 11 Aug 2010 17:29

You understand that an RTSP server must have a public unfirewalled IP address.You also understand that the RTSP client must either have a public IP address, or be behind a NAT with RTSP ALG support.

It sucks? Well then don't use RTSP.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

de_prince
Blank Cone
Blank Cone
Posts: 11
Joined: 09 Aug 2010 06:52

Re: Streaming to Real Player Mobile *for newbies*

Postby de_prince » 12 Aug 2010 07:54

You understand that an RTSP server must have a public unfirewalled IP address.You also understand that the RTSP client must either have a public IP address, or be behind a NAT with RTSP ALG support.

It sucks? Well then don't use RTSP.
Hi Rémi,

You mentioned in viewtopic.php?f=13&t=71920 that VideoLAN or VLC does not support Interleaved TCP, is this still valid because my experiment with live555MediaServer with Internet environment (firewalled), I know from the packet that the server streams to VLC client with this transport <(RTP/AVP/TCP), unicast, interleaved>. And you can refer to this as well : http://www.wowzamedia.com/forums/showthread.php?t=7871

What is the command to force this RTP over RTSP?

How do you implement this NAT with RTSP ALG support?

Thanks.

simon272
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Apr 2010 15:38
VLC version: 1.0.1
Operating System: FreeBSD
Contact:

Re: Streaming to Real Player Mobile *for newbies*

Postby simon272 » 13 Aug 2010 15:43

You understand that an RTSP server must have a public unfirewalled IP address.You also understand that the RTSP client must either have a public IP address, or be behind a NAT with RTSP ALG support.

It sucks? Well then don't use RTSP.
It really sucks. But this is the only one way to stream video to mobile devices over 3G I found. SO if you can recommend me some thing can replace RTSP I'll appreciate this.

Thanx for reply! Kind regards!

miloo
New Cone
New Cone
Posts: 1
Joined: 20 Aug 2010 16:25

Re: Streaming to Real Player Mobile *for newbies*

Postby miloo » 20 Aug 2010 16:28

You understand that an RTSP server must have a public unfirewalled IP address.You also understand that the RTSP client must either have a public IP address, or be behind a NAT with RTSP ALG support.

It sucks? Well then don't use RTSP.
It really sucks. But this is the only one way to stream video to mobile devices over 3G I found. SO if you can recommend me some thing can replace RTSP I'll appreciate this.

Thanx for reply! Kind regards!
use DSS with vlc-created .sdp file in DSS's media path

de_prince
Blank Cone
Blank Cone
Posts: 11
Joined: 09 Aug 2010 06:52

Re: Streaming to Real Player Mobile *for newbies*

Postby de_prince » 20 Aug 2010 17:45

yes, i did the same. however, the script to write is troublesome, what is the best script for MPEG4 or H264?


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 25 guests