[FFmpeg-user] FFmpeg XDCAMHD422 streamcopy ClosedGOP problem

Christoph Gerstbauer christophgerstbauer at gmail.com
Wed Jun 22 11:50:13 CEST 2016


I want to extract a short clip from a long XDCAMHD422 MXF file via 
streamcopy ("lossless").

FFMpeg does this by grabbing the next good I-Frame near the -ss position 
in this GOP=12 videostream.
But the problem is:

XDCAMHD422 MPEG2-LongGOP Files always begin with one CLOSED GOP, after 
that there are OPEN GOPS.
So the extracted clip (which I want to extract as lossless as possible 
via streamcopy) must lead into a new MXF file which starts with one 
CLOSED GOP and keep the rest of the original open GOPs.
Because, if the new MXF file starts with an OPEN GOP, then typical 
editing programs and also players cannot show frame 1 and 2 when 
playing/editing them. Because -> The I frame references to the previous 
2 B-Frames (typical for open GOP) which are not present anymore in the 
new file.

FFMpeg extracts just OPEN GOPs as is.... yeah that IS streamcopy.

So my need is to force FFMpeg to make an extraction via codec copy (copy 
video and audiostreams) , BUT JUST ENCODE the first GOP to a new CLOSED GOP.
So the first gop of the extracted clip will be renencoded.
Professional XDCAMHD cutting applications are working like that.
The always encoded the first GOP new, and keep the rest of the stream to 
keep original quality.

So, is there a possibility to do that with FFMpeg?

Best Regards


More information about the ffmpeg-user mailing list