anthwlock / untrunc

Restore a truncated mp4/mov. Improved version of ponchio/untrunc
GNU General Public License v2.0
1.9k stars 182 forks source link

Compile error on ARM running Debian Jessie #22

Closed EQWorry closed 5 years ago

EQWorry commented 5 years ago

Hi, I am trying to compile untrunc on an ARM SBC running Debian Jessie 3.10, but I am getting the following error

root@Lamer:~/Source/untrunc-master# make
untrunc:
ffmpeg: shared

mkdir .build_shared
g++ -MMD -MP -DUNTR_VERSION=\"\" -O3 -std=c++11 -g -o .build_shared/track.o -c track.cpp
g++ -MMD -MP -DUNTR_VERSION=\"\" -O3 -std=c++11 -g -o .build_shared/codec.o -c codec.cpp
codec.cpp: In constructor ‘Codec::Codec(AVCodecParameters*)’:
codec.cpp:25:33: error: invalid use of incomplete type ‘class AVCodecParameters’
  codec_ = avcodec_find_decoder(c->codec_id);
                                 ^
In file included from codec.cpp:1:0:
codec.h:11:7: error: forward declaration of ‘class AVCodecParameters’
 class AVCodecParameters;
       ^

plus a few more. Is this my bad, please? Thank you. :-)

Enteneller2017 commented 5 years ago

Same error as above on Ubuntu 16.04.6 LTS plus the following two: codec.cpp:28:43: error: ‘avcodec_parameters_to_context’ was not declared in this scope avcodec_parameters_to_context(context_, c); ^ codec.cpp: In member function ‘void Codec::parse(Atom*, const std::vector<unsigned int>&, const std::vector<long int>&, Atom*, bool)’: codec.cpp:57:29: error: ‘av_packet_alloc’ was not declared in this scope packet_ = av_packet_alloc(); ^ Makefile:98: recipe for target '.build_shared/codec.o' failed make: *** [.build_shared/codec.o] Error 1

anthwlock commented 5 years ago

I believe ffmpeg 3.1+ is required for AVCodecParameters. Try using make FF_VER=3.3.9 as described here.

EQWorry commented 5 years ago

Great, thank you. I saw that alternative compile section, but the library install was failing (because newer FFMPEG version is installed) and I gave up then. Once I skipped that first step and used make with specified version, all download and compile went quite fine and the app is now available. Thanks again!

anthwlock commented 5 years ago

but the library install was failing (because newer FFMPEG version is installed)

I wonder what library/package you are talking about.. libva-dev liblzma-dev libx11-dev libbz2-dev zlib1g-dev yasm pkg-config wget are supposed to be the requirements to build ffmpeg, they don't depend on ffmpeg. Or do they?

EQWorry commented 5 years ago

This is what I get:

root@Lamer:~# apt-get install libva-dev liblzma-dev libx11-dev libbz2-dev zlib1g-dev yasm pkg-config wget
Reading package lists... Done
Building dependency tree
Reading state information... Done
wget is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libva-dev : Depends: libva-drm1 (= 1.4.1-1) but 1.7.3-2~bpo8+1 is to be installed
             Depends: libva-x11-1 (= 1.4.1-1) but 1.7.3-2~bpo8+1 is to be installed
             Depends: libva1 (= 1.4.1-1) but 1.7.3-2~bpo8+1 is to be installed
E: Unable to correct problems, you have held broken packages.
anthwlock commented 5 years ago

Hmm.. have you tried apt-get -t jessie-backports install libva-dev? You surely must have considered upgrading to stretch, did you?

EQWorry commented 5 years ago
root@Lamer:~# apt-get -t jessie-backports install libva-dev
Reading package lists... Done
E: The value 'jessie-backports' is invalid for APT::Default-Release as such a release is not available in the sources

It is a legacy testing system, while trying to run Stretch I stumble upon various problems, e.g. FireFox crashing... But thanks for the suggestion. :-) And thanks for all the help with this tool as well!

anthwlock commented 5 years ago

Sounds like your system is pretty broken.. consider reinstalling? Anyway, seems like the problem is solved for now.