我使用VLC通过UDP over LAN传输MPEG TS容器中的H264视频文件。我用Wireshark在客户端捕获数据包,你可以在这里找到pcap文件:http://www.sendspace.com/file/w0sf36
我真的需要使用MPEG PES来识别I、P或B帧吗?如果是这样,我如何做到这一点?下面是一个MPEG包的数据:http://pastebin.com/NayLBx5w。它以字节0x00 0x00 0x00 0x01开头。我应该使用哪些字节来达到我的目标?
在pcap文件中,您可以看到MPEG PES数据包只占所有流的2%,其他数据包都是简单的UDP。是否足以处理MPEG PES数据包?在这种情况下,UDP数据包携带什么信息?
编辑:这是我在Windows中使用ffprobe得到的典型输出。
[PACKET]
codec_type=audio
stream_index=1
pts=54010800
pts_time=600.120000
dts=54010800
dts_time=600.120000
duration=2160
duration_time=0.024000
convergence_duration=N/A
convergence_duration_time=N/A
size=96
pos=1460384
flags=K
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=54012012
pts_time=600.133467
dts=54006006
dts_time=600.066733
duration=3003
duration_time=0.033367
convergence_duration=N/A
convergence_duration_time=N/A
size=207953
pos=1098672
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=54009009
pts_time=600.100100
dts=54009009
dts_time=600.100100
duration=3003
duration_time=0.033367
convergence_duration=N/A
convergence_duration_time=N/A
size=145530
pos=1311676
flags=_
[/PACKET]
[PACKET]
codec_type=audio
stream_index=1
pts=54012960
pts_time=600.144000
dts=54012960
dts_time=600.144000
duration=2160
duration_time=0.024000
convergence_duration=N/A
convergence_duration_time=N/A
size=96
pos=1507948
flags=K
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=54018018
pts_time=600.200200
dts=54012012
dts_time=600.133467
duration=3003
duration_time=0.033367
convergence_duration=N/A
convergence_duration_time=N/A
size=46173
pos=1460572
flags=_
[/PACKET]发布于 2012-08-07 03:59:30
只要你有文件形式的内容,就可以使用
ffprobe -show_packets <your_file>以获取流中每个数据包的详细信息。它可以是任何有效的视频文件。
这是我的一个文件的不完整输出。
[FRAME]
media_type=video
key_frame=0
pkt_pts=2
pkt_pts_time=0.100000
pkt_dts=2
pkt_dts_time=0.100000
pkt_duration=1
pkt_duration_time=0.050000
pkt_pos=301347
width=320
height=240
pix_fmt=yuv420p
sample_aspect_ratio=N/A
pict_type=P
coded_picture_number=2
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
reference=0
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=0
pkt_pts_time=0.000000
pkt_dts=0
pkt_dts_time=0.000000
pkt_duration=1024
pkt_duration_time=0.021333
pkt_pos=306587
sample_fmt=s16
nb_samples=1024
[/FRAME]您可以编写一个非常简单的perl脚本或类似的脚本来告诉您每个帧的确切细节。
https://stackoverflow.com/questions/11834946
复制相似问题