FFmpeg/X264: Split video mid-GOP without reencoding entire stream

2

I've got an H264 video (Stored in an MP4 file). Each GOP is approx 10s long. I want to trim the first couple of seconds off the video, which means I need to split the first GOP. Is there a way to do this without re-encoding the entire video?

I've got FFmpeg and x264 available. I'm happy to use either the FFmpeg command line, or my own program linked against ffmpeg of x264 libraries.

Alex

Posted 2011-09-25T10:38:41.523

Reputation: 21

Does the video contain B pictures? – slhck – 2011-09-25T11:36:25.767

1

appears this question received an answer here, as well: http://stackoverflow.com/questions/7545002/ffmpeg-x264-split-video-mid-gop-without-reencoding-entire-stream

– rogerdpack – 2012-07-10T17:01:04.240

Answers

1

FFVhuff is lossless codec

ffmpeg -i input.mkv -c:v ffvhuff FFVhuff.mkv

ffmpeg -ss 26.818 -i FFVhuff.mkv trim.mkv

http://svnpenn.blogspot.com/2011/10/ffmpeg-cut-to-frame-same-audio.html

Steven Penny

Posted 2011-09-25T10:38:41.523

Reputation: 7 294