2017-08-11 60 views
0

我有一張SAA7134電視卡。我想用Gstreamer錄製帶有聲音的視頻。這個命令我使用,以確保我能聽到的聲音和它的作品使用Gstreamer無法錄製電視卡上的視頻和聲音

gst-launch-1.0 alsasrc device="hw:1,0" ! queue ! audioconvert ! alsasink 

該命令證明了我可以觀看視頻(也能正常工作)

gst-launch-1.0 v4l2src device=/dev/video0 ! xvimagesink 

此命令工作正常,讓我聲音寫入文件

gst-launch-1.0 alsasrc device="hw:1,0" ! queue ! audioconvert ! wavenc ! filesink location=/home/out/testout.wav 

但這命令只沒有任何聲音寫入視頻

gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! videoconvert ! jpegenc ! mux. alsasrc device="hw:1,0" ! queue ! audioconvert ! lamemp3enc bitrate=192 ! mux. avimux name=mux ! filesink location=/home/out/testout.avi 

同爲

gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! videoconvert ! theoraenc ! mux. alsasrc device="hw:1,0" ! queue ! audioconvert ! vorbisenc ! mux. oggmux name=mux ! filesink location=/home/out/testout.ogg 

如何解決這個問題?謝謝。

P.S.我使用Ubuntu 16.04.3 LTS。

回答

0

看起來我錯過了關於使用gst-launch語法的一個重要細節。我看了一遍,發現這個:

The -e option forces EOS on sources before shutting the pipeline down. This is useful when we write to files and want to shut down by killing gst-launch using CTRL+C or with the kill command 

當我測試這個選項時,我終於得到了視頻和音頻。

相關問題