[MPlayer-dev-eng] [PATCH] shared memory stream - part 1

Ötvös Attila oattila at chello.hu
Wed Aug 8 13:56:14 CEST 2007


2007. augusztus 8. 10.34 dátummal Nico Sabbi ezt írta:

Hi Nico Sabbi!

> the idea is good, but there some hacks that I don't like:
> - the introduction of -ors shouldn't be needed, because
> the out-stream that you rightfully used should recognize
> the smsm:// stream prefix automatically
> - I would send to the output stream a full multiplex
> of audio+video or video alone, thus there would not
> be any need to force output  demuxer_type, width, height
> - once done this the only thing you need to do is to  implementing
> a stream reader and writer leaving alone all the rest
>
> In summary you would use something like:
>
> mencoder tv:// -tv device=/dev/video0 -ovc raw smem://1000 [options]
> mencoder tv:// -tv device=/dev/video1 -ovc raw smem://1001 [options]
> mplayer smem://1000,1001,1002,1003 -vf tile=2:2
>

I make sharedmem to CCTV. The sharedmem support video alone. The mencoders 
record video from cameras to avi files and shared video with sharedmem:

mencoder tv:// -tv device=/dev/video0 -o cam1.avi -ors 
smem://1000 -nosound -ovc lavc -lavcopts vcodec=mpeg4 [options]
mencoder tv:// -tv device=/dev/video1 -o cam2.avi -ors 
smem://1001 -nosound -ovc lavc -lavcopts vcodec=mpeg4 [options]
...

The mplayer show picture of cameras from sharedmem:

mplayer smem://1000,1001,1002,1003 -vf tile=2:2

I think need width, height, etc. therefore there is not header in rawvideo:

Memory structure in sharedmem:

+typedef struct smem_st {

header:

+    char mplayerid[2];
+    int type;
+    int size;
+    int demuxer_type;
+    int format;
+    int width;
+    int height;
+    float pts;

rawvideo data:

+    unsigned char data[0];
+} smem_t;


Best regard.
Attila



More information about the MPlayer-dev-eng mailing list