【问题标题】:Can't record both video and sound from TV card using Gstreamer无法使用 Gstreamer 从电视卡录制视频和声音
【发布时间】:2017-08-11 05:53:40
【问题描述】:

我有一张 SAA7134 电视卡。我想使用 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

如何解决问题?谢谢。

附:我使用的是 Ubuntu 16.04.3 LTS。

【问题讨论】:

    标签: linux gstreamer v4l2 gst-launch


    【解决方案1】:

    看来我错过了有关使用 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
    

    当我测试这个选项时,我终于得到了视频和音频。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-02
      • 2011-02-06
      相关资源
      最近更新 更多