[MPlayer-dev-eng] Re: [Ffmpeg-devel] live feed from a webcam

Ducrot Bruno ducrot at poup.poupinou.org
Tue Oct 2 00:43:47 CEST 2001


On Mon, Oct 01, 2001 at 11:07:12PM +0200, Ducrot Bruno wrote:
> On Sun, Sep 30, 2001 at 10:12:12PM +0200, Ries van twisk wrote:
> > ffserver is broken,
> > the developers are currently working to get the codecs right.
> > 
> > Ries
> > 
> > 
> > Balazs wrote:
> > > 
> > > hi,
> > > 
> > > I'm trying to broadcast a live feed from a philips webcam (on
> > > /dev/video0) with ffserver. ffmpeg works fine with the cam, my only
> > > problem is, that I can't make ffserver to broadcast the feed. I don't
> 
> Some feedback from ffserver (cvs version) for me:
> 
> 1- It work, but not for all codecs.  Only the mpeg, mp2, jpeg and
> mpjpeg (with some troubles) works for me.
> Here is my ffserver.conf for a dexxa webcam and a sb live! :
> 
> Port 8090
> BindAddress 0.0.0.0
> MaxClients 1000
> CustomLog -
> 

[bla bla]

> (basically, some trouble to be able to play mpeg stream with mplayer)

I hope this could be OK to CC to mplayer-dev list...

I give the patch (verified under the current cvs version of mplayer);
consider also that is *only* for mpeg video stream from ffserver.

You have to pass the -fps option.  (don't know if this is a mplayer
trouble, or a ffserver... I suspect ffserver, however).

NB: configure mplayer with ./configure --with-streaming



-- 
Ducrot Bruno
http://www.poupinou.org        Page profaissionelle
http://toto.tu-me-saoules.com  Haume page
-------------- next part --------------
diff -Naur main/http.c main.w/http.c
--- main/http.c	Tue Jun  5 10:46:31 2001
+++ main.w/http.c	Mon Oct  1 23:48:32 2001
@@ -24,6 +24,9 @@
 void
 http_free( HTTP_header_t *http_hdr ) {
 	int i;
+
+	printf("http_free: to be fixed...\n");
+	return;
 	if( http_hdr==NULL ) return;
 	if( http_hdr->protocol!=NULL ) free( http_hdr->protocol );
 	if( http_hdr->uri!=NULL ) free( http_hdr->uri );
diff -Naur main/network.c main.w/network.c
--- main/network.c	Wed Aug 22 21:40:46 2001
+++ main.w/network.c	Mon Oct  1 23:42:44 2001
@@ -304,7 +304,8 @@
 			if( !strcasecmp(extension, "mpg") ||
 			    !strcasecmp(extension, "mpeg") ) {
 				if( url->port==0 ) url->port = 80;
-				return DEMUXER_TYPE_MPEG_PS;
+				printf("grompf: url->port %d\n", url->port);
+				// return DEMUXER_TYPE_MPEG_PS;
 			}
 			if( !strcasecmp(extension, "avi") ) {
 				if( url->port==0 ) url->port = 80;
@@ -367,7 +368,8 @@
 							return DEMUXER_TYPE_MPEG_PS;
 						}
 						// Check for MPEG streaming
-						if( !strcasecmp(content_type, "video/mpeg") ) {
+						if( !strcasecmp(content_type, "video/mpeg")  || !strcasecmp(content_type,"video/x-mpeg")) {
+							printf("grompf\n");
 							return DEMUXER_TYPE_MPEG_PS;
 						}
 						// AVI ??? => video/x-msvideo
@@ -426,6 +428,7 @@
 	if( streaming_ctrl==NULL ) return -1;
 
 	fd = streaming_ctrl->fd_net;
+	
 	if( fd<0 ) {
 		fd = http_send_request( *(streaming_ctrl->url) ); 
 		if( fd<0 ) return -1;
@@ -448,6 +451,7 @@
 		streaming_ctrl->fd_net = fd;
 	}
 
+	printf("In nop_streaming_start: fd is %d\n", fd);
 	http_free( http_hdr );
 
 	streaming_ctrl->streaming_read = nop_streaming_read;
@@ -456,6 +460,7 @@
 	streaming_ctrl->buffering = 1;
 //	streaming_ctrl->buffering = 0;
 	streaming_ctrl->status = streaming_playing_e;
+	printf("In nop_streaming_start: fd is again %d\n", fd);
 	return fd;
 }
 
@@ -546,7 +551,6 @@
 	streaming_ctrl->fd_pipe_in = fd_file;
 }
 #endif
-
 	switch( streaming_type ) {
 		case DEMUXER_TYPE_ASF:
 			// Send the appropriate HTTP request
@@ -555,7 +559,9 @@
 		case DEMUXER_TYPE_AVI:
 		case DEMUXER_TYPE_MPEG_ES:
 		case DEMUXER_TYPE_MPEG_PS:
+			printf("Also grompf.\n");
 			fd = nop_streaming_start( streaming_ctrl );
+			printf("Also grompf = %d\n", fd);
 			break;
 		case DEMUXER_TYPE_UNKNOWN:
 		default:
@@ -565,11 +571,14 @@
 			return -1;
 	}
 
+	printf("Another grompf = %d\n", fd);
+
 	if( fd<0 ) {
 		free( streaming_ctrl );
 		return -1;
 	}
 
+	printf("Start the network thread\n");
 	// Start the network thread
 	if( pthread_create( &(streaming_ctrl->thread_id), NULL , (void*)network_streaming, (void*)NULL)<0 ) {
 		printf("Unable to start the network thread.\n");	
diff -Naur main/open.c main.w/open.c
--- main/open.c	Mon Oct  1 23:10:58 2001
+++ main.w/open.c	Mon Oct  1 23:39:43 2001
@@ -263,8 +263,10 @@
         f=streaming_start( &url, f, *file_format );
         if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, url->url); return NULL; }
         mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ConnToServer, url->hostname );
+	printf("grompf !!!\n");
         stream=new_stream(f,STREAMTYPE_STREAM);
-	return NULL;
+	printf("GROMPF !!!\n");
+	return stream;
   }
 #endif
 
diff -Naur main/version.h main.w/version.h
--- main/version.h	Thu Jan  1 01:00:00 1970
+++ main.w/version.h	Mon Oct  1 23:15:01 2001
@@ -0,0 +1 @@
+#define VERSION "CVS-011001-23:10"


More information about the MPlayer-dev-eng mailing list