[sip-comm-dev] FFMPEG


#1

Hi,

I'm trying to use ffmpeg to transmit video in h263+.
I've decided to use ID of h263+ (20) in avcodec.h - and replace h264's id
(28) with it.
Used it in
net.java.sip.communicator.impl.media.codec.video.h264.JNIEncoder.open()

long avcodec = FFMPEG.avcodec_find_encoder(20);

But it fails...

I've removed all additional settings for codec except bitrate and dimension
and tested all codecs which can be opened.

for (int i = 0; i < 50; i ++) {
            long avcodec = FFMPEG.avcodec_find_encoder(i);
            avcontext = FFMPEG.avcodec_alloc_context();
            FFMPEG.avcodeccontext_set_size(avcontext, DEF_WIDTH,
DEF_HEIGHT);
            int _bitRate = Constants.VIDEO_BITRATE;
            FFMPEG.avcodeccontext_set_bit_rate(avcontext, _bitRate);
            if (FFMPEG.avcodec_open(avcontext, avcodec) < 0) {
                System.out.println("Id " + i + " failed");
            } else {
                System.out.println("Id " + i + " opened");
            }
        }

And only 28th was opened. Also, video call with h264 works fine with this
short set of setting (i mean only bitrate and dimension).

What have i missed, guys?

Thanks!


#2

Hi,

what binaries are you using ? The one that came with sip-communicator has only h264 in them.
Also if you are trying to use h263 you must create new Packetizers and Depacketizers.

damencho

Alexander Kazeko wrote:

···

Hi,

I'm trying to use ffmpeg to transmit video in h263+.
I've decided to use ID of h263+ (20) in avcodec.h - and replace h264's id (28) with it.
Used it in net.java.sip.communicator.impl.media.codec.video.h264.JNIEncoder.open()

long avcodec = FFMPEG.avcodec_find_encoder(20);

But it fails...

I've removed all additional settings for codec except bitrate and dimension and tested all codecs which can be opened.

for (int i = 0; i < 50; i ++) {
            long avcodec = FFMPEG.avcodec_find_encoder(i);
            avcontext = FFMPEG.avcodec_alloc_context();
            FFMPEG.avcodeccontext_set_size(avcontext, DEF_WIDTH, DEF_HEIGHT);
            int _bitRate = Constants.VIDEO_BITRATE;
            FFMPEG.avcodeccontext_set_bit_rate(avcontext, _bitRate);
            if (FFMPEG.avcodec_open(avcontext, avcodec) < 0) {
                System.out.println("Id " + i + " failed");
            } else {
                System.out.println("Id " + i + " opened");
            }
        }

And only 28th was opened. Also, video call with h264 works fine with this short set of setting (i mean only bitrate and dimension).

What have i missed, guys?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net