4
votes

I am going to convert h.264 stream data to .mp4 using ffmpeg

SPS NALU:67 64 00 1F AC 56 50 20 06 1A 6E 04 04 04 0D A0 88 46 58

PPS NALU:28 EE 37 27

I made raw file using these above NALUs as follows:

|0x 00 00 00 01 | SPS | 0x 00 00 01 | PPS | frame data | 0x 00 00 01|

my raw file is here : https://www.dropbox.com/s/gc9s9mll6ev9aoq/sps_pps_payload?dl=0

and frame data it self: https://www.dropbox.com/s/ibs7io0aprpo66e/packet1?dl=0

using following command at ffmpeg:

ffmpeg.exe -f h264 -i RawInputFile -vcodec copy -r 25 OutPutFilename.mp4

But it always gives: missing picture in access unit with size XXXXX

no frame!

decoding for stream 0 failed

Could not find codec parameters for stream 0 : unspecified size

Where am i wrong?

2
I am also waiting to hear the inputs from experts..!!Kanak Sony

2 Answers

1
votes

How are you generating the "RawInputFile"? Looking at the SPS, PPS buffer there are different frame headers, 0x00 0x00 0x00 0x01 in case of SPS 0x00 0x00 0x01 in case of PPS. Though it should not be the problem.

But there are different NAL headers as well, in case of SPS it is 0x67 and in case of PPS it 0x28. The lower five bits of the NAL represents the frame type

e.g.

0x67 & 0x1f = 0x07 which is SPS

0x28 & 0x1f = 0x08 which is PPS

But why the upper three bits are changing? Need to check what these 3 bits represent.

Regarding your question, FFMPEG or any other muxer expects input stream in following format,

0x00 0x00 0x00 0x01 0x67 <<......SPS frame......>>

0x00 0x00 0x00 0x01 0x68 <<......PPS frame.......>>

0x00 0x00 0x00 0x01 0x65 <<......I frame........>>

0x00 0x00 0x00 0x01 0x61 <<......P frame........>>

.

.

0x00 0x00 0x00 0x01 0x67 <<......SPS frame......>>

0x00 0x00 0x00 0x01 0x68 <<......PPS frame......>>

Note : Here 0x67, 0x68 etc are for example purpose only, upper 3 bits can change.

0
votes

you will get "missing picture in access unit with size xxxx" if you do not complete your file with a keyframe (I frame). Just make sure that last frame of your file is I frame.