2014-09-04 26 views
0

歐凱我有這樣的命令:添加textoverlay到RTPS蒸汽並將其保存到一個文件

這一個顯示與textoverlay流過它

gst-launch-1.0 rtspsrc location=rtsp://ip/url ! decodebin ! textoverlay text = "Hello world" ! autovideosink 

這一次使用可以節省流的MP4 MP4容器

gst-launch-1.0 rtspsrc location=rtsp://ip/url ! rtsh264depay ! h264parse ! mp4mux ! filesink location=someFile.mp4 

我怎麼能在同一時間做到這一點?我的意思是我想保存覆蓋文字的文件?如果我理解得很好,我應該用decodebin解碼,然後再解碼,但Iam比特丟失了。

回答

0

這是相當簡單,你基本上有它。

如果你結合你的兩個管道,它應該工作得很好(取決於帽等)。

gst-launch-1.0 rtspsrc location=rtsp://ip/url ! decodebin ! textoverlay text = "Hello world" ! x264enc ! h264parse ! mp4mux ! filesink location=someFile.mp4 

同樣的想法,但採用MPEG4

gst-launch-1.0 rtspsrc location=rtsp://ip/url ! decodebin ! textoverlay text = "Hello world" ! avenc_mpeg4 ! mp4mux ! filesink location=someFile.mp4 
+0

嗯,我閱讀文檔後,想出了同樣的想法。 Rtspsrc有1個pad和source(輸出x/rtps)。解碼器有1個sink和1個source pad,它可以接受sink上的x/rtps。解碼器源輸出是一個原始視頻.Textoverlay有1個sink和1個source pad都接受/生成原始video.X264enc原始視頻到原始h264視頻。 h264parse解析that.mp4mux是將它添加到一個多路複用器,最後我們有filesink它合法,如果你認爲邏輯上,但寫在終端後,我得到錯誤。 – 2014-09-05 06:42:46

+0

此文件不包含可播放流 – 2014-09-05 07:11:43

+0

然後在mpeg4中進行編碼,而不是在h264 – 2014-09-05 12:42:07

相關問題