Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't compile without modifying track.cpp #9

Closed
ciscon opened this issue Mar 25, 2014 · 7 comments
Closed

Couldn't compile without modifying track.cpp #9

ciscon opened this issue Mar 25, 2014 · 7 comments

Comments

@ciscon
Copy link

ciscon commented Mar 25, 2014

track.cpp: In member function 'void Track::parse(Atom_, Atom_)':
track.cpp:211:47: error: 'avcodec_open' was not declared in this scope
if(avcodec_open(codec.context, codec.codec)<0)
^

Commented out 211-212

@ponchio
Copy link
Owner

ponchio commented Mar 25, 2014

Probably related to this: #6. I need to update the code (or you to use an older version of libavcodec :P).

@rjp3900
Copy link

rjp3900 commented Jul 21, 2014

This is a problem I'm having. I've never used Linux before yesterday, and I'm getting pretty frustrated. I've spent a good two days just getting to this point. What should I do from here?

@ponchio
Copy link
Owner

ponchio commented Jul 22, 2014

Ciao, sorry for late answer.

Probably the problem is you have a newer version of the avcodec library,
where the avcodec_open was discontinued and replaced with the avcodec_open2
(
https://www.ffmpeg.org/doxygen/trunk/group__lavc__core.html#ga11f785a188d7d9df71621001465b0f1d
)

It should be enough to just add the '2' to the name, but I can't be sure
because I had no time to install and test the new version.

Good luck.

Federico

On Mon, Jul 21, 2014 at 7:43 PM, rjp3900 notifications@github.com wrote:

This is a problem I'm having. I've never used Linux before yesterday, and
I'm getting pretty frustrated. I've spent a good two days just getting to
this point. What should I do from here?


Reply to this email directly or view it on GitHub
#9 (comment).

@gavvvr
Copy link

gavvvr commented Jul 27, 2014

@ponchio

if(avcodec_open2(codec.context, codec.codec, NULL)<0)

There is 3rd argument required in new function. I used NULL and successfully compiled the project. Restored my incomplete file, thanks a lot.

@rjp3900
Copy link

rjp3900 commented Jul 28, 2014

Thanks for your reply.

Made the change, it worked...however, I found a free app on the Google Play
store for android phones called Video Repair by Iwo Banas. Perfect
repair!
On Jul 27, 2014 4:54 PM, "gavvvr" notifications@github.com wrote:

@ponchio https://github.com/ponchio

if(avcodec_open2(codec.context, codec.codec, NULL)<0)

There is 3rd argument required in new function. I used NULL and
successfully compiled the project.


Reply to this email directly or view it on GitHub
#9 (comment).

@dfaligertwood
Copy link

Using @gavvvr's amendment above worked well for me on both xubuntu 14.04 and OS X.

For linux newbies, this can be applied quickly with the following in the command line:

sed -i -e "s/if(avcodec_open(codec.context, codec.codec)<0)/if(avcodec_open2(codec.context, codec.codec, NULL)<0)/g" track.cpp

Should this not be in master?

@snydez
Copy link

snydez commented Nov 7, 2014

Hi,
the code amendment did works,
only the broken video still not fixed, when i played with vlc it did play the sound with black display.

thanks aniway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants