简体   繁体   中英

h.264 udp stream decoding

I receive h.264 data throught UDP on Android. It looks, like a receive NAL units. What I want to do, is to extract the raw mpeg packets, that I can then push to my player. I use ijkplayer(build on ffmpeg) and it does not work if I push exactly the same data as I receive.

My question is: how can I extract raw h.264 packets. Is this stream wrapped in another protocol? Or is there possibility, that the stream is broken and some data is missing?

Data - shortened ... for brevity

0 0 0 1 97 0 -96 -101 -7 55 -117 1 82 -100 9 -107 -77 14 -20 -120 65 ...

0 0 0 1 97 0 80 38 -2 77 -1 57 -39 19 -20 86 -31 -47 11 122 -51 -82 ...

0 0 0 1 97 0 120 38 -2 77 -1 -118 7 -97 -80 -29 -2 -79 126 -25 47 3...

0 0 0 1 103 100 0 40 -84 -76 5 1 -19 -128 -86 64 0 0 3 0 -128 0 ...

0 0 0 1 104 -18 60 -80

0 0 0 1 97 0 -96 -102 25 51 -1 11 93 79 -78 94 -70 23 120 ...

0 0 0 1 97 0 80 38 -122 76 -1 16 80 -100 -84 -18 116 64 ...

0 0 0 1 97 0 120 38 -122 76 -1 26 -19 80 -103 -74 -31 44 ...

0 0 0 1 97 -102 57 51 -1 0 20 110 -37 37 -77 52 113 ...

0 0 0 1 is the h.264 start code. That is as "raw" as it gets. (there is no such think as an "mpeg packet")

我在另一个论坛上发现我需要等待“ 0 0 0 1 9”,这标志着访问单元的开始,然后可以将数据提供给MediaCodec。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM