H.264 decoding using gstreamer and ffmpeg

I have a voip application that I am working on using the OPIP voip SIP stack.

I redefine a class called OpalLocalEndpoint and read / write encoded data to and from my gstreamer pipelines. For reading, I grab data with rtp payload from the application, and for writing, I click useful information on appsrc.

I grabbed SDP files from wirehark.

Here is the application client.

v=0 o=- 1319058426 1 IN IP4 192.168.0.71 s=Opal SIP Session c=IN IP4 192.168.0.71 t=0 0 m=audio 5086 RTP/AVP 125 0 8 124 101 a=sendrecv a=rtpmap:125 Speex/16000/1 a=fmtp:125 sr=16000,mode=any a=rtpmap:0 PCMU/8000/1 a=rtpmap:8 PCMA/8000/1 a=rtpmap:124 Speex/8000/1 a=fmtp:124 sr=8000,mode=any a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16,32,36 m=video 5088 RTP/AVP 109 108 34 114 b=AS:4096 b=TIAS:4096000 a=sendrecv a=rtpmap:109 h264/90000 a=fmtp:109 packetization-mode=1;profile-level-id=42C01E a=rtpmap:108 h263-1998/90000 a=fmtp:108 D=1;F=1;I=1;J=1;CIF=1;CIF4=1;QCIF=1;CUSTOM=320,240,1;CUSTOM=640,480,1 a=rtpmap:34 h263/90000 a=fmtp:34 F=1;CIF=1;CIF4=1;QCIF=1 a=rtpmap:114 MP4V-ES/90000 a=fmtp:114 profile-level-id=5 

Here is the server responding back to the client

 v=0 o=- 1319058099 1 IN IP4 192.168.0.215 s=HHP Video Codec/1.0 c=IN IP4 192.168.0.215 t=0 0 m=audio 5006 RTP/AVP 125 0 8 124 a=inactive a=rtpmap:125 Speex/16000/1 a=rtpmap:0 PCMU/8000/1 a=rtpmap:8 PCMA/8000/1 a=rtpmap:124 Speex/8000/1 a=maxptime:20 m=video 5004 RTP/AVP 109 b=AS:2048 b=TIAS:2048000 a=sendrecv a=rtpmap:109 h264/90000 a=fmtp:109 packetization-mode=1;profile-level-id=42c01e 

I encode data with

  v4l2src name=videoSrc ! video/x-raw-yuv, format=(fourcc)I420, width=352, height=288, framerate=(fraction)30/1 ! videobalance name=VideoBalance ! textoverlay name=chanNameFilter ! textoverlay name=osdMessageFilter ! textoverlay name=sessionTimerOverlay ! x264enc byte-stream=true bframes=0 b-adapt=0 tune=0x4 speed-preset=3 bitrate=256 sliced-threads=false profile=0 ! rtph264pay mtu=1412 ! appsink name=videoAppSink sync=false 

And try to decode the input with

 appsrc is-live=true do-timestamp=false typefind=true name=videoAppSrc ! application/x-rtp, media=video, payload=109, clock-rate=90000, encoding-type=H264, byte-stream=true, access-unit=true ! rtph264depay ! ffdec_h264 ! xvimagesink name=videoOutputSink 

However, while the encoded data appears on the client (at first it was not, I had to add all these properties until it appeared correctly), I was not able to get the end of decoding to work.

It shows mainly a gray screen with flashes of pink, yellow and green. Sometimes I get a little more right colors and most of the time just gray.

If I use the exact same pipeline to interact with VLC, it works fine. I guess I'm picking up hats somewhere. Can anyone suggest any ideas on what I should look for?

I have the same problems with each of my other coders, that is, with the theorem, h263, etc., although each is different.

+4
source share
1 answer

It turns out that the VOIP stack, which is otherwise a great stack, either has an error, or I donโ€™t understand how it packs and transmits RTP packets. I went around it and sent the data via gstreamer udpsink and udpsrc and it works fine. Now my remaining questions will be forwarded to the stack development team. Thank you for your help.

+2
source

All Articles