How to extract audio/video clips using the libvlc API or FFmpeg API?

喜你入骨 提交于 2019-12-14 01:32:52

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6681855/how-to-extract-audio-video-clips-using-the-libvlc-api-or-ffmpeg-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!