How to process single segment from fragmented mp4 container?

719 Views Asked by At

I have fragmented mp4 that I stream. First the mp4 header and then individual segments that are each one GOP. It is h264 and aac encoded video that I am getting from RTMP server.

I would like to process these individual segments with ffmpeg(I doubt there are other tools available). Either adjust resolution or bitrate or even transcode to vp8/9 or avi1 if needed.

But it seems that ffmpeg cannot handle this because the segment has no header. So I wodner if there is a flag or set of flags for ffmpeg to be able to process these segments without the header? I could possibly just take the raw h264 and aac packets from the RTMP and not pack it into MP4 container beforehand, if that helps - would ffmpeg be able to process these?

1

There are 1 best solutions below

4
On

“So I wodner if there is a flag or set of flags for ffmpeg to be able to process these segments without the header? ‘

No. If it was possible, ffmpeg would just do it without they magic flag. The header contains information required for decoding.

You can pretend the header onto an individual segment.