Change video stream resolution during call

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

 



Fedot-

Typically video (and voice) codecs must be re-initialized before a "core" parameter can be changed, such as
resolution, frame rate etc.  You may need to open one or more codecs and feed them concurrently, taking output of
whichever one is dictated by bandwidth and/or end-point considerations.

By the way, is this for HLS?  As HLS becomes more popular, I would expect additions to the H.264 standard to allow
dynamic bitstream adaptation, without multiple instances of the codec.

-Jeff

> pjsip-2.0-RC much more reliable then beta.
> BTW I can successfully make video call with resolution HD(1280x720),
> 1680x1050 , etc. It works. Also I have to do first 3-5 frames as I-Frames
> to reach video rapidly after start video call.
> The fix looks like(method ffmpeg_codec_encode_whole)- using global
> counter m_first_frame_counter :
> ...
> if (opt && opt->force_keyframe) {
> ...
> //we set I-Frame all first 4 frames of video stream
> if (m_first_frame_counter < 4)
> {
> avframe.pict_type = AV_PICTURE_TYPE_I;
> m_first_frame_counter++;
> }else
> {
> m_first_frame_counter = 4;
> }
> ...
>     av_init_packet(&avpacket);
>
>
> So, closer to my problem, my question: is it possible to change video
> resolution directly during video call making? for example I do video call
> with resolution 800x600 and, directly in call, I change output video to
> 1024x768.
> Is it possible?
> How can I do that in right way?
>
> As I can see from pjsua_app.c code:
> --------------------------------------------
> } else if (argc==6 && strcmp(argv[2], "size")==0) {
>     pjmedia_vid_codec_param cp;
>     pj_str_t cid;
>     int M, N;
>     cid = pj_str(argv[3]);
>     M = atoi(argv[4]);
>     N = atoi(argv[5]);
>     status = pjsua_vid_codec_get_param(&cid, &cp);
>     if (status == PJ_SUCCESS) {
> cp.enc_fmt.det.vid.size.w = M;
> cp.enc_fmt.det.vid.size.h = N;
> status = pjsua_vid_codec_set_param(&cid, &cp);
>     }
> --------------------------------------------
> we should get codec, change it properties and set it back.
> but then I do:
> status = pjsua_vid_codec_get_param(&codec_id, ?m);
> I have an assertion:
> pj_assert(!"Calling pjlib from unknown/external thread. You must "
>    "register external threads with pj_thread_register() "
>    "before calling any pjlib functions.");
>     }
> call stack:
>>  msvcr90d.dll!_wassert(const wchar_t * expr=0x00811db0, const wchar_t *
> filename=0x00811a58, unsigned int lineno=559)  Line 335 C
>> MyApp.exe!pj_thread_this()  Line 559 + 0x22 bytes C
>>  MyApp.exe!pj_thread_check_stack(const char * file=0x00811b88, int
> line=944)  Line 632 + 0x5 bytes C
>   MyApp.exe!pj_mutex_lock(pj_mutex_t * mutex=0x04b38d3c)  Line 944 + 0x13
> bytes C
>>  MyApp.exe!pjmedia_vid_codec_mgr_find_codecs_by_id(pjmedia_vid_codec_mgr
> * mgr=0x04b3932c, const pj_str_t * codec_id=0x0018f2c8, unsigned int *
> count=0x0018ef00, const pjmedia_vid_codec_info * * p_info=0x0018ef0c,
> unsigned int * prio=0x00000000)  Line 431 + 0xc bytes C
>>  MyApp.exe!find_codecs_with_rtp_packing(const pj_str_t *
> codec_id=0x0018f2c8, unsigned int * count=0x0018eff0, const
> pjmedia_vid_codec_info * * p_info=0x0018eff4)  Line 241 + 0x18 bytes C
>> MyApp .exe!pjsua_vid_codec_get_param(const pj_str_t *
> codec_id=0x0018f2c8, pjmedia_vid_codec_param * param=0x0018f068)  Line 322
> + 0x11 bytes C
>
> That I do in wrong way? How can I do this correct?
> Thank you!
> _______________________________________________
> 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