捕获屏幕时没有声音

时间:2018-01-09 16:01:07

标签: audio ffmpeg screenshot

使用以下ffmpeg命令捕获我的电脑屏幕。

ffmpeg -f pulse -ac 2 -i default -f x11grab -r 30 -s 1920x1080 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -threads 0 -y /tmp/output.mkv

我的控制台上显示的输出何时执行上述命令。

Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, pulse, from 'default':
  Duration: N/A, start: 1515543051.106987, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[x11grab @ 0x564bda5b8520] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #1, x11grab, from ':0.0':
  Duration: N/A, start: 1515543052.415508, bitrate: N/A
    Stream #1:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1920x1080, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x564bda5c1560] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 LZCNT
[libx264 @ 0x564bda5c1560] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[libx264 @ 0x564bda5c1560] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=6 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, matroska, to '/tmp/output.mkv':
  Metadata:
    encoder         : Lavf57.56.101
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 1920x1080, q=-1--1, 30 fps, 1k tbn, 30 tbc
    Metadata:
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      encoder         : Lavc57.64.101 pcm_s16le
Stream mapping:
  Stream #1:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))

播放音乐何时制作屏幕截图,我可以听到音乐播放声音 奇怪的是,当播放捕获的/tmp/output.mkv时,vedio完全没有声音。

使用pavucontrol打开音量控制。

在录制窗口中没有任何内容,也许空白录制窗口无法在何时捕获屏幕! 如何解决?

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

解决。

 System.out.println(s.substring(index));

将test.mkv的输出文件格式更改为test.avi。