Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop video option #38

Closed
kashyap1113 opened this issue Aug 10, 2017 · 7 comments
Closed

Crop video option #38

kashyap1113 opened this issue Aug 10, 2017 · 7 comments

Comments

@kashyap1113
Copy link

First I want to thank you for creating this awesome tool.
It would be nice, to have option to crop video.

@mifi
Copy link
Owner

mifi commented Aug 14, 2017

Hi. I'm not sure how this would be possible to do with ffmpeg or even losslessly at all. Doing it in a lossy way would be outside the scope of this tool, I think.

@kashyap1113
Copy link
Author

I think you are right. Cropping will need re-encoding, which is against the philosophy of this tool.

@tazztone
Copy link

tazztone commented Mar 5, 2023

avidemux can do lossless cutting and also re-encode with cropping

@mifi
Copy link
Owner

mifi commented Mar 6, 2023

see #372

@ThreeDeeJay
Copy link

ThreeDeeJay commented Dec 20, 2023

Hi. I'm not sure how this would be possible to do with ffmpeg or even losslessly at all. Doing it in a lossy way would be outside the scope of this tool, I think.

I think you are right. Cropping will need re-encoding, which is against the philosophy of this tool.

@mifi @kashyap1113 ffmpeg can crop losslessly using a bitstream flag (at least for h264) like this:
ffmpeg.exe -i "input.mp4" -c copy -bsf:v h264_metadata=crop_left=1920 "output.mkv"
This would convert a 3D Side by Side video (3840x1080) to 2D (single view that's 1920x1080)
But very important to note (and would probably warrant a warning to the user): it won't actually delete the unused area from the file.
It will just hide it so the size will remain basically the same as if both views were still visible, but I think all the flag does is to tell the player to crop the video on-the-fly. Useful to crop stuff for YouTube, which should delete the unused stuff (though I think YT keeps a copy of the original, but only used internally for re-encodes) so it's not a good idea to crop out sensitive data since the crop is reversible IIRC.
image
image

@mifi
Copy link
Owner

mifi commented Dec 21, 2023

@ThreeDeeJay thanks for your input. See #643

@ThreeDeeJay
Copy link

Woweee guess you guys are already way ahead of me lol 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants