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 ...
I found on another forum that I need to wait for "0 0 0 1 9" which marks the beginning of Access unit and then I can feed the data to MediaCodec.