简体   繁体   English

将RTP vp8有效负载数据包保存到.webm文件

[英]Save RTP vp8 payload packets to .webm file

I have saved a video call to a .pcap file with Wireshark, and I want to acquire the video from RTP packets. 我已经使用Wireshark将视频通话保存到.pcap文件,我想从RTP数据包中获取视频。 RTP packets payload type is vp8 , I could find out the vp8 RTP packets by using libpcap library in C++. RTP数据包的有效载荷类型为vp8 ,我可以使用C ++中的libpcap库找出vp8 RTP数据包。 Then I saved the contents of all RTP vp8 packets to a file. 然后,我将所有RTP vp8数据包的内容保存到一个文件中。 But i can not convert this raw vp8 data to .mp4 by using ffmpeg. 但是我无法使用ffmpeg将原始vp8数据转换为.mp4。 ffmpeg gives error during conversion. ffmpeg在转换过程中出错。 ffmpeg conversion error : Invalid data found when processing input ffmpeg转换错误: 处理输入时发现无效数据

What are the steps to get .mp4 or .webm video file from vp8 RTP packets? 从vp8 RTP数据包中获取.mp4.webm视频文件的步骤是什么?

Edit : I could get raw VP8 data excluding VP8 payload descriptor, payload header and keyframe header. 编辑:我可以获取原始VP8数据,但不包括VP8有效负载描述符,有效负载标头和关键帧标头。 Then I added ivf header and frame header for each vp8 raw frame, according to ivf document IVF Document 然后根据ivf文档IVF文档 ,为每个vp8原始帧添加了ivf标头和帧标头

But When I want to convert my ivf file (output1) to output1.mp4 by using ffmpeg 但是当我想通过使用ffmpeg将ivf文件(output1)转换为output1.mp4时

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

I get errors 我收到错误

转换错误

JanusGateway is having functionality to convert RTP (VP8/VP9/H264/Opus) to (webm/mp4). JanusGateway具有将RTP(VP8 / VP9 / H264 / Opus)转换为(webm / mp4)的功能。 It will just encode RTP to corresponding container(webm/mp4/opus), no transcoder is included. 它将仅将RTP编码到相应的容器(webm / mp4 / opus),不包括转码器。

You can use ffmpeg to transcode it to any other format. 您可以使用ffmpeg将其转码为任何其他格式。

In brief, janus will store RTP packets in a file by adding a prefix header in each packet. 简而言之,janus将通过在每个数据包中添加一个前缀标头将RTP数据包存储在文件中。 Then we can use post processor to convert vp8 RTP packets to webm. 然后,我们可以使用后处理器将vp8 RTP数据包转换为webm。

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

You can see the live demo & Documentation . 您可以查看现场演示文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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