Okey傢伙我認爲用gstreamer幾天後我就明白了,我寫了一些管道可以合乎邏輯地工作,但是在將流保存到文件時我感到頭疼。Gstreamer瞭解
gst-launch-1.0 rtspsrc location=rstp://ip/url ! decodebin ! textoverlay text="Work you damn thing " ! x264enc ! h264parse ! mp4mux ! filesink location=some_video.mp4
歐凱這是我的邏輯:
1. rtspsrc - has one pad and it's src it outputs x/rtps
2. decodebin - is a bin (bunch of elements) it has ghost pads and one of those
sink pads accept x/rtps then on source pad it generates raw video
4. x264enc - accepts raw video on sink pad and encodes it to a h264 raw
video
5. h264parse - accepts raw h264 on sink and it parse it to h264 video
6. mp4mux - muxing it
7. filesink - it sinks it to a file
一切都很好,但之後,我完成錄製它,當我嘗試播放它,我得到這個錯誤:
This file contain no playable stream
如果有是那裏的gstreamer的一些經驗豐富的用戶,我想問他們我的邏輯漏洞在哪裏以及這個錯誤的原因是什麼?
我發現它總是有用的分開管道和注入自動鏈接(autovideosink),如果需要一個解碼器逐步查看所需輸出丟失的地方。 -vvvvv標誌也提供了很多有用的信息。嘗試在textoverlay之後直接放置一個autovideosink,然後再放入一個解碼器!如果這是很好的autovideosink組合。看看mp4mux背後的視頻是否還好。 – damg 2014-09-05 07:47:17
我知道了我需要-e標誌在rtpssrc之前我不知道那個標誌是什麼 – 2014-09-05 08:13:17