(Audio and video study notes): ffmpeg command audio and video recording

table of Contents

ffmpeg command video recording

Audio and video recording

View optional parameters for video recording

View optional parameters of audio equipment

Record audio and video with specified parameters

ffmpeg command video recording

 ffmpeg  -list_devices true -f dshow -i dummy
  • ③输入命令:DirectShow video devices (some may be both video and audio devices)
    • "Integrated Webcam" //notebook camera
    • "screen-capture-recorder"
  • ④Enter the command: DirectShow audio devices
    • "Microphone (Realtek Audio)"
    • "virtual-audio-capturer"

Audio and video recording

【Recording video (default parameters)】

  • desktop:
ffmpeg -f dshow -i video="screen-capture-recorder" v-out.mp4
  • webcam:
ffmpeg -f dshow -i video="Integrated Webcam" -y v-out2.flv (要根据自己摄像头名称)

【Recording sound (default parameters)】

  • System sound:
ffmpeg -f dshow -i audio="virtual-audio-cap
  • System + microphone sound:
ffmpeg -f dshow -i audio="麦克风 (Realtek Audio)" \
-f dshow -i audio="virtual-audio-capturer" -filter_complex \
amix=inputs=2:duration=first:dropout_transition=2 a-out2.aac

[Record sound and video at the same time (default parameters)]

ffmpeg -f dshow -i audio="麦克风 (Realtek Audio)" \
-f dshow -i audio="virtualaudio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 \
-f dshow -i video="screen-capture-recorder" -y av-out.flv

View optional parameters for video recording

  • command:
ffmpeg -f dshow -list_options true -i video="screen-capture-recorder"
[dshow @ 02f0d6c0] DirectShow video device options (from video devices)
[dshow @ 02f0d6c0] Pin "Capture" (alternative pin name "1")
[dshow @ 02f0d6c0] pixel_format=bgr0 min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 02f0d6c0] pixel_format=bgr0 min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 02f0d6c0] pixel_format=bgr24 min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 02f0d6c0] pixel_format=rgb555le min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 02f0d6c0] pixel_format=rgb555le min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 02f0d6c0] pixel_format=rgb8 min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 02f0d6c0] pixel_format=yuv420p min s=1x1 fps=0.02 max s=1920x1080 fps=30

View optional parameters of audio equipment

ffmpeg -f dshow -list_options true -i audio="virtual-audio-capturer“
[dshow @ 05a2d6c0] DirectShow audio only device options (from audio devices)
[dshow @ 05a2d6c0] Pin "Capture Virtual Audio Pin" (alternative pin name "1")
[dshow @ 05a2d6c0] min ch=2 bits=16 rate= 48000 max ch=2 bits=16 rate= 48000
ffmpeg -f dshow -list_options true -i audio="麦克风 (Realtek Audio)

Record audio and video with specified parameters

fmpeg -f dshow -i audio="麦克风 (Realtek Audio)" \
-f dshow -i audio="virtual-audio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 \
-f dshow -video_size 1920x1080 -framerate 15 -pixel_format yuv420p -i video="screen-capturerecorder" -vcodec h264_qsv -b:v 3M -y av-out.flv
  • Plus -r 15
ffmpeg -f dshow -i audio="麦克风 (Realtek Audio)" \
-f dshow -i audio="virtual-audio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 \
-f dshow -i video="screen-capture-recorder" -vcodec h264_qsv -b:v 3M -r 15 -y avout2.mp4
  • Add -framerate 15 -pixel_format yuv420p
ffmpeg -f dshow -i audio="麦克风 (Realtek Audio)" \
-f dshow -i audio="virtual-audio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 \
-f dshow -framerate 15 -pixel_format yuv420p -i video="screen-capture-recorder" -vcodec
h264_qsv -b:v 3M -r 15 -y av-out3.mp4

 

Guess you like

Origin blog.csdn.net/baidu_41388533/article/details/112337674