0
votes

I have saved a video call to a .pcap file with Wireshark, and I want to acquire the video from RTP packets. RTP packets payload type is vp8, I could find out the vp8 RTP packets by using libpcap library in C++. Then I saved the contents of all RTP vp8 packets to a file. But i can not convert this raw vp8 data to .mp4 by using ffmpeg. ffmpeg gives error during conversion. ffmpeg conversion error : Invalid data found when processing input

What are the steps to get .mp4 or .webm video file from vp8 RTP packets?

Edit : I could get raw VP8 data excluding VP8 payload descriptor, payload header and keyframe header. Then I added ivf header and frame header for each vp8 raw frame, according to ivf document IVF Document

But When I want to convert my ivf file (output1) to output1.mp4 by using ffmpeg

ffmpeg -i output1 -c:v vp8 output1.mp4

I get errors

convertion error

1
"Then I saved the contents of all RTP vp8 packets to a file." - did you maintain packet boundaries? I.e. is it just binary concatenated garbage or is each packet still an individual VP8 frame with valid timestamps etc.?Ronald S. Bultje
I get all RTP packets including VP8 and Then I have extracted RTP header from these packets and I saved RTP payload data. The data that I saved is only concatenated RTP payloads. And now I want to acquire the video from that raw data.Probably, Firstly I have to find the boundaries of each frame and then I have to add a header for each frame to be able to play in vp8 format. I could extract vp8 payload header by using S bit and Part ID. So that I think I could find right the boundary of each frame.Ibrahim

1 Answers

1
votes

JanusGateway is having functionality to convert RTP (VP8/VP9/H264/Opus) to (webm/mp4). It will just encode RTP to corresponding container(webm/mp4/opus), no transcoder is included.

You can use ffmpeg to transcode it to any other format.

In brief, janus will store RTP packets in a file by adding a prefix header in each packet. Then we can use post processor to convert vp8 RTP packets to webm.

https://github.com/meetecho/janus-gateway/blob/master/postprocessing/pp-webm.c

You can see the live demo & Documentation.