I am working on MPEG 2 Transcoding project and I need to cut a video at the boundary of GOP.
I've gone through some Documents and was able to cut the video at the start of next GOP (by checking the I-frame (or) GOP Start code 0x00 0x00 0x01 0xB8
), but I need to cut the video at same GOP Boundary.
Is there any ways to do this ?
Usually most of the video editing software cuts at next GOP.
Because if you cut video withing any GOP then there may be posible that next video decoder will not be able to play some starting video freames if there were not i frame. Such P frame and B frame will not be decoded.
So better idea is to cut video stream at any GOP. Or if you want withing GOP then find out next i frame in GOP and cut from there...