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

Cannot compile - Linux Mint 18.2 #87

Closed
MethodDan opened this issue Nov 10, 2017 · 13 comments
Closed

Cannot compile - Linux Mint 18.2 #87

MethodDan opened this issue Nov 10, 2017 · 13 comments

Comments

@MethodDan
Copy link

I've read through many threads on compiling issues and can't find a problem the same as mine. I have a feeling it's something stupid. I am on Linux Mint 18.2 which is essentially Ubuntu 16.04 under the hood. I've also tried this on stock install of Ubuntu 16.04 with the same errors.

I follow the instructions to compile Untrunc after installing all the libav stuff with Apt. I get this error

track.cpp:51:32: fatal error: libavcodec/h264dec.h: No such file or directory

I have tried downloading and compiling libav 12.2 which compiles fine as per instructions. Then go back to compile Untrunc using L./libav-12.2/ in the appropriate places. Same error as above. It still can't find libavcodec/h264dec.h. I then tried again following the instructions in issue 78 and used libav 0.8.7 which again compiled fine. When I run this command from the main untrunc-master directory:

g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -I./libav-0.8.7 -L./libav-0.8.7/libavformat -lavformat -L./libav-0.8.7/libavcodec -lavcodec -L./libav-0.8.7/libavutil -lavutil -lpthread

I still get fatal error, cannot find h264dec.h

I looked in the folder where I compiled libav 0.8.7 and indeed there is no file h264dec.h in the libavcodec subfolder. So it's never going to find it.

Am I doing something really stupid here? I'm a pretty experienced Linux user and developer, or so I thought.

Many thanks in advance, sorry for long winded explanation :)

Dan

@ponchio
Copy link
Owner

ponchio commented Nov 13, 2017 via email

@ponchio
Copy link
Owner

ponchio commented Nov 13, 2017 via email

@MethodDan
Copy link
Author

MethodDan commented Nov 13, 2017

Hi Frederico,

Thanks for the reply! I could compile libav 12.2 and 0.8.7 fine on both Linux Mint and Ubuntu. That file untrunc was looking for didn't seem to exist though. Not sure why.

The good news is I fixed it now. I deleted everything and started again compiling libav12.2, this time it seems to have the h264dec.h file as it should and Untrunc compiled. Sorry to waste your time.

I do have another question, I'm trying to repair a file that's around 300mb and my example working file is over 700mb. When I run untrunc with these two it seems to work for a while but then runs out of buffer memory:

Buffer size exceeded
Found 126517 packets
Track duration: 76359680 movie timescale: 1000 track timescale: 44100
Track duration: 26596864 movie timescale: 1000 track timescale: 15360

Can I increase the buffer size somehow in the options?

@MethodDan
Copy link
Author

Sorry, ignore my previous comment, it did work on the 2 files I was trying. It just took ages to write the repaired file to the folder. I need to be more patient.

Thanks for all your work on this project and your responses, I appreciate it!! :-)

@ponchio
Copy link
Owner

ponchio commented Nov 13, 2017 via email

@japrogramer
Copy link

Same error on arch linux

:: Building untrunc-git package(s)...
==> Making package: untrunc-git r46.06ee3da-1 (Thu Nov 23 17:18:08 CST 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
yasm/nasm not found or too old. Use --disable-yasm for a crippled build.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #libav on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
==> ERROR: A failure occurred in build().
    Aborting...
:: failed to build untrunc-git package(s)

@ponchio
Copy link
Owner

ponchio commented Nov 24, 2017

The problem seems to be related to libav-tools needing yasm to be installed... maybe should be added as a dependency...

@Hacklin
Copy link
Contributor

Hacklin commented Jan 26, 2018

You can configure Libav/FFmpeg to use the software resampler instead of the assembler one.
(see #96 )

@michalskop
Copy link

I have the same problem on Ubuntu 16.04

I have installed the libav using sudo apt install libav-tools (I am not sure what version it is)

I followed the Installing on Ubuntu

sudo apt-get install libavformat-dev libavcodec-dev libavutil-dev
wget https://github.com/ponchio/untrunc/archive/master.zip
unzip master.zip
cd untrunc-master
g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/usr/local/lib -lavformat -lavcodec -lavutil

which ended with

track.cpp:60:32: fatal error: libavcodec/h264dec.h: No such file or directory compilation terminated.

(I do not understand half of the things I was doing /libav, g++/, I tried to follow the install guide.)

@Hacklin
Copy link
Contributor

Hacklin commented Mar 4, 2018

The file libavcodec/h264dec.h is an internal header file of Libav and FFmpeg,
which is not in the development packages (*-dev).
You need to install the sources of either Libav or FFmpeg.

Libav is a fork of FFmpeg, and is still similar to FFmpeg.
Untrunc was only tested with Libav, but also works with FFmpeg.
Debian and Ubuntu have switched from Libav [Ubuntu 14.04LTS (Trusty)] back to FFmpeg [Ubuntu 16.04LTS (Xenial)].

I don't use Ubuntu nor Arch, so I only updated the Installing on other operating systems (Manual Libav installation) section in Untrunc's Readme (updated).

The Libav Sources can be downloaded as Release Tarball or directly from the Git Repository or its GitHub Mirror.
For the Libav sources with Debian / Ubuntu changes look at the bottom of the Ubuntu Libav page.

For the FFmpeg sources with Debian / Ubuntu changes look at the bottom of the Ubuntu FFmpeg page.

@Hacklin
Copy link
Contributor

Hacklin commented Mar 4, 2018

You can configure Libav to use the software resampler instead of the assembler one.
Note that for Libav the configure option to do this is --disable-yasm.
For instructions see updated #96

@selecgo
Copy link

selecgo commented Apr 25, 2018

I am using High Sierra Mac. Not sure if this is related but I also have this error when compiling. I am compiling libav 0.8.7 according to the instructions #77.

g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -I./libav-0.8.7 -L./libav-0.8.7/libavformat -lavformat -L./libav-0.8.7/libavcodec -lavcodec -L./libav-0.8.7/libavutil -lavutil -lpthread -lz -framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration -lbz2 -DOSX

track.cpp:52:10: fatal error: 'libavcodec/h264dec.h' file not found
#include <libavcodec/h264dec.h>

Also received endian.h missing error with the compiling code in #77, and tried the compiling code below (#54) after "sed -i.orig -e's:endian.h:machine/endian.h:' *cpp" .

g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -I./libav-12.2 -L./libav-12.2/libavformat -lavformat -L./libav-12.2/libavcodec -lavcodec -L./libav-12.2/libavresample -lavresample -L./libav-12.2/libavutil -lavutil -lpthread -lz -framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration -lbz2

Is it possible to install on High Sierra? Really need the software. Thanks!

@brandon-dacrib
Copy link
Collaborator

You should try the docker build that was recently merged into master

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

7 participants