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


#1

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

2B08F903@F62FF53D.7AC4C251 (7.59 KB)

290EFF05@F62FF53D.7AC4C251 (37.1 KB)

···

------------------ 原始邮件 ------------------
发件人: "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

So I've got the video working on the Galaxy S3 GT-I9300. Hopefully this
will help others. Your info was great Ray.

It does not have the NAL length issue.

The PPS and SPS parameters are as follows:

pic_parameter_set_rbsp
        = new byte[]
        {
                (byte) 0x68,
                (byte) 0xee,
                (byte) 0x06,
                (byte) 0xf2
        };
seq_parameter_set_rbsp
        = new byte[]
        {
                (byte) 0x67,
                (byte) 0x42,
                (byte) 0x80,
                (byte) 0x28,
                (byte) 0xE9,
                (byte) 0x01,
                (byte) 0x40,
                (byte) 0x7B,
                (byte) 0x20
        };

Everything generally seems to be working well though if the orientation
changes it sometimes causes Jitsi to freeze while video is enabled.

2B08F903@F62FF53D.7AC4C251 (7.59 KB)

290EFF05@F62FF53D.7AC4C251 (37.1 KB)

···

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

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

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#3

Hi Oliver, Ray,

I've tried to solve the issue as Ray described that is by recording
short video and extracting those parameters. Then they're cached and
reused, so it's one time calibration. Also I've made attempt to
discard ??? ??? detected as NAL length. Could you please give a try
for the latest git version and report if it works now on your devices
?

Regards,
Pawel

···

On Tue, Jun 25, 2013 at 9:21 PM, Oliver Chong <ochong@gmail.com> wrote:

So I've got the video working on the Galaxy S3 GT-I9300. Hopefully this will help others. Your info was great Ray.

It does not have the NAL length issue.

The PPS and SPS parameters are as follows:

pic_parameter_set_rbsp
        = new byte[]
        {
                (byte) 0x68,
                (byte) 0xee,
                (byte) 0x06,
                (byte) 0xf2
        };
seq_parameter_set_rbsp
        = new byte[]
        {
                (byte) 0x67,
                (byte) 0x42,
                (byte) 0x80,
                (byte) 0x28,
                (byte) 0xE9,
                (byte) 0x01,
                (byte) 0x40,
                (byte) 0x7B,
                (byte) 0x20
        };

Everything generally seems to be working well though if the orientation changes it sometimes causes Jitsi to freeze while video is enabled.

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

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

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#4

Hi Pawel,

I just gave the latest code a try. In its current form it doesn't work,
but I determined why. The values being used to modify the SPS byte array
in H264Parameters.java setVideoSize() based on the video resolution are
incorrect (at least for my device). If I comment out the call to
setVideoSize() in DataSource.java it works.

The video on my device is 640x480 and here are the SPS values:
seq_parameter_set_rbsp
        = new byte[]
        {
                (byte) 0x67,
                (byte) 0x42,
                (byte) 0x80,
                (byte) 0x28,
                (byte) 0xE9,
                (byte) 0x01,
* (byte) 0x40,
                (byte) 0x7B,
                (byte) 0x20*
        };

Note the values in array position 6,7,8.

Maybe it would be best to simply recalibrate anytime any video setting is
changed as the test video should have the full correct PPS and SPS values?

- Oliver

···

On Wed, Jun 26, 2013 at 12:06 PM, Paweł Domas <pawel.domas@jitsi.org> wrote:

Hi Oliver, Ray,

I've tried to solve the issue as Ray described that is by recording
short video and extracting those parameters. Then they're cached and
reused, so it's one time calibration. Also I've made attempt to
discard ??? ??? detected as NAL length. Could you please give a try
for the latest git version and report if it works now on your devices
?

Regards,
Pawel

On Tue, Jun 25, 2013 at 9:21 PM, Oliver Chong <ochong@gmail.com> wrote:
>
> So I've got the video working on the Galaxy S3 GT-I9300. Hopefully this
will help others. Your info was great Ray.
>
> It does not have the NAL length issue.
>
> The PPS and SPS parameters are as follows:
>
> pic_parameter_set_rbsp
> = new byte[]
> {
> (byte) 0x68,
> (byte) 0xee,
> (byte) 0x06,
> (byte) 0xf2
> };
> seq_parameter_set_rbsp
> = new byte[]
> {
> (byte) 0x67,
> (byte) 0x42,
> (byte) 0x80,
> (byte) 0x28,
> (byte) 0xE9,
> (byte) 0x01,
> (byte) 0x40,
> (byte) 0x7B,
> (byte) 0x20
> };
>
> Everything generally seems to be working well though if the orientation
changes it sometimes causes Jitsi to freeze while video is enabled.
>
>
>
>
> On Thu, Jun 20, 2013 at 9:34 AM, MAXWELL <95143848@qq.com> wrote:
>>
>> 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
>>
>>
>>
>> _______________________________________________
>> dev mailing list
>> dev@jitsi.org
>> Unsubscribe instructions and other list options:
>> http://lists.jitsi.org/mailman/listinfo/dev
>
>


#5

Hi Oliver,

Thanks for investigating the problem. The reason why I've put
setVideoSize method there was, because that's how I understood the
previous code. I thought that those 3 bytes refer to the size, but
after looking at SPS sequence specification it's much more
complicated, so for now I'm removing this method completly. I'll get
back to it when I'll try to add possibility to adjust video size.

Regards,
Pawel

···

On Wed, Jun 26, 2013 at 8:51 PM, Oliver Chong <ochong@gmail.com> wrote:

Hi Pawel,

I just gave the latest code a try. In its current form it doesn't work, but
I determined why. The values being used to modify the SPS byte array in
H264Parameters.java setVideoSize() based on the video resolution are
incorrect (at least for my device). If I comment out the call to
setVideoSize() in DataSource.java it works.

The video on my device is 640x480 and here are the SPS values:
seq_parameter_set_rbsp
        = new byte[]
        {
                (byte) 0x67,
                (byte) 0x42,
                (byte) 0x80,
                (byte) 0x28,
                (byte) 0xE9,
                (byte) 0x01,
                (byte) 0x40,
                (byte) 0x7B,
                (byte) 0x20
        };

Note the values in array position 6,7,8.

Maybe it would be best to simply recalibrate anytime any video setting is
changed as the test video should have the full correct PPS and SPS values?

- Oliver

On Wed, Jun 26, 2013 at 12:06 PM, Paweł Domas <pawel.domas@jitsi.org> wrote:

Hi Oliver, Ray,

I've tried to solve the issue as Ray described that is by recording
short video and extracting those parameters. Then they're cached and
reused, so it's one time calibration. Also I've made attempt to
discard ??? ??? detected as NAL length. Could you please give a try
for the latest git version and report if it works now on your devices
?

Regards,
Pawel

On Tue, Jun 25, 2013 at 9:21 PM, Oliver Chong <ochong@gmail.com> wrote:
>
> So I've got the video working on the Galaxy S3 GT-I9300. Hopefully this
> will help others. Your info was great Ray.
>
> It does not have the NAL length issue.
>
> The PPS and SPS parameters are as follows:
>
> pic_parameter_set_rbsp
> = new byte[]
> {
> (byte) 0x68,
> (byte) 0xee,
> (byte) 0x06,
> (byte) 0xf2
> };
> seq_parameter_set_rbsp
> = new byte[]
> {
> (byte) 0x67,
> (byte) 0x42,
> (byte) 0x80,
> (byte) 0x28,
> (byte) 0xE9,
> (byte) 0x01,
> (byte) 0x40,
> (byte) 0x7B,
> (byte) 0x20
> };
>
> Everything generally seems to be working well though if the orientation
> changes it sometimes causes Jitsi to freeze while video is enabled.
>
>
>
>
> On Thu, Jun 20, 2013 at 9:34 AM, MAXWELL <95143848@qq.com> wrote:
>>
>> 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
>>
>>
>>
>> _______________________________________________
>> dev mailing list
>> dev@jitsi.org
>> Unsubscribe instructions and other list options:
>> http://lists.jitsi.org/mailman/listinfo/dev
>
>