gpt4 book ai didi

linux - 无法使用 Gstreamer 从电视卡录制视频和声音

转载 作者:太空宇宙 更新时间:2023-11-04 12:22:22 24 4
gpt4 key购买 nike

我有一 block 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。

最佳答案

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

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

关于linux - 无法使用 Gstreamer 从电视卡录制视频和声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45627874/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com