[FFmpeg-devel] [PATCH] h264 bitstream filter

Benoit Fouet benoit.fouet
Tue Sep 4 14:50:38 CEST 2007


Michael Niedermayer wrote:
> Hi
>
> On Tue, Sep 04, 2007 at 02:40:50PM +0200, Benoit Fouet wrote:
>   
>> Michael Niedermayer wrote:
>>     
>>> Hi
>>>
>>> On Tue, Sep 04, 2007 at 02:35:01PM +0200, Benoit Fouet wrote:
>>>   
>>>       
>>>> Michael Niedermayer wrote:
>>>>     
>>>>         
>>>>> Hi
>>>>>
>>>>> On Tue, Sep 04, 2007 at 09:10:43AM +0200, Benoit Fouet wrote:
>>>>>   
>>>>>       
>>>>>           
>>>>>> Loren Merritt wrote:
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>>> On Mon, 3 Sep 2007, Trent Piepho wrote:
>>>>>>>
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>>>> In the standard, it says stuff like:
>>>>>>>>
>>>>>>>> "Annex B \n Byte stream format"
>>>>>>>> "B.1 Byte stream NAL unit syntax and semantics"
>>>>>>>> "B.2 Byte stream NAL unit decoding process"
>>>>>>>>
>>>>>>>> That phase "Byte stream NAL unit" is used over and over.  So maybe
>>>>>>>> something like bsnal or bsNAL?
>>>>>>>>     
>>>>>>>>         
>>>>>>>>             
>>>>>>>>                 
>>>>>>> "Byte stream NAL unit" is a specific piece of the format. "Annex B byte 
>>>>>>> stream" is the name of the format as a whole, which I would abbreviate 
>>>>>>> "Annex B".
>>>>>>>
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>> updated patch attached, which also takes advantage of the brand new
>>>>>> close filter function :)
>>>>>>     
>>>>>>         
>>>>>>             
>>>>> doesnt the code miss reformating slices and other multiple nal units
>>>>> per frame?
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>> i was thinking that the filter received nal units, not frames.
>>>> am i wrong ?
>>>>     
>>>>         
>>> it should receive frames but it would be best if it would work with
>>> both frames as well as nal units ...
>>>
>>>   
>>>       
>> that means input has to be parsed, or ?
>> is there such a parser ?
>>     
>
> ?
>
> if you get nal units you output nal units
> if you get frames you output frames
> just change the headers from len to 001
>
>   

this means reallocating in case len is not coded on 4 bytes
consider a frame like:
AUD | SEI | ...
headers for AUD and SEI frames have to be changed (possibly reallocate
memory to handle it)
then if the following nal unit is an IDR one, sps and pps data has to be
prepended (and header changed)

but yes, this can be done :)

-- 
Ben
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-devel mailing list