Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd June 2011, 04:17   #1  |  Link
phdzwei
Registered User
 
Join Date: Feb 2011
Posts: 18
SEI TYPE: need your help

It is also about SEI NALU.

I have been focusing on SEI NAL units.
When SEI type is “User data unregistered SEI message semantics”. The following two parts are definition of this type.

/*
D.8.6 User data unregistered SEI message syntax
user_data_unregistered( payloadSize )
{
uuid_iso_iec_11578 // u(128)
for( i = 16; i < payloadSize; i++ )
user_data_payload_byte // b(8)
}
*/
/*
D.9.6 User data unregistered SEI message semantics
This message contains unregistered user data identified by a UUID, the contents of which are not specified by this Recommendation | International Standard.
uuid_iso_iec_11578 shall have a value specified as a UUID according to the procedures of ISO/IEC 11578:1996 Annex A.
user_data_payload_byte shall be a byte containing data having syntax and semantics as specified by the UUID generator.
*/

I have qeustion on this type.
The uuid_iso_iec_11578 is used for unique identification in network.
Can the “uuid_iso_iec_11578” be random value? but not generated by Annex A.
I want to store random bitstream into the uuid_iso_iec_11578,

That is to say, I just set uuid_iso_iec_11578 which is 16 bytes as simple 16 bytes, It don't indicates UUID value.

is that available? Thank you..

Last edited by phdzwei; 23rd June 2011 at 05:45.
phdzwei is offline   Reply With Quote
Old 23rd June 2011, 15:22   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
You can put what you like in there, but if you do not use a GUID you risk two things:

1. If you choose a value already used by some other application you may trigger other software to think they should use your message as their own.

2. If some other application already uses the number you choose, then you may think their message is yours. You can mitigate that by putting a magic number in the payload.

It is trivial to generate a UUID, so why don't you just make one and use that? Put your "random bitstream" in the payload.
Guest is offline   Reply With Quote
Old 23rd June 2011, 15:44   #3  |  Link
phdzwei
Registered User
 
Join Date: Feb 2011
Posts: 18
Thank you so much.

Why don't I want to use UUID?
I want to decrease overhead for each SEI NAL. In our experiment, we will insert lot of SEI NAL, it will be 16 bytes for each SEI NUL.

Therefore, I want to store our content into uuid_iso_iec_11578 and user_data_payload_byte in order to make good use of payload.

Thank you so much.
phdzwei is offline   Reply With Quote
Old 23rd June 2011, 15:51   #4  |  Link
kieranrk
Registered User
 
Join Date: Jun 2009
Location: London, United Kingdom
Posts: 707
The UUID must be included in the SEI according to the spec.
kieranrk is offline   Reply With Quote
Old 23rd June 2011, 16:00   #5  |  Link
phdzwei
Registered User
 
Join Date: Feb 2011
Posts: 18
Hi Mr Kieranrk:
Thank you.

But, If I don't conform the spec, what will happen?
Actually, I can differentiate our SEI NAL(by content) with other santdard SEI NAL(by using UUID).
Is that avaliable?
phdzwei is offline   Reply With Quote
Old 23rd June 2011, 16:04   #6  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
As far as I understand, he wants to "abuse" the uuid_iso_iec_11578 field for payload.

Depending on the payload, this will result in a different UUID for each SEI message. Even if it was possible to somehow detect "your" SEI messages without a unique UUID, there is a chance that your payload (the part you put into the UUID field) happens to be identical to the UUID used by some other application - which is prone to trouble! Only if your payload (the part you put into the UUID field) was completely random, the chance of a collision (i.e. getting the same UUID as already used by some other application) would be the same as with a "true" UUID. And even in that case you would still have the problem to distinguish "your" SEI messages from other ones (as every SEI message will have a new/random UUID). [EDIT] If you don't conform to the specs, the result isn't a valid bitstream anymore. [/EDIT]

(What you maybe could do: Generate not a single UUID for your custom SEI messages, but 2^n ones. With 2^n different UUID's you can encode n bits in the UUID field)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 23rd June 2011 at 16:13.
LoRd_MuldeR is offline   Reply With Quote
Old 23rd June 2011, 18:56   #7  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by phdzwei View Post
Therefore, I want to store our content into uuid_iso_iec_11578 and user_data_payload_byte in order to make good use of payload.
If you do not use UUID properly, how will you know which SEIs are yours?
Guest is offline   Reply With Quote
Old 27th June 2011, 10:20   #8  |  Link
phdzwei
Registered User
 
Join Date: Feb 2011
Posts: 18
I have new question about SEI NAL. Because we have large data which will transmit to client by SEI NAL.
When type of SEI NAL is user data unregistered mesage(unqiue UUID), If the payloadsize is very big, it will need more bytes (0xFF) to express it.
Can I omit payloadsize field?

As our decoder meet our SEI NAL, it can decode the bitstream because it understand there is no payloadsize field in SEI NAL.
But, how about the standard decoder? what will be happened?

Thank you.
phdzwei is offline   Reply With Quote
Old 27th June 2011, 11:09   #9  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Well, you can't omit any fields, except when the standard explicitly says they are optional. Anything else would result in an invalid/corrupted bitstream.

Also if the size of your payload exceeds the maximum size that can be specified, you'll have to use segmentation, i.e. split the payload over several messages.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th June 2011, 12:39   #10  |  Link
phdzwei
Registered User
 
Join Date: Feb 2011
Posts: 18
oh, LoRd_MulderR, thank you
But, this SEI NAL is user data unregistered message. The UUID is unique.
Why the standard decode this SEI NAL? it is not used for decoding.

In addition, maximum size is based on MTU?

In our application, we want to transmit some private data in H.264 bitstream. But, the payload may be so big, is there other idea except SEI NAL(user data unregistered), Could I use preserved type of SEI NAL?
Please, give us some advice?
Thank you
phdzwei is offline   Reply With Quote
Old 27th June 2011, 13:30   #11  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
1. From what I see, the "payloadSize" field does NOT belong to the "User data unregistered SEI message" payload syntax, but the the general "Supplemental enhancement information" (SEI) message syntax. So it has to be in all SEI messages, not only if "payloadType" == "User data unregistered" (5). And it should be obvious why you cannot omit it

2. Also from what I see, the "payloadSize" field is not limited in size. It can have an arbitrary number of bytes. As long as the current byte has the value 0xFF, there is one more bye to come. That's the same multi-byte encoding used to store the "payloadType" value. So it should be no problem to store even very large payload sizes.

3. You can not invent a new "payloadType" value yourself, even if you pick a number that is not currently used in the standard. The standard my assign that number to a new standard SEI type at later time, which then will cause serious problem for you! The standard already defines a special payloadType for custom (unregistered) SEI message, so why not use that one?

Code:
sei_message() {
    payloadType = 0
    while( next_bits( 8 ) == 0xFF ) {
        ff_byte /* equal to 0xFF */
        payloadType += 255
    }
    last_payload_type_byte
    payloadType += last_payload_type_byte
    
    payloadSize = 0
    while( next_bits( 8 ) == 0xFF ) {
        ff_byte /* equal to 0xFF */
        payloadSize += 255
    }
    last_payload_size_byte
    payloadSize += last_payload_size_byte

    sei_payload( payloadType, payloadSize )
}
Code:
user_data_unregistered( payloadSize ) {
    uuid_iso_iec_11578
    for( i = 16; i < payloadSize; i++ )
        user_data_payload_byte
}
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 27th June 2011 at 17:58.
LoRd_MuldeR is offline   Reply With Quote
Old 27th June 2011, 13:58   #12  |  Link
phdzwei
Registered User
 
Join Date: Feb 2011
Posts: 18
Based on SEI NAL standard, if the payloadsize is A, there will be A/255 numbers of 0XFF and A%255 in bitstream.

How can I calculate "ff_byte"?
The following is SEI NALU, how can I analyze them?
06 05 FF 6F DC 45 E9 BD E6 D9 48 B7 96 2C D8 20 D9 23 EE EF 78 32 36 34 20 2D 20 63 6F 72 65 20 34 37 20 2D 20 48 2E 32 36 34 2F 4D 50 45 47 2D 34 20 41 56 43 20 63 6F 64 65 63 20 2D 20 43 6F 70 79 6C 65 66 74 20 32 30 30 35 20 2D 20 68 74 74 70 3A 2F 2F 77 77 77 2E 76 69 64 65 6F 6C 61 6E 2E 6F 72 67 2F 78 32 36 34 2E 68 74 6D 6C 20 2D 20 6F 70 74 69 6F 6E 73 3A 20 63 61 62 61 63 3D 31 20 72 65 66 3D 31 20 64 65 62 6C 6F 63 6B 3D 31 3A 30 3A 30 20 61 6E 61 6C 79 73 65 3D 30 78 31 3A 30 78 31 31 31 20 6D 65 3D 68 65 78 20 73 75 62 6D 65 3D 35 20 62 72 64 6F 3D 30 20 6D 69 78 65 64 5F 72 65 66 3D 30 20 6D 65 5F 72 61 6E 67 65 3D 31 36 20 63 68 72 6F 6D 61 5F 6D 65 3D 31 20 74 72 65 6C 6C 69 73 3D 30 20 38 78 38 64 63 74 3D 30 20 63 71 6D 3D 30 20 63 68 72 6F 6D 61 5F 71 70 5F 6F 66 66 73 65 74 3D 30 20 73 6C 69 63 65 73 3D 31 20 6E 72 3D 30 20 64 65 63 69 6D 61 74 65 3D 31 20 62 66 72 61 6D 65 73 3D 30 20 6B 65 79 69 6E 74 3D 32 35 30 20 6B 65 79 69 6E 74 5F 6D 69 6E 3D 32 35 20 73 63 65 6E 65 63 75 74 3D 34 30 20 72 63 3D 63 71 70 20 71 70 3D 32 36 20 69 70 5F 72 61 74 69 6F 3D 31 2E 34 30 00 80

06 means that it is SEI NALU.
05 means that it is user data unregistered message.
How about payloadsize, last_payload_type_byte, last_payload_size_byte and ff_type?

If our payload size is 65536 bytes? How about these value?

Thank you

Last edited by phdzwei; 28th June 2011 at 02:50.
phdzwei is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.