2

VLCを使用して、UDPoverLANを介してMPEGTSコンテナ内のH264ビデオファイルをストリーミングします。Wiresharkを使用してクライアント側でパケットをキャプチャします。ここで、pcapファイルを見つけることができます:http ://www.sendspace.com/file/w0sf36

I、P、またはBフレームを識別するためにMPEG PESを使用する必要があるというのは本当ですか?もしそうなら、どうすればそれを行うことができますか?これが1つのMPEGPESパケットのデータです:http://pastebin.com/NayLBx5w。バイト0x000x000x000x01で始まります。目標を達成するには、どのバイトを使用する必要がありますか?

pcapファイルでは、MPEG PESパケットがすべてのストリームの2%しか使用せず、その他のパケットは単純なUDPであることがわかります。MPEG PESパケットを処理するだけで十分ですか?この場合、UDPパケットはどのような情報を伝達しますか?

編集:これは、ffprobeを使用してWindowsで取得する典型的な出力です。

[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]
4

1 に答える 1

1

ファイル使用の形でコンテンツを持っている限り

 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スクリプトなどを記述して、すべてのフレームの正確な詳細を伝えることができます。

于 2012-08-06T19:59:30.020 に答える