I'm working on a project that needs to open .mp4
file format, read its frames 1 by 1, decode them and encode them with better type of lossless compression, and save them into a file.
From my understanding, it should go like this:
So far, I encountered a couple of problems. For example, if I want to save a frame using av_interleaved_write_frame()
function. I can't open input a .mp4
file using avformat_open_input()
since it's going to populate filename
part of the AVFormatContext
structure with the input file name, and therefore, I can't "write" into that file.
I've tried a different solution using av_guess_format()
, but when I dump format using dump_format()
, I get nothing, So I can't find stream information about which codec it is using.
How should this be done?
See the "detailed description" in the muxing docs. You: