<p>A videofilter in ffmpeg always has to modify pixel information hence the reason why you need to re-encode.
It seems logical at first that you wouldn't have to do this when cropping but the way lossy video codecs work makes this pretty impossible without re-encoding everything.
They usually don't see an array of pixel information but a much more complex representation of pixel blobs that are described in a way that takes up less space than the original pixel blob, you can't really "crop" that encoding, to do a crop you would first need to decode the information to know what you are dealing with but then you need to re-encode to have it compressed again. Thats the main stepping stone.
Then they also use things like motion estimation that depends on information before and after certain frames, if that information changes all of the sudden the whole thing is screwed up and you end up with tons of artifacts when decoding the video during playback.</p>

<p><strong>tldr;</strong> no its not possible to crop without re-encoding in any tool.</p>

<p>Unless you deal with some very specific lossless non-consumer intermediate codecs that would enable it but in that case transcoding wouldn't be an issue.</p>

CC BY-SA 3.0
2014-10-05T22:26:05.730Z
Interesting bit of trivia: the way QuickTime movies work (`.mov`, at least pre-QuickTime X) actually did let you define and store crop, resize, minor edits, and even masks as metadata alongside the video stream; the player would just apply them on the fly.
NReilingh
CC BY-SA 3.0
2014-10-06T12:12:23.797Z
Interesting feature but sounds like a feature that probably has caused a lot confusions when a small resolution video is taking up huge amount of space because it was heavily cropped and you don't know why.
timonsku
CC BY-SA 3.0
2014-10-06T14:21:33.747Z
The only thing I would add is that some formats might support splitting along group of pixel boundaries, but this would only work in very specific formats using particular settings, so there is a slight caveat, but effectively, it isn't possible in most cases and isn't worth doing in most of the situations where it might even be technically possible.
AJ Henderson
CC BY-SA 3.0
2014-10-06T14:28:14.240Z
True that might be a workaround but probably very hard to actually implement practiacally.
timonsku
CC BY-SA 4.0
2022-12-02T21:45:03.967Z
Unless maybe you're using some kind of really raw pixel format?
rogerdpack
CC BY-SA 3.0
2014-10-05T10:52:58.350Z
2014-10-05T10:52:58.350Z
timonsku
<p>I have videos I want to split across multiple screens, so the solution I've found so far is to just crop the input video 4 times with ffmpeg (is this optimal? Is there some other way so I only need to use one command?)</p>

<p>Anyways, in ffmpeg crop is a video filter, and it seems that I can't specify the video codec as copy when using a video filter. Why is this the case? It seems like nothing should change if I just remove some of the video. I should be perfectly capable of just copying the same video over, with just part of it removed.</p>

<p>Is there any way for me to do a crop in ffmpeg without having to do a re-encode? The extra encoding time makes my processing times really long and the new bitrates caused by the re-encode makes the video parts out of sync and unable to be played properly.</p>

<p>Thanks</p>

CC BY-SA 4.0
2023-04-19T20:54:00.650Z
Old question, but depending on your exact situation, there are some possibilities for lossless cropping described here: https://stackoverflow.com/a/33422359/931860
Dominic P
<video><ffmpeg>
Crop video in ffmpeg without re-encoding
xhassassin
# Crop video in ffmpeg without re-encoding

(Asked by: username_0 on 2014-10-05)

I have videos I want to split across multiple screens, so the solution I've found so far is to just crop the input video 4 times with ffmpeg (is this optimal? Is there some other way so I only need to use one command?)

Anyways, in ffmpeg crop is a video filter, and it seems that I can't specify the video codec as copy when using a video filter. Why is this the case? It seems like nothing should change if I just remove some of the video. I should be perfectly capable of just copying the same video over, with just part of it removed.

Is there any way for me to do a crop in ffmpeg without having to do a re-encode? The extra encoding time makes my processing times really long and the new bitrates caused by the re-encode makes the video parts out of sync and unable to be played properly.

Thanks

**Tags:** video, ffmpeg

> **Comments:**
> **username_1**: Old question, but depending on your exact situation, there are some possibilities for lossless cropping described here: https://stackoverflow.com/a/33422359/931860  

---

## 1 answers

### Answer by username_2 on 2014-10-05. Score: 16 | Accepted answer

A videofilter in ffmpeg always has to modify pixel information hence the reason why you need to re-encode.
It seems logical at first that you wouldn't have to do this when cropping but the way lossy video codecs work makes this pretty impossible without re-encoding everything.
They usually don't see an array of pixel information but a much more complex representation of pixel blobs that are described in a way that takes up less space than the original pixel blob, you can't really "crop" that encoding, to do a crop you would first need to decode the information to know what you are dealing with but then you need to re-encode to have it compressed again. Thats the main stepping stone.
Then they also use things like motion estimation that depends on information before and after certain frames, if that information changes all of the sudden the whole thing is screwed up and you end up with tons of artifacts when decoding the video during playback.

**tldr;** no its not possible to crop without re-encoding in any tool.

Unless you deal with some very specific lossless non-consumer intermediate codecs that would enable it but in that case transcoding wouldn't be an issue.

> **Comments:**
> **username_3**: Interesting bit of trivia: the way QuickTime movies work (`.mov`, at least pre-QuickTime X) actually did let you define and store crop, resize, minor edits, and even masks as metadata alongside the video stream; the player would just apply them on the fly.  
> **username_2**: Interesting feature but sounds like a feature that probably has caused a lot confusions when a small resolution video is taking up huge amount of space because it was heavily cropped and you don't know why.  
> **username_4**: The only thing I would add is that some formats might support splitting along group of pixel boundaries, but this would only work in very specific formats using particular settings, so there is a slight caveat, but effectively, it isn't possible in most cases and isn't worth doing in most of the situations where it might even be technically possible.  
> **username_2**: True that might be a workaround but probably very hard to actually implement practiacally.  
> **username_5**: Unless maybe you're using some kind of really raw pixel format?  

---

