ffmpeg - 无法使用 avconv 录制 S-Video

标签 ffmpeg video-capture libav avconv

我一直在尝试使用 avconv 从我的 S-Video 电缆录制提要。我可以使用 avconv 录制复合视频,但质量不是最好的。要设置输入,我使用 v4l2-ctl -i $n , 其中 $n为 0 表示复合,或 1 表示 S-Video。我尝试使用 v4l2-ctl -i 1设置输入,但这不起作用。奇怪的是,当我使用 tvtime 或 qv4l2 时,我可以观看视频。

我可以录制音频,但不能录制视频。在 tvtime 中,我可以获得音频和视频。此外,我还可以使用 -channel 使用 ffmpeg 录制 S-Video。选项。 ffmpeg,顺便说一句,无法录制音频,并且录制单独的音频不是一种选择。

编辑:根据 Anton 的要求,这是我使用 avconv 捕获视频的命令。

avconv -f video4linux2 -i /dev/video0 -f alsa -i hw:2,0 -vcodec mpeg4 -vtag xvid -b 8000k -r 30000/1001 -acodec \
libmp3lame -ar 48000 -ac 2 -ab 192k -aspect 16:9 -vf yadif=0,scale=1200:800 -y test.avi

这是此命令的输出:
avconv version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Apr  2 2013 17:02:16 with gcc 4.7.2
[video4linux2 @ 0x982340] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2, from '/dev/video0':
  Duration: N/A, start: 1368113780.210591, bitrate: 165722 kb/s
   Stream #0.0: Video: rawvideo, yuyv422, 720x480, 165722 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
[alsa @ 0x982ba0] Estimating duration from bitrate, this may be inaccurate
Input #1, alsa, from 'hw:2,0':
  Duration: N/A, start: 854.715783, bitrate: N/A
    Stream #1.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Incompatible pixel format 'yuyv422' for codec 'mpeg4', auto-selecting format 'yuv420p'
[buffer @ 0x9930a0] w:720 h:480 pixfmt:yuyv422
[yadif @ 0x997960] mode:0 parity:-1 auto_enable:0
[yadif @ 0x997960] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'Parsed filter 0 yadif'
[scale @ 0x985a80] w:720 h:480 fmt:yuyv422 -> w:720 h:480 fmt:yuv420p flags:0x4
[scale @ 0x998000] w:720 h:480 fmt:yuv420p -> w:1200 h:800 fmt:yuv420p flags:0x4
Output #0, avi, to 'test.avi':
  Metadata:
    ISFT            : Lavf53.21.1
    Stream #0.0: Video: mpeg4, yuv420p, 1200x800 [PAR 32:27 DAR 16:9], q=2-31, 8000 kb/s, 29.97 tbn, 29.97 tbc
    Stream #0.1: Audio: libmp3lame, 48000 Hz, 2 channels, s16, 192 kb/s
Stream mapping:
      Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
      Stream #1:0 -> #0:1 (pcm_s16le -> libmp3lame)

最佳答案

尝试这个:

avconv -f video4linux2 -i /dev/video0 -f alsa -ac 1 -i hw:2,0 \
-vcodec mpeg4 -vtag xvid -b 8000k -r 30000/1001 -acodec \
libmp3lame -ar 48000 -ac 2 -ab 192k -aspect 16:9 
-vf yadif=0,scale=1200:800 -y test.avi

注意-ac 1,必须设置音频 channel 。另请注意\用于换行。

关于ffmpeg - 无法使用 avconv 录制 S-Video,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16447854/

相关文章:

image - 合并一个音频文件和一个图像文件,用 ffmpeg 创建一个视频

video-streaming - 通过 Java 进行视频捕获(实时视频流)

python - 代码检测网络摄像头时,cv2 模块未捕获图像

encoding - 如何在录制和输入实时视频流之间同步?

python - 当我尝试导出 Mp3 的一部分时,pydub 返回零字节文件

c# - 如何在 C# 中停止 ffmpeg 用户屏幕录制

javascript - Node.JS:FFmpeg 管道视频编码未创建缩略图

c++ - FFMPEG 从内存中读取音频不起作用

c++ - 为 ffmpeg 编码设置 RGB 帧的单个像素

FFMPEG队列输入及时向后