[jitsi-dev] 转发:回复: Fw:problem with jitisi-android


#1

Hi Pawel,
    I foung that the video shown on PC from android is always transverse when the mobile is place vertically, but everything is ok when to mobile is palced horizentally. what about your test and is there any clues about this issue?
Regards,
Ray

2B08F903@F62FF53D.7AC4C251 (7.59 KB)

290EFF05@F62FF53D.7AC4C251 (37.1 KB)

···

------------------ 原始邮件 ------------------
发件人: "MAXWELL"<95143848@qq.com>;
发送时间: 2013年6月20日(星期四) 晚上9:34
收件人: "Paweł Domas"<pawel.domas@jitsi.org>;
抄送: "dev"<dev@jitsi.org>;
主题: 回复: Fw:problem with jitisi-android

Hi Pawel,
First,to avoid the exception of nalLength(to get the real nalLength), eight bytes of "3F" shoule be discarded(this is specific to my device):
else if (type == MEDIA_DATA_BOX_TYPE)
                {
                  Log.d("DataSource","type is:MEDIA_DATA_BOX_TYPE");
                  long dis = 0;
                  long dis1 = 0;
                  dis = readUnsignedInt(inputStream,4);
      dis1 = readUnsignedInt(inputStream,4);

second, in the method:
private void setParameterSets(Dimension size){};
PPS and SPS is changed to:
   else
        {
          Log.d("DataSource","others");
            pic_parameter_set_rbsp
                = new byte[]
                        {
// (byte) 0x68,
// (byte) 0xce,
// (byte) 0x3c,
// (byte) 0x80
                        (byte) 0x68,
                        (byte) 0xce,
                        (byte) 0x06,
                        (byte) 0xe2
                        };
            seq_parameter_set_rbsp
                = new byte[]
                        {
// (byte) 0x67,
// (byte) 0x42,
// (byte) 0x80,
// (byte) 0x1e,
// (byte) 0x95,
// (byte) 0xa0,
// (byte) 0x58,
// (byte) 0x25,
// (byte) 0x10,

                            (byte) 0x67,
                            (byte) 0x42,
                            (byte) 0xC0,
                            (byte) 0x16,
                            (byte) 0xE9,
                            (byte) 0x01,
                            (byte) 0x40,
                            (byte) 0x7B,
                            (byte) 0x20,
                        };

The parameters should be set according to the MPEG-4 file,you can find them in the file i sent you ealier,the file name is:love.MPEG_4.
Regards ,
Ray
------------------ 原始邮件 ------------------
发件人: "Paweł Domas"<pawel.domas@jitsi.org>;
发送时间: 2013年6月20日(星期四) 晚上9:12
收件人: "MAXWELL"<95143848@qq.com>;
抄送: "dev"<dev@jitsi.org>;
主题: Re: Fw:problem with jitisi-android

Hi Ray,

Could please send a patch with your changes that fixed the problem ?

I've been trying to compare our parameters from mpeg files and they are different indeed. But mine doesn't exactly match those hardcoded and it still works.

Regards,
Pawel

On Thu, Jun 20, 2013 at 10:59 AM, MAXWELL <95143848@qq.com> wrote:
Hi,Pawel,
    The problem has been fixed to some extent, this is what i did:
    
  This method is to specify PPS and SPS for different devices, we should set SPS、PPS according to the file
(THE full mpeg-4 file,not the raw stream ) we got earlier,as shown below,PPS and SPS is located behind avcC,(there's lot of information about SPS AND PPS ,so i am not going to tell the details, it's quite easy).

And it works .
Also thanks Oliver ,your suggestion is also helpful.
Regards ,
Ray
////////////////////////
Hi Ray, I've recorder sample video using "DUMP_FILE" method which uses streaming format. By comparing those two and looking at the code you're right: it's expected that 3f3f3f3f will be nalLength in your case. I'm not familiar yet with those box types and so on, but I'll be looking at it soon. If it might be of any help for you my dump file is attached. Regards, Pawel


#2

Hi Ray,

Do you mean rotation of the Android video ? I wasn't able to fix it yet. So
far only preview is rotated fine. There is an option to add rotation hint
to media recorder:

http://developer.android.com/reference/android/media/MediaRecorder.html#setOrientationHint(int)

But as the description says it only adds the rotation matrix to video
output so probably this will require some more work and H264 knowledge.

Regards,
Pawel

290EFF05@F62FF53D.7AC4C251 (37.1 KB)

2B08F903@F62FF53D.7AC4C251 (7.59 KB)

···

On Thu, Jun 20, 2013 at 4:19 PM, MAXWELL <95143848@qq.com> wrote:

Hi Pawel,
    I foung that the video shown on PC from android is always transverse
when the mobile is place vertically, but everything is ok when to mobile is
palced horizentally. what about your test and is there any clues about
this issue?
Regards,
Ray

------------------ 原始邮件 ------------------
*发件人:* "MAXWELL"<95143848@qq.com>;
*发送时间:* 2013年6月20日(星期四) 晚上9:34
*收件人:* "Paweł Domas"<pawel.domas@jitsi.org>; **
*抄送:* "dev"<dev@jitsi.org>; **
*主题:* 回复: Fw:problem with jitisi-android

Hi Pawel,
First,to avoid the exception of nalLength(to get the real nalLength),
eight bytes of "3F" shoule be discarded(this is specific to my device):
else if (type == MEDIA_DATA_BOX_TYPE)
                {
                Log.d("DataSource","type is:MEDIA_DATA_BOX_TYPE");
                long dis = 0;
                long dis1 = 0;
                dis = readUnsignedInt(inputStream,4);
dis1 = readUnsignedInt(inputStream,4);
second, in the method:
private void setParameterSets(Dimension size){};
PPS and SPS is changed to:
   else
        {
        Log.d("DataSource","others");
            pic_parameter_set_rbsp
                = new byte[]
                        {
// (byte) 0x68,
// (byte) 0xce,
// (byte) 0x3c,
// (byte) 0x80
                  (byte) 0x68,
                  (byte) 0xce,
                  (byte) 0x06,
                  (byte) 0xe2
                        };
            seq_parameter_set_rbsp
                = new byte[]
                        {
// (byte) 0x67,
// (byte) 0x42,
// (byte) 0x80,
// (byte) 0x1e,
// (byte) 0x95,
// (byte) 0xa0,
// (byte) 0x58,
// (byte) 0x25,
// (byte) 0x10,

                            (byte) 0x67,
                            (byte) 0x42,
                            (byte) 0xC0,
                            (byte) 0x16,
                            (byte) 0xE9,
                            (byte) 0x01,
                            (byte) 0x40,
                            (byte) 0x7B,
                            (byte) 0x20,
                        };

The parameters should be set according to the MPEG-4 file,you can find
them in the file i sent you ealier,the file name is:love.MPEG_4.
Regards ,
Ray
------------------ 原始邮件 ------------------
*发件人:* "Paweł Domas"<pawel.domas@jitsi.org>;
*发送时间:* 2013年6月20日(星期四) 晚上9:12
*收件人:* "MAXWELL"<95143848@qq.com>; **
*抄送:* "dev"<dev@jitsi.org>; **
*主题:* Re: Fw:problem with jitisi-android

Hi Ray,

Could please send a patch with your changes that fixed the problem ?

I've been trying to compare our parameters from mpeg files and they are
different indeed. But mine doesn't exactly match those hardcoded and it
still works.

Regards,
Pawel

On Thu, Jun 20, 2013 at 10:59 AM, MAXWELL <95143848@qq.com> wrote:

Hi,Pawel,
    The problem has been fixed to some extent, this is what i did:

This method is to specify PPS and SPS for different devices, we should
set SPS、PPS according to the file
(THE full mpeg-4 file,not the raw stream ) we got earlier,as shown
below,PPS and SPS is located behind avcC,(there's lot of information about
SPS AND PPS ,so i am not going to tell the details, it's quite easy).
And it works .
Also thanks Oliver ,your suggestion is also helpful.
Regards ,
Ray
////////////////////////

Hi Ray,

I've recorder sample video using "DUMP_FILE" method which uses streaming
format. By comparing those two and looking at the code you're right: it's
expected that 3f3f3f3f will be nalLength in your case. I'm not familiar yet
with those box types and so on, but I'll be looking at it soon. If it might
be of any help for you my dump file is attached.

Regards,
Pawel