media-server icon indicating copy to clipboard operation
media-server copied to clipboard

针对 测试用例,如下。能说明下E:\\work\\media-server\\rtmp2hls\\192.168.31.132.6974.96.VP8 这个source代表的是什么吗?

Open dualven opened this issue 9 months ago • 6 comments

//rtp_payload_test(96, "VP8", 2948, 1447139175, "E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8.rtp", "E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8"); //binary_diff("E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8.rtp", "out.rtp"); //binary_diff("E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8", "out.media"); (1) 能说明下E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8 这个source代表的是什么吗? (2) 是否能提供下测试所用的测试文件 ,谢谢。

dualven avatar Mar 29 '25 10:03 dualven

@ireader

dualven avatar Mar 29 '25 11:03 dualven

192.168.31.132.6974.96.VP8.rtp 是预期的rtp包组成的二进制文件 192.168.31.132.6974.96.VP8 是预期的原始VP8流文件

binary_diff("E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8.rtp", "out.rtp");
binary_diff("E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8", "out.media");

这俩行是用来测试rtp组包/解包功能是否正确。

ireader avatar Mar 31 '25 03:03 ireader

能否给套vp9的测试数据文件给我,我用ffmpeg做了一个 rtp的文件(用VP9编码的),在运行过程中报错,无法运行完成。 我想看看你给的数据文件能不能验证完成?

dualven avatar Mar 31 '25 07:03 dualven

我用vp9解封与封装后,大概可以跑起来了,但看不到图像。 也不知道怎么验证这个payload是否正确,请指教下,谢谢

2025-03-31

dualven

发件人:Chen @.> 发送时间:2025-03-31 11:25 主题:Re: [ireader/media-server] 针对 测试用例,如下。能说明下E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8 这个source代表的是什么吗? (Issue #373) @.> @.>@.>

192.168.31.132.6974.96.VP8.rtp 是预期的rtp包组成的二进制文件 192.168.31.132.6974.96.VP8 是预期的原始VP8流文件 binary_diff("E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8.rtp", "out.rtp"); binary_diff("E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8", "out.media");

这俩行是用来测试rtp组包/解包功能是否正确。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>ireader left a comment (ireader/media-server#373) 192.168.31.132.6974.96.VP8.rtp 是预期的rtp包组成的二进制文件 192.168.31.132.6974.96.VP8 是预期的原始VP8流文件 binary_diff("E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8.rtp", "out.rtp"); binary_diff("E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8", "out.media");

这俩行是用来测试rtp组包/解包功能是否正确。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

dualven avatar Mar 31 '25 07:03 dualven

可以用ffplay直播播放rtp解封装生成的out.media文件,这个文件就是vp9的裸流。

ireader avatar Mar 31 '25 14:03 ireader

有如下疑问请教 (1)我通过如下代码生成的rtp 文件 ,在rtp-payload-test.cpp 中运行会报错; (2) 通过下面方式 生成的rtp文件,也不能通过ffmpeg解封,请教下,是哪儿错了吗?

import subprocess import time

生成 RTP 报文到文件

def generate_rtp(input_file, output_file): command = f'ffmpeg -re -i {input_file} -c:v libvpx-vp9 -strict experimental -b:v 1M -f rtp {output_file}' subprocess.run(command, shell=True) print(f"正在生成 RTP 报文并保存到 {output_file}")

从文件解封 RTP 报文为视频帧

def decode_rtp(input_file, output_file): # 若输入无音频,-an参数可使ffmpeg在处理时忽略音频,直接保存视频 command = f'ffmpeg -i {input_file} -an -c:v copy {output_file}' subprocess.run(command, shell=True) print(f"正在解封 RTP 报文并保存到 {output_file}")

if name == "main": input_mp4_file = 'input.mp4' rtp_file = 'rtp_data.rtp' output_mp4_file = 'out.mp4'

# 生成 RTP 报文
generate_rtp(input_mp4_file, rtp_file)

# 等待一段时间确保 RTP 报文生成完成
time.sleep(2)

# 解封 RTP 报文
decode_rtp(rtp_file, output_mp4_file)

2025-04-01

dualven

发件人:Chen @.> 发送时间:2025-03-31 22:13 主题:Re: [ireader/media-server] 针对 测试用例,如下。能说明下E:\work\media-server\rtmp2hls\192.168.31.132.6974.96.VP8 这个source代表的是什么吗? (Issue #373) @.> @.>@.>

可以用ffplay直播播放rtp解封装生成的out.media文件,这个文件就是vp9的裸流。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>ireader left a comment (ireader/media-server#373) 可以用ffplay直播播放rtp解封装生成的out.media文件,这个文件就是vp9的裸流。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

dualven avatar Apr 01 '25 05:04 dualven