0

I want to delete audio stream from video and get the only video stream. But, when I search on google could not find any tutorial except decoding. Is there a way to delete a specific stream from video.

1 Answers1

0

You cannot directly delete a stream from a file. You can, however, write a new file that contains all but one (or more) streams of the original file, which can be done without decoding and encoding the streams.

For this purpose, you can use libavformat, which is part of ffmpeg. You first have to demux the video file, which gives you packages that contain the encoded data for each stream inside the container. Then, you write (mux) these packages into a new video container. Take a look at the remuxing example for details.

Note, however, you can get the same result, by calling the ffmpeg program and passing it the apropriate parameters, which is probably easier [SO1].

H. Rittich
  • 814
  • 7
  • 15