Editing Streaming video from built-in webcam
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
- | + | {{Midgard article}} | |
- | + | It is possible to use the N800 camera as a source of streaming video. This was originally described [https://maemo.org/community/wiki/howtostreamvideo/ here], but the referenced example has an error which prevents it working. | |
- | + | This note describes how to stream video from the platform to an RTP sink, for example the [https://maemo.org/community/wiki/howtostreamvideo/ vlc] media player. | |
- | + | ||
- | This note describes how to stream video from the platform to an RTP sink, for example the [ | + | |
First, you must install the '''gstreamer-tools''' package from the diablo repo on repository.maemo.org. | First, you must install the '''gstreamer-tools''' package from the diablo repo on repository.maemo.org. | ||
- | + | # On the N800, the following script will stream video from the camera. Here, 172.31.0.244 is the Linux box with VLC installed, and 172.31.0.245 is the N800. I call this script <tt>~/bin/rtpstream.sh</tt>.<br/> <tt><nowiki>#!/bin/sh</nowiki></tt><br/> | |
- | + | <tt>VPORT=5434</tt><br/> <tt>APORT=5432</tt><br/> <tt>HOST=${1:-172.31.0.244}</tt><br/> | |
- | + | <tt>gst-launch-0.10 v4l2src ! \</tt><br/> <tt>video/x-raw-yuv,width=176,height=144,framerate=\(fraction\)15/1 ! \</tt><br/> <tt>hantro4200enc stream-type=1 profile-and-level=1001 ! \</tt><br/> <tt>video/x-h263,framerate=\(fraction\)15/1 ! rtph263ppay mtu=1438 ! \</tt><br/> <tt>udpsink host=$HOST port=$VPORT dsppcmsrc ! queue ! \</tt><br/> <tt>audio/x-raw-int,channels=1,rate=8000 ! mulawenc ! rtppcmupay mtu=1438 ! \</tt><br/> udpsink host=$HOST port=$APORT | |
- | + | # On the Linux box, the sample .sdp file from [http://web.media.mit.edu/%7Elifton/snippets/n800_to_sl/ the original article], with the address of our VLC player, saved as a file i.e. <tt>/tmp/n800.sdp</tt><br/> <tt>v=0</tt><br/> <tt>o=- 37 614155991 IN IP4 127.0.0.0</tt><br/> <tt>s=QuickTime</tt><br/> <tt>t=0 0</tt><br/> <tt>a=range:npt=now-</tt><br/> <tt>m=audio 5432 RTP/AVP 0</tt><br/> <tt>c=IN IP4 172.31.0.245</tt><br/> <tt>b=AS:63</tt><br/> <tt>m=video 5434 RTP/AVP 96</tt><br/> <tt>c=IN IP4 172.31.0.245</tt><br/> <tt>a=rtpmap:96 H263-2000/90000</tt><br/> <tt>a=fmtp:96 </tt><br/> <tt>a=cliprect:0,0,144,176</tt><br/> a=framesize:96 176-144 | |
- | + | # On the N800, pop out the camera and run:<br/> $ ~/bin/rtpstream.sh # assume on PATH, +x etc. | |
- | + | # On Linux box (note VLC runs on other platforms as well):<br/> $ vlc /tmp/n800.sdp | |
- | + | # Enjoy streaming video (and sound) from the N800. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | a=framesize:96 176-144 | + | |
- | + | ||
- | $ ~/bin/rtpstream.sh | + | |
- | assume on PATH, +x etc. | + | |
- | + | ||
- | $ vlc /tmp/n800.sdp | + | |
- | + | ||
- | + | ||
Thanks to [http://web.media.mit.edu/%7Elifton/snippets/n800_to_sl/ Josh Lifton] for the original leg wor | Thanks to [http://web.media.mit.edu/%7Elifton/snippets/n800_to_sl/ Josh Lifton] for the original leg wor | ||
Line 45: | Line 21: | ||
To adjust the video encoding quality, have a look at the parameters described by entering "gst-inspect hantro4200enc" at a shell prompt. Setting the "bit-rate" parameter to its maximum (515) and the "profile-and-level" parameter to 1007 produces a much better quality image. Also, I suspect the "stream-type" parameter should be "5" (H263), not "1" (MPEG4 Video). | To adjust the video encoding quality, have a look at the parameters described by entering "gst-inspect hantro4200enc" at a shell prompt. Setting the "bit-rate" parameter to its maximum (515) and the "profile-and-level" parameter to 1007 produces a much better quality image. Also, I suspect the "stream-type" parameter should be "5" (H263), not "1" (MPEG4 Video). | ||
- | + | [[Category:Users]] | |
- | + | [[Category:Midgard wiki]] | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
[[Category:Connectivity]] | [[Category:Connectivity]] | ||
[[Category:Media]] | [[Category:Media]] | ||
- |
Learn more about Contributing to the wiki.