Z
Z
Zhmak2017-11-04 02:37:27
H.264
Zhmak, 2017-11-04 02:37:27

How to extract I-frame from h264 stream?

During the trip, I leaked video from the registrar. Those. at the input we have a cloud of mov files in h264 format with a fixed bitrate.
Task: get a carlapse video (carlapse) at the output. To do this, you need to speed it up n times.
Since the video stream consists of a sequence of GOPs, why not leave only I frames? I mean that the streaming encoding mode of the registrar has a fixed GOP pattern. By removing intermediate frames, we get free video acceleration without transcoding. Subjectively, the quality of the picture should even increase, since there will be no P frames.
Question: how to extract I frames and display them in a separate video stream?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zhmak, 2017-11-07
@Zhmak

Stupid solution, but working:
1. Glue the files together.
To do this, we prepare a list of files in txt of the form:

file 'D:\video\dvr\20171101_01.mov'
file 'D:\video\dvr\20171101_02.mov'
file 'D:\video\dvr\20171101_03.mov'

file is used as input file parameter:
ffmpeg.exe -f concat -safe 0 -i "D:\video\dvr\files.txt" -c copy
"D:\video\movie.mov"

2. Split iframes, remove sound:
3. Rebuild without timeline:
It was not possible to collect the options together, because in some cases, the options are ignored.
It was nice to do everything through pipes, but I could not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question