Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone have an idea of how I can put an image mask over the video without changing the audio & video codec?

I'm making different media files for testing purposes and I want control over my audio and video codecs used in a A/V container, now I need to put an image mask over a A/V file, without changing the audio and video codec.

When using ffmpeg -i video.avi -i image.png -filter_complex 'overlay' avi.mkv I can add -acodec copy but not -vcodec copy, this gives the error:

Streamcopy requested for output streaam 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together.

And when just using the above command FFmpeg encodes my streams to another format (MPEG-4 & MP3)

share|improve this question

You answered your own question: filters are incompatible with copy. You're using a video filter there, so you can't use -vcodec copy or -c:v copy; if you were using an audio filter, you would be unable to to use -acodec copy or -c:a copy.

copy, as its name suggests, copies the stream specified exactly, with no changes. Filters alter the stream(s) they target. By definition, copy and filters are incompatible.

If you simply want to choose a specific video codec, then that's simple enough: use -c:v [codecname]; you can see a list of all the codecs your ffmpeg supports with

ffmpeg -codecs
share|improve this answer
However, this seems like bad architecture. E.g. what if I want to do a "setpts=2*PTS" filter to slow down the video. That should be able to run with only demuxing and muxing and should not require transcoding! (Because it's not accessing the pixel data, just the frame metadatas). – AlcubierreDrive Jun 16 '13 at 0:25
@EvolvedAI That's a good point, and ffmpeg has support for bit stream filters that can be used with stream copying. I suspect this is just a case of nobody has got around to writing a bit stream filter that does this, because it's a fairly niche use of ffmpeg, and outside of the tool's main purpose. Maybe you should raise this on the ffmpeg-users mailing list, and/or file a request on their bug tracker. – evilsoup Jun 16 '13 at 9:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .