简体   繁体   English

我在程序中使用ffmpeg库录制视频和音频

[英]I am using ffmpeg library in my program to record video and audio

I want to record video coming from a camcorder to a wmv file. 我想将视频从摄录机录制到WMV文件。 I am using ffmpeg libraries and I have it saving the video as an "avi" file. 我正在使用ffmpeg库,并将其保存为“ avi”文件。 However the requirements of the project is to output a wmv file. 但是,该项目的要求是输出wmv文件。 Can anyone help me discover how to set up the video and audio codecs? 谁能帮助我发现如何设置视频和音频编解码器?

You can configure for video codec as MPEG4 and audio codec as Windows media audio 2 to get the .wmv file format. 您可以将视频编解码器配置为MPEG4,将音频编解码器配置为Windows Media Audio 2,以获取.wmv文件格式。

 ffmpeg -i input.mp4 -b:v 2M -vcodec msmpeg4 -acodec wmav2 output.wmv

When you use ffmpeg to generate WMV format the output video quality may be slightly less than other format. 当您使用ffmpeg生成WMV格式时,输出视频质量可能会比其他格式稍差。 So it is better to set the qscale value to get better quality video. 因此最好设置qscale值以获得更好质量的视频。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用AutoGen FFmpeg库在MP4中同步音频/视频 - Sync Audio/Video in MP4 using AutoGen FFmpeg library 如何在Linux上使用带有ffmpeg的C ++从USB音频设备录制音频? - How can I record an audio from USB audio device using C++ with ffmpeg on Linux? 录制opengl视频而无需单独的程序或库 - record opengl video without separate program or library 使用 FFMPEG API 将音频数据录制到现有媒体文件 - Record audio data to an existing media file using FFMPEG API 如何在 C++ 中使用 ffmpeg 提取音频形式的视频? - How to extract audio form video using ffmpeg in C++? 如何使用 libvlc API 或 FFmpeg API 提取音频/视频剪辑? - How to extract audio/video clips using the libvlc API or FFmpeg API? 如何使用FFmpeg库获取以.264为前缀的编解码器视频文件的持续时间? - How do I get the duration of the codec video file that prefix .264 using the FFmpeg library? 当我在 C 程序中链接我的 static 库时,为什么会出现“未定义符号”? - Why am I getting “undefined symbol” when I link my static library in my C program? 我使用模数错误吗? 我的程序将始终输入if语句 - Am I using modulus wrong? My program will always enter the if statement 使用FFmpeg的音频均衡器 - Audio equalizer using FFmpeg
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM