2016-08-16 28 views
1

トランスコードせずにgstreamerを使用してmpeg-tsビデオファイルをブロードキャストする必要があります。 ビデオがで符号化される:H264 - 私はgstreamerを使用してudpにローカルmpeg-tsファイルをストリーミング

gst-launch-1.0 filesrc location=my_video.ts ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=49444 

とストリームと

gst-launch-1.0 udpsrc caps=" application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,payload=(int)96,ssrc=(uint)2674837201,clock-base=(uint)2959668548,seqnum-base=(uint)14300" port=49444 ! rtph264depay ! decodebin ! autovideosink 

でプレイしようとしたMPEG-4 AVC(その10)(H264)

しかしレシーバーの側にある動画は元に戻っています(元の動画と少し似ていますが)。 enter image description here

これはたくさんの受信機のコンソールに表示:

WARNING: from element /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0: Could not decode stream. 
Additional debug info: 
gstrtph264depay.c(1205): gst_rtp_h264_depay_process(): /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0: 
Undefined packet type 

私は間違っていますか?私は、問題は要素のcapsパラメータにあります。これは、Webのいくつかの例からコピーしたものです。それが問題ならば、capsパラメータのプロッタ値はどのようにして調べることができますか?

答えて

2

tsファイルからh264parseに直接移動することはできません。最初にtsストリームをdemuxする必要があります。これはtsdemuxで行われます。

これは魔法のパイプである:それは動作しない場合がありtsparseセットタイムスタンプなし

gst-launch-1.0 filesrc location=dummy_h264.ts ! tsparse set-timestamps=true ! video/mpegts ! tsdemux ! video/x-h264 ! h264parse disable-passthrough=true ! rtph264pay ! udpsink -v host=127.0.0.1 port=9999 

タイムスタンプ情報は、あなたのTSファイルに存在しないかもしれないので - あなたは適切なPCRは、フレームがあるかどうかを確認する必要があります - 多分いくつかのmpeg TSアナライザーで。

とデバッグ出力 - あなたはudpsinkの話回線からキャップを取る:

Setting pipeline to PAUSED ... 
Pipeline is PREROLLING ... 
/GstPipeline:pipeline0/MpegTSParse2:mpegtsparse2-0.GstPad:src: caps = "video/mpegts\,\ systemstream\=\(boolean\)true\,\ packetsize\=\(int\)188" 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/mpegts\,\ systemstream\=\(boolean\)true\,\ packetsize\=\(int\)188" 
/GstPipeline:pipeline0/GstTSDemux:tsdemux0.GstPad:sink: caps = "video/mpegts\,\ systemstream\=\(boolean\)true\,\ packetsize\=\(int\)188" 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/mpegts\,\ systemstream\=\(boolean\)true\,\ packetsize\=\(int\)188" 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2: caps = video/x-h264 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)nal" 
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)nal" 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)nal" 
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)high\,\ level\=\(string\)2\,\ codec_data\=\(buffer\)01640014ffe1001967640014acd94141fb0110000003001000000303c8f142996001000568ebecb22c" 
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)640014\,\ sprop-parameter-sets\=\(string\)\"Z2QAFKzZQUH7ARAAAAMAEAAAAwPI8UKZYA\\\=\\\=\\\,aOvssiw\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)3030226714\,\ timestamp-offset\=\(uint\)3947899684\,\ seqnum-offset\=\(uint\)32736" 
------------TAKE THIS ONE:-------------- 
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)640014\,\ sprop-parameter-sets\=\(string\)\"Z2QAFKzZQUH7ARAAAAMAEAAAAwPI8UKZYA\\\=\\\=\\\,aOvssiw\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)3030226714\,\ timestamp-offset\=\(uint\)3947899684\,\ seqnum-offset\=\(uint\)32736" 
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)high\,\ level\=\(string\)2\,\ codec_data\=\(buffer\)01640014ffe1001967640014acd94141fb0110000003001000000303c8f142996001000568ebecb22c" 
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 3947910934 
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 32736 
Pipeline is PREROLLED ... 
Setting pipeline to PLAYING ... 
New clock: GstSystemClock 
^Chandling interrupt. 
Interrupt: Stopping pipeline ... 
Execution ended after 0:00:03.631302966 
Setting pipeline to PAUSED ... 
Setting pipeline to READY ... 
Setting pipeline to NULL ... 
Freeing pipeline ... 

次に、このようにそれを再生する:あなたは周り "を追加する必要はありません

gst-launch-1.0 udpsrc port=9999 ! application/x-rtp\,\ media\=\... ! queue ! rtph264depay ! decodebin ! videoconvert ! glimagesink 

注は、そのキャップ既にエスケープされています。

+0

ありがとうございました!あなたの魔法のパイプはうまく動作します! しかし、私は 'queue'要素を追加するまで受信ビデオに何か不具合がありましたプレイヤーのパイプラインで – Paboka

+0

@Paboka ok私は答えを編集しました..それは意味があるどこでもキューを持つのが良いですが、私はdecodebinがすでに内部的にいくつかのキューを使用していると思います.. – nayana

関連する問題