Page 1 of 1

Tutorial - how to stream video to Nokia S60 phone

Posted: 13 Feb 2007 22:36
by wolfx
Most of questions in this forum are not answered. To make this forum more useful, let's share our knowlege here. After long time study, I finnally managed to stream video to Nokia S60 phone (Nokia N95). I tried to stream video from PC to mobile phone and from Dreambox(my satellite receiver) to mobile phone. The video and audio quality is amazingly good.

I don't know how useful this is. Maybe you can watch football matches in your office using your company's WLAN.

To do this, I used VideoLan media player as transcoder and Darwin Stream Server as streaming server. The command line to launch VideoLan is


Code: Select all

call "C:\Program Files\VideoLAN\VLC\vlc.exe" s2.divx :sout=#transcode{vcodec=mp4v,vb=1024,acodec=mp4a,ab=64,channels=2,audio-asyn,width=320,height=240}:rtp{dst=127.0.0.1,port=1234,sdp=file://"C:\Program Files\Darwin Streaming Server\Movies\test.sdp"} --aspect-ratio=width:height


For more details, you may check my website at
http://s60.webhop.org

So far, I haven't been able to stream from pplive(one of p2p TV) to my Dreambox. If you have any hint please let me know. [/url][/code]

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 19 Mar 2008 14:38
by yohann.martineau
hi,

I've been able to stream a video to my n95, but i cannot get sound on it, when i use this command:

Code: Select all

./vlc -I dummy -L file:///home/d2cs/media/in/livebox.flv --sout='#transcode{vcodec=mp4v,vb=1024,acodec=mp3lame,ab=64,channels=2,width=320,height=240}:rtp{dst=172.20.2.181,port=1234,sdp=file:///home/d2cs/media/out/test.sdp}'
I have the following messages:

Code: Select all

VLC media player 0.8.6d Janus [00000366] dummy interface: using the dummy interface module... [00000370] stream_out_transcode private error: cannot find encoder ((null)) [00000370] stream_out_transcode private error: cannot create audio chain [00000378] main packetizer error: cannot create packetizer output (mp3 ) signal 2 received, terminating vlc - do it again in case it gets stuck [00000362] main playlist: stopping playback
I have tried with codecs mp4a, mp3, mp3lame, faac, mp2a

any idea ?

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 19 Mar 2008 16:21
by yohann.martineau
Just forgot to mention anything in my previous post, I'm using vlc to stream to darwin which forwards the stream using the appropriate (h264) rtp payload.
VLC creates a sdp file in /usr/local/movies (the default movies location for darwin streaming server on linux):

Code: Select all

v=0 o=- 1205938892850593 1 IN IP4 127.0.0.1 s=NONE t=0 0 a=tool:vlc 0.8.6a c=IN IP4 127.0.0.1 m=video 1232 RTP/AVP 96 a=rtpmap:96 MP4V-ES/90000 a=fmtp:96 profile-level-id=3; config=000001b001000001b58913000001000000012000c48d8800cd0a041e1463000001b24c61766330642e35312e31312e30; b=AS:1024
Darwin streaming server is detecting this sdp file and it is using information available to setup its input using a network stream. Here, 127.0.0.1:1232 is the input stream.

VLC probably calculates the video output stream port using the "port=1234" parameter. In RTP stream, each media stream generally uses an even number because RTCP streams may be sent on the following odd number (1235). But as there is audio and video, I suppose that VLC attributes this port to the audio stream and put the video on a lower port.
When VLC is killed from console (did not test kill -9 $pid), the output file test.sdp is automatically deleted from the file system.

Regarding my previous problem, I modified my input file using ffmpeg to avoid mp3-related issues:

Code: Select all

$ ffmpeg -i in/flv/bourneultimatum.flv -vcodec copy -acodec ac3 out/mpg/bourneultimatum2.mpg FFmpeg version SVN-r12420, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --enable-gpl --enable-libmp3lame --enable-libx264 --enable-pthreads --enable-libfaac libavutil version: 49.6.0 libavcodec version: 51.51.0 libavformat version: 52.9.0 libavdevice version: 52.0.0 built on Mar 12 2008 17:41:55, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001) Input #0, flv, from 'in/flv/bourneultimatum.flv': Duration: 00:01:20.4, start: 0.000000, bitrate: 8 kb/s Stream #0.0: Video: flv, yuv420p, 320x240, 29.97 tb(r) Stream #0.1: Audio: mp3, 22050 Hz, mono, 8 kb/s File 'out/mpg/bourneultimatum2.mpg' already exists. Overwrite ? [y/N] y Output #0, mpeg, to 'out/mpg/bourneultimatum2.mpg': Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 1000.00 tb(c) Stream #0.1: Audio: ac3, 22050 Hz, mono, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Press [q] to stop encoding frame= 2411 fps= 0 q=-1.0 Lsize= 3196kB time=80.0 bitrate= 327.1kbits/s video:2537kB audio:625kB global headers:0kB muxing overhead 1.059289%
Now when I stream using vlc, I have no error message:

Code: Select all

$ vlc -L -I dummy ~d2cs/media/out/mpg/bourneultimatum2.mpg --sout='#transcode{vcodec=mp4v,vb=1024,acodec=mp4a,ab=64,channels=2,width=320,height=240}:rtp{dst=127.0.0.1,port=1234,sdp=file:///usr/local/movies/test.sdp}' VLC media player 0.8.6a Janus [00000285] dummy interface: using the dummy interface module...
But no test.sdp file is created...

the same command line with -v gave me nothing interesting...

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 19 Mar 2008 16:29
by yohann.martineau
but the -vv option gave me more details:

Code: Select all

[00000351] main packetizer debug: looking for packetizer module: 17 candidates [00000351] main packetizer debug: using packetizer module "packetizer_mpegvideo"[00000294] main input debug: stream out mode -> no decoder thread [00000312] ps demuxer debug: es id=0xbd04 format unknown [00000312] ps demuxer debug: es id=0xbdc4 format unknown [00000369] main packetizer debug: looking for packetizer module: 17 candidates [00000369] main packetizer debug: using packetizer module "dts" [00000294] main input debug: stream out mode -> no decoder thread [00000312] ps demuxer debug: es id=0xbd73 format unknown [00000312] ps demuxer debug: es id=0xbdb8 format unknown
and then, many "ps demuxer debug: es id=0xbdXX format unknown"... do you think I should care with those messages ?
should i try with 0.9.0-SVN version ?

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 24 Mar 2008 03:25
by antonylord
a) What app are your using on your N95 to play the stream?
b) Can you do a multicast (as I've done to other PCs in the building) and just open a network address on the phone?

Cheers, Antony.

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 26 Mar 2008 16:57
by yohann.martineau
a) What app are your using on your N95 to play the stream?
real player, i open rtsp streams using streaming links:

Menu > Media > Gallery > Options > New Link > Phone Memory:

Name: VLC + Darwin
Web address: rtsp://172.20.2.181:5556/test7.sdp

I also tried with the S60 simulator, but I have the same problem.
b) Can you do a multicast
Do you mean I should try something like that:

Code: Select all

./vlc -I dummy -L file:///home/d2cs/media/in/livebox.flv --sout='#transcode{vcodec=mp4v,vb=1024,acodec=mp3lame,ab=64,channels=2,width=320,height=240}:rtp{dst=232.0.1.50,port=1234,sdp=file:///home/d2cs/media/out/test.sdp}'
Here, media packets would be sent via a multicast address between vlc and darwin streaming server, but not between darwin and n95. well, I have to check the generated sdp file...
(as I've done to other PCs in the building)
Sorry, could you give me more details ?
and just open a network address on the phone?
just to confirm: the same rtsp address, not a mulicast rtsp address? because i don't know if it's possible to open rtsp via multicast (rtsp, for rtp we both know that it should be ok)

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 31 Mar 2008 17:10
by yohann.martineau
oh, finally I fixed it, here is what I have done:
download, configure, compile and install the following libraries with default options:
  • mp3lame, version 3.97
  • faac, version 1.26
  • faad2, version 2.6.1
  • x264, svn version 2245 (snapshot archive from 2008-03-27)
ffmpeg
  • download ffmpeg with svn version 12618 (I used the complete svn snapshot archive from 2008-03-28). http://ffmpeg.mplayerhq.hu/download.html
  • configure ffmpeg with the following options:

    Code: Select all

    ./configure --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-zlib --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libfaad
  • build and install ffmpeg
vlc
  • download vlc source code, version 0.8.6e
  • install dependencies (with development packages containing headers), for me, the following libraries were lacking:
    • libmad...-dev
    • libmpeg2...-dev
    • libdvbpsi...-dev
  • configure vlc with the following options:

    Code: Select all

    ./configure --enable-ffmpeg --with-ffmpeg-tree=/usr/local/src/ffmpeg-checkout-2008-03-28/ --with-ffmpeg-mp3lame --with-ffmpeg-zlib --with-ffmpeg-faac --enable-mostly-builtin --enable-dvb --enable-x264 --with-x264-tree=/usr/local/src/x264-snapshot-20080327-2245/ --disable-wxwidgets --disable-skins2 --enable-debug --enable-faad --with-faad-tree=/usr/local/src/faad2/
    Of course, this command line must be updated with your actual paths.
  • build vlc
Then, you have to start darwin streaming server as user qtss:
/usr/local/sbin/DarwinStreamingServer

Now, you can start vlc.
run the following command to stream a video to your loopback address, and specifying an sdp output file to describe the audio and video streams:

Code: Select all

./vlc -I dummy -L /path/to/file/livebox.flv --sout='#transcode{vcodec=mp4v,vb=1024,width=320,height=240,acodec=mp4a}:rtp{dst=127.0.0.1,port=1234,sdp=file:///usr/local/movies/test.sdp}'
Here, /usr/local/movies is important because it is the directory where darwin streaming server is "listening" for new video files.

Now you can use your N95 to open the following streaming link:

rtsp://your.darwin.ip.address:5556/test.sdp

I configured darwin at installation to run on port 5556 on my system to avoid root privileges requirement.

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 01 Apr 2008 17:41
by hihi
hi, I'm trying the same with a Windows XP as server and a Nokia E51 as client, result:

RealPlayer : connection failed

so I cannot open a stream
is there a link on the web where I can test my nokia settings?

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 03 Apr 2008 13:48
by yohann.martineau
Can you first try to launch a web server on your xp box and then browse a simple page from your nokia on your web server ?

This is just to validate your wifi connection parameters.
Note that I had to go in menu settings > connectivity > wifi > add a connection manually to connect my n95 on my uncrypted local wifi access point.

But I don't know if Eseries family supports the same RTSP stacks and codecs implementation... Is real player available on your mobile phone ?

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 03 Apr 2008 15:01
by hihi
Hi Yohann,

I can browse with my Nokia to a webpage on my XP webserver so the connection is ok

real player is available on my phone Ver: s60.31.33.01 A6 from 13 august 2007

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 10 Apr 2008 11:47
by yohann.martineau
can you make a network capture between your phone and your computer (with wireshark, for example) ? Thus you could check if rtsp messages are going from darwin streaming server to your mobile phone.

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 15 Jan 2009 22:40
by cesco
dear wolfx can you pls tell me where i can find a good tutorial how to install vlc on my nokia n95, cannot manage to find a good one !!!:(
thanks in advacne for your help
rgds
cesco

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 15 Jan 2009 22:52
by doriansari
Dear Wolfx,

I noticed that you're using a video bitrate of 1024kbps (vb=1024). This is too high for 3g cell network (unless you're stringing to your Nokia S60 using WiFi). Do you transcode this down to 200-300kbps somewhere later in your pipeline?

Thanks

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 19 Oct 2009 11:24
by yohann.martineau
hi,

I was using wifi for video streaming, so I didn't transcode later to lower bitrate.

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 25 Nov 2009 18:51
by lunatictr
Hi guys.
I'm trying to stream my webcam to my nokia e65 ( s60 v3 ) via VLC media player.
platform: windows vista

here's the batch script to stream in rtsp

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="15" --sout-transcode-aenc="ffmpeg" --sout-transcode-acodec="mp4a" --sout-rtp-mp4a-latm --sout-transcode-ab="32" --sout-transcode-samplerate="16000" --sout-transcode-channels="2"
the thing is, I can recieve this rtsp stream with quicktime player on windows, but I cannot reach it by my cell phone
and here's the java code for playing rtsp stream in my cell phone

Code: Select all

import javax.microedition.lcdui.Alert; import javax.microedition.lcdui.AlertType; import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.Graphics; import javax.microedition.media.Manager; import javax.microedition.media.Player; import javax.microedition.media.PlayerListener; import javax.microedition.media.control.VideoControl; public class VideoCanvas extends Canvas implements PlayerListener, CommandListener { private Command start; private Command stop; private Command back; private Command exit; private Command rotateLeft; private Command rotateRight; private String url; private String status; private String status2; private Player player; private VideoControl control; public VideoCanvas(String url) { start = new Command("Start",Command.OK,0); stop = new Command("Stop",Command.OK,0); back = new Command("Back",Command.OK,0); exit = new Command("Exit",Command.BACK,0); rotateLeft = new Command("Turn Camera Left",Command.OK,0); rotateRight = new Command("Turn Camera Right",Command.OK,0); status = "Press left softkey"; status2 = ""; player = null; control = null; this.url = url; addCommand(start); addCommand(rotateLeft); addCommand(rotateRight); addCommand(stop); addCommand(back); addCommand(exit); setCommandListener(this); this.setFullScreenMode(true); } public void commandAction(Command c, Displayable arg1) { if(c == start) { start(); } else if(c == stop) { stop(); } else if(c == exit) { Main.midlet.notifyDestroyed(); } else if(c == back) { Main.mobileDisplay.setCurrent(Main.loginForm); } else if (c==rotateLeft) { RotateCamera rotateCameraObject = new RotateCamera("ROTATELEFT"); Thread rotateCameraThread = new Thread(rotateCameraObject); rotateCameraThread.start(); } else if (c==rotateRight) { RotateCamera rotateCameraObject = new RotateCamera("ROTATERIGHT"); Thread rotateCameraThread = new Thread(rotateCameraObject); rotateCameraThread.start(); } } protected void paint(Graphics g) { g.setColor(255,255,255); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(0,0,0); g.drawString(status2,0,0,Graphics.LEFT|Graphics.TOP); g.drawString(status,getWidth(),getHeight(),Graphics.RIGHT|Graphics.BOTTOM); } public void start() { try { player = Manager.createPlayer(url); player.addPlayerListener(this); player.realize(); // Grab the video control and set it to the current display. control = (VideoControl)player.getControl("VideoControl"); if (control != null) { control.initDisplayMode(VideoControl.USE_DIRECT_VIDEO,this); control.setDisplaySize(176,144); int width = control.getSourceWidth(); int height = control.getSourceHeight(); status2 = "Before: SW=" + width + "-SH=" + height + "-DW=" + control.getDisplayWidth() + "-DH=" + control.getDisplayHeight(); } player.start(); } catch(Exception e) { Alert erro = new Alert("Erro",e.getMessage(),null,AlertType.ERROR); Main.mobileDisplay.setCurrent(erro); } } public void stop() { if(player != null) { player.deallocate(); player.close(); } } public void playerUpdate(Player p, String s, Object o) { status = s; if(p.getState() == Player.STARTED) { int width = control.getDisplayWidth(); int height = control.getDisplayHeight(); control.setDisplayLocation((getWidth() - width)/2,(getHeight() - height)/2); control.setVisible(true); status = s + ": DW=" + width + "-DH=" + height + "-SW=" + control.getSourceWidth() + "-SH=" + control.getSourceHeight(); } repaint(); setTitle(status); } }

anyone has any idea why it doesn't work ?

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 26 Nov 2009 12:17
by alexferri
Why don't you try 1AVStreamer? It will do the same as VLC but without the hassle. All you have to do is copy and paste the broadcast URL, or have it e-mailed to you.

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 26 Nov 2009 14:55
by lunatictr
because I'm doing my final year project at university, an academic work, and as a student I have to implement this kind of project, not spend money on some already implemented kind of project like this.

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 26 Nov 2009 18:36
by alexferri
Oh, I see. Good luck with your project.

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 19 Apr 2011 19:18
by no1
How's the project coming along?

Re: Tutorial - how to stream video to Nokia S60 phone

Posted: 19 Apr 2011 20:45
by lunatictr
Project had been finished 1,5 year ago. I succeeded at it.