About speex bitrate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/18/08, Markus Vechiorno <finalpfc at hotmail.com> wrote:
>
>  You are right Benny, it works, but as I expected too it does not work if
> the active call running is using speex (you can't deinit a codec being uses,
> right?).
>
>  I have to make this in some way.
>  I have 2 ideas:
>   - The "dirty one" is to do the change using another codec as intermediate
> codec. I am going to do the change in a silence, so I think that it should
> really not cause any quality loss. In a call using speex, the steps could be
> for example:
>       1- Change Cp to set ilbc with more priority.
>       2- Update
>       3- Deinit speex and init_speex with the new quality
>       4- Change Cp to set speex again as the first in priority
>       5- Send a new update.
>  I have tried these steps and it seems to work (I have to study the possible
> impairments).

Yeah that could work. Maybe you'll have some glitches in the audio
during codec change process (since this involves destroying/recreating
the stream, and any audio frames in the jitter buffer will be dropped
during this process).

>   - The other idea is to add the different configurations as different
> codecs. I don't know how to implement new codecs, but the idea is to
> implement add 5 different codecs (one for each quality setting). The codec
> implementation should be the same for the 5 codecs (and the same code), but
> the quality for each other is the suitable for my purpose.

That is not possible with PJMEDIA unfortunately, since there's nothing
to differentiate the codecs in the SDP (they're all speex, and they're
of the same sample rate).

Ideally we should have the quality setting in the codec param
(pjmedia_codec_param) but this involves some modifications in pjmedia.

Cheers,
 -benny


>  I don't know if I have explained well because it is only a vague idea in my
> mind.
>
>  What do you think about my ideas? Am I a crazy man?
>
>  Thanks Benny for beeing so generous. I am very grateful.
>
>
>
>
>
>
> > >
> > > Well, I am working in that, but I am wondering some things.
> > > - If we are using the speex with quality 4 for example, and I want to
> > > change the quality to 6, what should be the steps to make?
> > > I am trying to do directly calling the pjmedia_codec_speex_init function
> to
> > > change the quality, and then calling to update implemented in pjsua. Is
> it
> > > right? (I think it is probably a mistake calling directly to speex_init
> > > without doing some changes before).
> > >
> > > I have tried to do it with:
> > > pjsua_var.media_cfg.quality = 10;
> > > pjmedia_codec_speex_init(pjsua_var.med_endpt,
> > > 0,
> > > pjsua_var.media_cfg.quality,
> > > pjsua_var.media_cfg.quality);
> > >
> > > But, then I try to see if any change has been done using 'd' and the
> dump
> > > informations shows the same bitrate (the bitrate should change according
> to
> > > the new quality, isn't it?)
> >
> > Yes it should.
> >
> > > What is wrong?
> > >
> >
> > My guess is probably you missed calling pjmedia_codec_speex_deinit().
> >
> > I tried adding a new menu command like below in pjsua, and it seems to
> work:
> >
> > case 'Q':
> > if (!simple_input("Enter new speex quality:", buf, sizeof(buf)))
> > break;
> > pjmedia_codec_speex_deinit();
> > pjmedia_codec_speex_init(pjsua_get_pjmedia_endpt(), 0,
> > my_atoi(buf), my_atoi(buf));
> > puts("Speex quality changed");
> > break;
> >
> > But just a bit of warning again, the snippet above most likely
> > wouldn't work if there is a call with active media running in the
> > application.
>
>
>
>  >
> > cheers,
> > -benny
> >
> > _______________________________________________
> > Visit our blog: http://blog.pjsip.org
> >
> > pjsip mailing list
> > pjsip at lists.pjsip.org
> >
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
> ________________________________
> Todo ruedas: informaci?n pr?ctica y todo el glamour del mundo del motor. MSN
> Estilo y Tendencias
> _______________________________________________
>  Visit our blog: http://blog.pjsip.org
>
>  pjsip mailing list
>  pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux