VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. So I'm about to crop yet another video with black bars, wishing I could do so without an encode, and I got to thinking about how things work the way they do and just why it's impossible to crop without encoding, and theoretically, I think you COULD crop without encoding under the right circumstances. The video would have to be encoded with a brand new experimental video codec, it's the only way. Nothing like this exists as far as I know, and I'm not sure I have the skill or the time to build something like that, but it should be possible, in theory. Here are my thoughts. The only reason we can't crop without decoding frames is because we encode each frame as a single image. But what if we encoded each frame as multiple images, joining them during playback? Would something like that even be possible? Ofc, we could only cut at the predefined cut points, but that could be useful nonetheless.
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Not all frames are single images,most are partial and having more images would increase the size too much.
    I think,therefore i am a hamster.
    Quote Quote  
  3. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    This is not the only way to do this, and there already is a solution (but one which may not work for you). Mkv, h264, possibly others have a parameter called "cropping rectangle" or "cropping offset". It is applied during playback.
    However, only some apps will honor this metadata. When it doesn't, you get the full image (with bars).

    This was one feature used with non-mvc stereoscopic files in hopes to maintain 2D compatibility (e.g. full sbs is 3840x1080, crop rectangle only shows left 1920x1080), but it also required standard players to honor the crop.


    Scott
    Quote Quote  
  4. As Cornucopia points out...

    Many codecs work with mod 16 (or 32) frame sizes internally. For example, an h.264 video with 1920x1080 frame is padded internally to 1920x1088 before encoding, then cropped back to 1920x1080 after decoding. The metadata for exactly how much to crop is stored in the video stream. There are programs that allow you to modify that metadata to change the cropping (without re-encoding). I believe this type of cropping works with all decoders for that codec.

    There there are also cropping flags in some container formats. You can see these in MKVToolnix, for example. Theoretically, those will work with all codecs. But not all players pay attention to these flags.
    Quote Quote  
  5. Or you can do it manually, you'd just crop during playback, whatever allows it, every video must be converted from YUV to RGB for playback to have rgb pixels on screen. That process (yuv to rgb and crop, or vice versa) can be programmed by you, example, using avisynth or vapoursynth script and playing that cropped rgb, whatever player allows it.

    Or just use a player that can set crop, if there is such, I'm sure they'd do it in one uncompressed sequence, so all the same.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!