Static image in video stream

218 views
Skip to first unread message

Maxim Tartachnik

unread,
Jul 19, 2012, 3:59:27 AM7/19/12
to doub...@googlegroups.com
Hi all,

I downloaded and successfully build the iDoubs project for Mac OS X.
I try to call from iDoubs on Mac to iDoubs on my iPhone, and all is fine.
My task is, when Mac have no connected webcam I want send to the another client (for example iDoubs on the iPhone) static image(something like "No Webcam").
Can anybody explain me where in the Doubango libs I can put my static image and then send it to another client?

WBR
Maxim Tartachnik

Mamadou

unread,
Jul 19, 2012, 4:22:19 AM7/19/12
to Doubango
First remark: there is an issue (regression) on the H.264 video stream
sent from iDoubs on OS X caused by FFmpeg/x264 revision mismatch. You
should have bad video quality. More info: http://code.google.com/p/idoubs/issues/detail?id=110
This said, the video frames are sent by this function:
http://code.google.com/p/idoubs/source/browse/branches/2.0/osx-ngn-stack/OSXProxyVideoProducer.mm#258
Supported formats: YUV420, YUV422, RGB24 and RGB32
The easiest solution is to store your image as YUV420 binary data in a
file.
When a video session starts we send blank packets to open a NAT
pinhole using a timer. This timer will be stopped when the camera
starts or we sent 3 (BLANK_PACKETS_TO_SEND) blank packets.
In your case as there is no camera, then we'll always send 3 blank
packets at the start of the session. The packets are named blank
because they contain zeros stored in 'kBlankPacketBuffer'.
The solution to your problem is as simple as filling
'kBlankPacketBuffer' buffer with your 'No Webcam' image.
If 'No webcam' image size is different than the SIP negotiated
(mWidth, mHeight) one, then you have to tell it to doubango media
stack like this:
const_cast<ProxyVideoProducer*>(_mProducer)-
>setActualCameraOutputSize('No webcam'.width, 'No webcam'.height);
To tell doubango media stack that your buffer chroma s YUV420, you can
do it like this:
tmedia_producer_t* producer =
(tmedia_producer_t*)tsk_object_ref((void*)_mProducer-
>getWrappedPlugin());
producer->video.chroma = tmedia_chroma_yuv420p;




On Jul 19, 9:59 am, Maxim Tartachnik <maxim.tartach...@gmail.com>
wrote:

Mamadou

unread,
Jul 19, 2012, 4:32:53 AM7/19/12
to Doubango
oops
tsk_object_ref() not needed or if used don't forget to call
tsk_object_unref()

On Jul 19, 10:22 am, Mamadou <diopmama...@doubango.org> wrote:
> First remark: there is an issue (regression) on the H.264 video stream
> sent from iDoubs on OS X caused by FFmpeg/x264 revision mismatch. You
> should have bad video quality. More info:http://code.google.com/p/idoubs/issues/detail?id=110
> This said, the video frames are sent by this function:http://code.google.com/p/idoubs/source/browse/branches/2.0/osx-ngn-st...

Максим Тартачник

unread,
Jul 19, 2012, 6:05:14 AM7/19/12
to doub...@googlegroups.com
Hi Mamadou,

Thank you for your quick reply. 
I have several questions for your:

1. If I understand you correct,  iDoubs for Mac OS X has a problem with video quality using h264 FFmpeg codec. Right? 

I have two different projects: 
Project A - will send video to another client ONLY.
Project B - will receive video from another client ONLY. 
And it is possible to use like:
Project A --> Linphone   or   Linphone --> Project B
And my question is: Where exactly I will have problems with video quality? 
On the decoder or on the encoder side?

2. How about using another video codec(for example h263)? In this case video quality will be bad too? Or not?

3. Also I would like to ask you about a bit different.
Did you think about creating special virtual capture device for generating video if capture device is not available. 
This feature will allow create video stream with stand by TV color bars, for example.

Thank you very much.
WBR
Maxim Tartachnik 



2012/7/19 Mamadou <diopm...@doubango.org>
--



Mamadou

unread,
Jul 19, 2012, 6:13:14 AM7/19/12
to Doubango
My responses inline

On Jul 19, 12:05 pm, Максим Тартачник <maxim.tartach...@gmail.com>
wrote:
> Hi Mamadou,
>
> Thank you for your quick reply.
> I have several questions for your:
>
> 1. If I understand you correct,  iDoubs for Mac OS X has a problem with
> video quality using h264 FFmpeg codec. Right?
Yes. It's a regression introduced in the latest OSX code
>
> I have two different projects:
> Project A - will send video to another client ONLY.
> Project B - will receive video from another client ONLY.
> And it is possible to use like:
> Project A --> Linphone   or   Linphone --> Project B
> And my question is: Where exactly I will have problems with video quality?
> On the decoder or on the encoder side?
The issue is on the OSX encoder only (x264)
>
> 2. How about using another video codec(for example h263)? In this case
> video quality will be bad too? Or not?
>
Only H.264 is concerned
> 3. Also I would like to ask you about a bit different.
> Did you think about creating special virtual capture device for generating
> video if capture device is not available.
> This feature will allow create video stream with stand by TV color bars,
> for example.
You can register your own video producer plugin
>
> Thank you very much.
> WBR
> Maxim Tartachnik
>
> 2012/7/19 Mamadou <diopmama...@doubango.org>

Максим Тартачник

unread,
Jul 19, 2012, 7:23:17 AM7/19/12
to doub...@googlegroups.com
Mamadou,

Register video producer plugin? Sounds good 
Maybe in this case solution will be more correctly. Could you please explain how I can do that?

WBR
Maxim Tartachnik

2012/7/19 Mamadou <diopm...@doubango.org>
--



Reply all
Reply to author
Forward
0 new messages