0

I'm trying to display a video offered via a RTSP (RTP/H.264 encoded) GStreamer Server. I can open the stream with VLC and ffmpeg. I've implemented RTSP and RTP in Java/Android already. Everytime I put the H.264 frame (= Payload of RTP) in the MediaCodec, I get a "MediaCodec.INFO_TRY_AGAIN_LATER" on dequeing the output buffers of the MediaCodec.

I tried to prepend 0x0,0x0,0x0,0x1 to the H.264 packets but this did not solve the issue. How can I find out, what's going wrong. Are there any examples how to get the h.264 frame from RTP on Android/Java to pass it over to the media codec?

Edit: I dumped the H.264 Frames with FFMpeg to file. When I push these files to the MediaCodec on Android (with setting SPS and PPS) it does work for the sample RTSP stream rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov but not for my Gstreamer created RTSP stream. All packets (files) produced with Gstreamer have a Access Unit Delimiter (0x0 0x0 0x0 0x1 0x9...). The sample stream does not have this AUDs. I tried to remove these AUDs before passing the frames to the mediacodec, but still no luck.

Thank you

Soccertrash
  • 1,830
  • 3
  • 28
  • 48
  • See these two threads, http://stackoverflow.com/questions/7665217/how-to-process-raw-udp-packets-so-that-they-can-be-decoded-by-a-decoder-filter-i And http://stackoverflow.com/questions/1957427/detect-mpeg4-h264-i-frame-idr-in-rtp-stream?rq=1 They first one contains an implementation in C# of the depacketization process, the second one explains it also. There is always the RFC... – Jay Mar 18 '16 at 16:55
  • Thanks, yes, I've walked through the RFCs already. But obviously I'm doing something wrong. The MediaCodec does not say anything about the error it has – Soccertrash Mar 18 '16 at 17:13

0 Answers0