untrunc icon indicating copy to clipboard operation
untrunc copied to clipboard

Compile Error in Linux Mint 19

Open MontyJ opened this issue 7 years ago • 2 comments

Hola!

I think I have all the right libraries, but I get this error when compiling:

`track.cpp: In member function ‘int Codec::getLength(unsigned char*, int)’:
track.cpp:204:20: error: ‘avcodec_alloc_frame’ was not declared in this scope
   AVFrame *frame = avcodec_alloc_frame();
                    ^~~~~~~~~~~~~~~~~~~
track.cpp:204:20: note: suggested alternative: ‘avcodec_send_frame’
   AVFrame *frame = avcodec_alloc_frame();
                    ^~~~~~~~~~~~~~~~~~~

So I went into the track.cpp file and changed "avcodec_alloc_frame()" to "avcodec_send_frame()" and tried to compile again, with these results:

track.cpp: In member function ‘int Codec::getLength(unsigned char*, int)’:
track.cpp:204:39: error: too few arguments to function ‘int avcodec_send_frame(AVCodecContext*, const AVFrame*)’
   AVFrame *frame = avcodec_send_frame();
                                       ^

In this 2nd error, the right-hand parenthesis only is in red, as if it is the error? Or is some value required for this statement?

Thanks for any help...this seems to the only solution anywhere for fixing missing moov atoms by having another complete file available!

Monty

MontyJ avatar Jul 22 '18 21:07 MontyJ

Your .cpp files seem to be different from master. Because AVFrame *frame = avcodec_alloc_frame is commented out in master. If you want to add functionality consider starting from this branch.

anthwlock avatar Jul 23 '18 14:07 anthwlock

anthon,

Thank you! That got me through the compile w/o any problems! However, the resulting 'fix' file is less that 500kb out of an original 109Mb, shows like the first frame or so? I will post on your thread with details.

FYI, the ‘avcodec_alloc_frame’ statement was listed twice in the original code. The first one, near the top, was not commented out. The second one, near the bottom, was indeed commented out. And the first one was causing the error, so made the change there.

Thanks!

Monty

MontyJ avatar Jul 23 '18 15:07 MontyJ