[asterisk-commits] rizzo: branch rizzo/video_v2 r85459 - in /team/rizzo/video_v2: channels/ conf...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Oct 11 13:22:01 CDT 2007
Author: rizzo
Date: Thu Oct 11 13:22:01 2007
New Revision: 85459
URL: http://svn.digium.com/view/asterisk?view=rev&rev=85459
Log:
Document the various options to support video.
Apart from some debugging code, using a recent (2007.07.14 or later
with no SWSCALE) now you should be able to use chan_oss with codecs
h261, h263 and h263+, and set independently the geometry of the
compressed video stream, the camera or x11 grabber, the local display
and the remote display.
Tested with the following remote parties:
asterisk (FreeBSD 6.2):
all three codecs supported
Ekiga (windows):
tested with h261, works in both directions
X-Lite (windows, free version):
h263 works bidirectionally
h263+ is received correctly by asterisk,
but X-Lite crashes when receiving the h263 stream.
Modified:
team/rizzo/video_v2/channels/chan_oss.c
team/rizzo/video_v2/channels/console_video.c
team/rizzo/video_v2/configs/oss.conf.sample
Modified: team/rizzo/video_v2/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/video_v2/channels/chan_oss.c?view=diff&rev=85459&r1=85458&r2=85459
==============================================================================
--- team/rizzo/video_v2/channels/chan_oss.c (original)
+++ team/rizzo/video_v2/channels/chan_oss.c Thu Oct 11 13:22:01 2007
@@ -1121,7 +1121,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "console [sendvideo|device|videodevice|"
- "fps|bitrate|videoformat|video_size|camera_size|"
+ "fps|bitrate|videocodec|video_size|camera_size|"
"remote_size|local_size|qmin]";
e->usage =
"Usage: console ...\n"
Modified: team/rizzo/video_v2/channels/console_video.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/video_v2/channels/console_video.c?view=diff&rev=85459&r1=85458&r2=85459
==============================================================================
--- team/rizzo/video_v2/channels/console_video.c (original)
+++ team/rizzo/video_v2/channels/console_video.c Thu Oct 11 13:22:01 2007
@@ -915,8 +915,12 @@
/*---- h261 support -----*/
static int h261_enc_init(struct video_out_desc *v)
{
- v->enc_ctx->gop_size = 0; // v->fps*5;
+ /* It is important to set rtp_payload_size = 0, otherwise
+ * ffmpeg in h261 mode will produce output that it cannot parse.
+ * Also try to send I frames more frequently than with other codecs.
+ */
v->enc_ctx->rtp_payload_size = 0; /* important - ffmpeg fails otherwise */
+ v->enc_ctx->gop_size = v->fps*2; /* be more responsive */
return 0;
}
@@ -956,9 +960,8 @@
/* Similar to the code in h263_encap, but the marker there is longer.
* Start a few bytes within the bitstream to avoid hitting the marker
- * twice. Stop at len-1 because when there are bits to ignore we move
- * back the 'start' pointer by 1, and this would cause us to enter
- * the loop one more time.
+ * twice. Note we might access the buffer at len, but this is ok because
+ * the caller has it oversized.
*/
for (i = H261_MIN_LEN, start = 0; start < len - 1; start = i, i += 4) {
#if 0 /* test - disable packetization */
@@ -2101,8 +2104,8 @@
if (!strcasecmp(var, "videodevice")) {
ast_cli(fd, "videodevice is [%s]\n", env->out.videodevice);
- } else if (!strcasecmp(var, "videoformat")) {
- ast_cli(fd, "videoformat is [%s]\n", env->codec_name);
+ } else if (!strcasecmp(var, "videocodec")) {
+ ast_cli(fd, "videocodec is [%s]\n", env->codec_name);
} else if (!strcasecmp(var, "sendvideo")) {
ast_cli(fd, "sendvideo is [%s]\n", env->out.sendvideo ? "on" : "off");
} else if (!strcasecmp(var, "video_size")) {
@@ -2159,7 +2162,7 @@
M_UINT("fps", env->out.fps)
M_UINT("bitrate", env->out.bitrate)
M_UINT("qmin", env->out.qmin)
- M_STR("videoformat", env->codec_name)
+ M_STR("videocodec", env->codec_name)
M_END(return 1;) /* the 'nothing found' case */
return 0; /* found something */
}
Modified: team/rizzo/video_v2/configs/oss.conf.sample
URL: http://svn.digium.com/view/asterisk/team/rizzo/video_v2/configs/oss.conf.sample?view=diff&rev=85459&r1=85458&r2=85459
==============================================================================
--- team/rizzo/video_v2/configs/oss.conf.sample (original)
+++ team/rizzo/video_v2/configs/oss.conf.sample Thu Oct 11 13:22:01 2007
@@ -72,20 +72,29 @@
[card1]
; device = /dev/dsp1 ; alternate device
-; Additional settings to try videosupport.
-; 'videodevice = /dev/video0' uses your V4L webcam as video source
-; 'videodevice = X11' (capital) transmits the content of the upper left
-; corner of your X11 display,
-; videowitdh and videoheight set the resolution - please note that
-; codecs and other videophones only support some standard resolutions
-; e.g. 176x144, 352x288, 320x240 ...
-; 'bitrate' is the net video bit rate (plus you have RTP/UDP/IP overhead,
-; also consider that the traffic is very bursty
-[general](+) ; additional settings for videosupport
+
+; Below are the settings to support video. You can include them
+; in your general configuration as [general](+,video)
+; The parameters are all available through the CLI as "console name value"
+[video](!) ; you can just include in your config
+ videodevice = /dev/video0 ; uses your V4L webcam as video source
+ videodevice = X11 ; X11 grabber at top left of the screen
+ videocodec = h263 ; also h261 or h263p are supported.
+
+ ; video_size is the geometry used by the encoder.
+ ; Depending on the codec your choice is restricted.
+ video_size = qcif ; sqcif, qcif, cif, qvga, vga, ...
+ video_size = 352x288 ; the format WIDTHxHEIGHT is also ok
+
+ ; You can also set the geometry used for the camera, local display and remote display.
+ ; The local window is on the right, the remote window is on the left.
+ camera_size = cif ;
+ remote_size = cif ;
+ local_size = qcif ;
+
+ bitrate = 60000 ; rate told to ffmpeg.
+ fps = 5 ; frames per second from the source.
+ ; qmin = 3 ; quantizer value passed to the encoder.
+
+[general](+,video) ; additional settings for videosupport
overridecontext=yes ; so you can specify a SIP/xx at yy 'number'
- videodevice = X11 ; X11 grabber
- ; videodevice = /dev/video0 ; Use this if you have a webcam...
- videowidth = 352 ; either 352x2
- videoheight = 288 ;
- fps = 15 ;
- bitrate = 65000 ;
More information about the asterisk-commits
mailing list