3

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.

Community
  • 1
  • 1
retrodrone
  • 5,850
  • 9
  • 39
  • 65

1 Answers1

4

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.

Muhammad Razib
  • 1,297
  • 9
  • 13
  • 1
    Yeah, but you're talking about the command line executable, right? I'd like to know how to call it through code (without forking.) Thanks, though. – retrodrone Jul 21 '11 at 21:23
  • @retrodrone .. Not very hard to do that from code :) ffmpeg provides an example program ffmpeg.c ... You can use this to do this work from program. All command line examples can be set using this example from code before calling transcode/av_encode method. – Muhammad Razib Jul 22 '11 at 06:49
  • Thanks, @mahmudul. Where do I find ffmpeg.c? Is it in the regular source code tree? – retrodrone Jul 22 '11 at 13:11
  • @retrodone : Yeap...you will find it in regular source code tree.. After downloading and unzipping ffmpeg have a look at the ffmpeg folder. Here you will find ffmpeg.c... :) – Muhammad Razib Jul 22 '11 at 20:29