如何使用 libvlc API 或 FFmpeg API 提取音频/视频片段?
我支持使用 libvlc 播放音频/视频流的 C++/Qt 应用程序。我的任务是增强应用程序,以允许用户通过设置开始/结束时间并将其间的视频捕获到文件中来提取视频剪辑。
我已经实现了开始/结束标记,并且可以将音频/视频查找到正确的播放时间。我现在的问题是以某种方式将该流捕获到各种格式/压缩的文件中。
我一直在搜索 libvlc 中的 Doxygen 链接以及 FFmpeg 的文档,但我没有看到任何将音频/视频剪辑提取到文件的 API 函数。我还研究了这个示例,但它不进行捕获。还有其他进行捕获的示例吗?
有人可以给我指出 API,或者给我一个如何实现这一目标的示例吗?
编辑:我看到了这个问题的答案 但示例项目是一个死链接。
I am supporting a C++/Qt application that uses libvlc to playback audio/video streams. My task is to enhance the application to allow the users to extract video clips by setting start / end times and capturing the video in between to a file.
I've implemented the start/end markers, and can seek the audio/video to the correct times for playback. My problem now is to somehow capture this stream to a file in a variety of formats / compressions.
I've been searching through the Doxygen links in libvlc, and the documentation for FFmpeg, but I don't see any API functions to extract audio/video clips to a file. I've also studied this example, but it doesn't do capture. Is there another example out there for doing capture?
Can someone point me to the API, or to an example of how to achieve this?
EDIT: I see the answer to this question but the sample project is a dead link.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ffmpeg 支持视频文件的剪辑以及将剪辑转换为所需的格式。通过提供开始时间(使用 -ss 参数)和持续时间(使用 -t 参数),您实际上可以在 'ss 到 t' 秒内剪辑视频。
ffmpeg supports clipping of video file and conversion of clips to desired format. By providing start time (with -ss parameter) and duration (with -t parameter) you can actually clip video within 'ss to t' seconds.