![](/img/trans.png)
[英]Gstreamer: Turn YUV(4:2:2) raw video into mp4 (w/ h264 encoding)
[英]Gstreamer x-raw to h264 mp4
我正在使用的某些軟件的文檔說使用此 gstreamer 管道從相機傳輸 stream 視頻:
gst-launch-1.0 v4l2src device=/dev/video5 ! video/x-raw ! videoconvert ! v4l2h264enc ! h264parse config-interval=3 ! rtph264pay mtu=1024 ! udpsink host=127.0.0.1 port=5600
如果我想將它改編為 pipe 到 a.mp4,我認為這樣的事情會起作用:
gst-launch-1.0 v4l2src device=/dev/video5 ! video/x-raw ! videoconvert ! v4l2h264enc ! h264parse config-interval=3 ! filesink location=test.mp4
但生成的文件無法在 vlc 中播放。
我錯過了什么?
提前致謝。
您將使用容器(例如此處的 qtmux):
# For recording 100 frames:
gst-launch-1.0 v4l2src device=/dev/video5 num-buffers=100 ! video/x-raw ! videoconvert ! v4l2h264enc ! h264parse config-interval=3 ! qtmux ! filesink location=test.mp4
# If you want to stop mnaually with Ctrl-C, add EOS:
gst-launch-1.0 -e v4l2src device=/dev/video5 ! video/x-raw ! videoconvert ! v4l2h264enc ! h264parse config-interval=3 ! qtmux ! filesink location=test.mp4
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.