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

Compilation error (ubuntu 13.04 x64) #1

Closed
PhMetzger opened this issue Jul 19, 2013 · 8 comments
Closed

Compilation error (ubuntu 13.04 x64) #1

PhMetzger opened this issue Jul 19, 2013 · 8 comments
Assignees

Comments

@PhMetzger
Copy link

Thank for the amazing work.

Just try to compile the master version and got the following error : track.cpp:108:78: erreur: ‘avcodec_decode_audio4’ was not declared in this scope

I don't see any reason but maybe you can help ?

Thanks a lot again.

@ponchio
Copy link
Owner

ponchio commented Jul 21, 2013

Ciao,
the reason is simple enough: the avcodec libraries you are using
are a bit outdated, and the guys writing those libraries are changing the
API at every version.... I do not have enough time to keep the code
compatible with multiple versions.

Just install the latest one (even locally in a subdirectory) and be sure to
specify INCLUDE and LIBS directory in the compilation command, the
instructions at
https://github.com/ponchio/untrunc#manual-libav-installation should
work.

Good luck,

Federico

On Fri, Jul 19, 2013 at 6:46 PM, PhMetzger notifications@github.com wrote:

Thank for the amazing work.

Just try to compile the master version and got the following error :
track.cpp:108:78: erreur: ‘avcodec_decode_audio4’ was not declared in this
scope

I don't see any reason but maybe you can help ?

Thanks a lot again.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1
.

@PhMetzger
Copy link
Author

Hi Federico,

Thanks a lot for your help, you are absolutely right ! Compilation is
now good, but I have a new problem. I deal with 4 Gb clips issued by an
EOS 5D Mk II. The atoom part is missing at the end of one of those clips.

The untrunc code is working perfectly with smaller clips (I made some
tests) but with those 4 Gb clips it failed with

terminate called after throwing an instance of 'std::bad_alloc'
   what():  std::bad_alloc
Abandon (core dumped)

I was expecting that a 64 bits version could allocate enough memory
(working on a 16 Gb box) but it seems it's not so simple.

I will try to split the damaged clip in smaller parts tomorrow, but i'm
not sure it can work like that. Maybe you have an idea ?

Thanks again for your help

Philippe

Le 21/07/2013 16:57, Federico Ponchio a écrit :

Ciao,
the reason is simple enough: the avcodec libraries you are using
are a bit outdated, and the guys writing those libraries are changing the
API at every version.... I do not have enough time to keep the code
compatible with multiple versions.

Just install the latest one (even locally in a subdirectory) and be
sure to
specify INCLUDE and LIBS directory in the compilation command, the
instructions at
https://github.com/ponchio/untrunc#manual-libav-installation should
work.

Good luck,

Federico

On Fri, Jul 19, 2013 at 6:46 PM, PhMetzger notifications@github.com
wrote:

Thank for the amazing work.

Just try to compile the master version and got the following error :
track.cpp:108:78: erreur: ‘avcodec_decode_audio4’ was not declared
in this
scope

I don't see any reason but maybe you can help ?

Thanks a lot again.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/1
.


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

@ponchio
Copy link
Owner

ponchio commented Jul 22, 2013

I'm working on an out-of-core version, I will commit it shortly, I just need to test it a bit.

Splitting the damage clip will do you no good, unless you split it at the boundary of a packet and insert the appropriate mdat at the beginning.

@fryfrog
Copy link

fryfrog commented Nov 25, 2013

I'm trying to recover some fairly large corrupt GoPro files and I'm seeing the same 'std::bad_alloc' error as PhMetzger. No compilation issues, except maybe a couple of warnings.

Reading: rear-sample.MP4
Composition time offset atom found. Out of order samples possible.
Sample dependency flag atom found. I and P frames might need to recover that info.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rear-sample.MP4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 2013-11-24 22:29:29
  Duration: 00:00:07.52, start: 0.000000, bitrate: 27908 kb/s
    Stream #0.0(eng): Video: h264 (Main), yuvj420p, 1920x1080 [PAR 1:1 DAR 16:9], 25263 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc
    Metadata:
      creation_time   : 2013-11-24 22:29:29
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 127 kb/s
    Metadata:
      creation_time   : 2013-11-24 22:29:29
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

The compilation errors, if you care

fryfrog@apollo:~/untrunc$ g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/usr/local/lib -lavformat -lavcodec -lavutil                          
track.cpp: In member function ‘void Track::parse(Atom*, Atom*)’:                                                                                              
track.cpp:211:8: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]                                                                                                                                                      
     if(avcodec_open(codec.context, codec.codec)<0)                                                                                                           
        ^                                                                                                                                                     
track.cpp:211:47: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]                                                                                                                                                     
     if(avcodec_open(codec.context, codec.codec)<0)                                                                                                           
                                               ^

@vizerei
Copy link

vizerei commented Nov 9, 2014

+1'ing this. I recently got this up and running and I get the

Reading: /nas/Javaw 2014-11-05 22-46-15-065(fixed Audio)-2.m4v
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted

@padraigd
Copy link

Thank you for writing and offering this software. I had problems and I thought I'd share if you have time / energy.
Ubuntu 14.04
I ran the program with two working files and the truncated one. Received this:
padraigd@pjd:~/Documents/untrunc/untrunc_git$ ./untrunc HDV_0107.MP4 HDV_0110.MP4 HDV_0114.MP4
Reading: HDV_0107.MP4
Composition time offset atom found. Out of order samples possible.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HDV_0107.MP4':
Metadata:
major_brand : MSNV
minor_version : 19464262
compatible_brands: MSNVmp42isom
creation_time : 2014-07-31 17:58:58
Duration: 00:01:25.95, start: 0.000000, bitrate: 8426 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 8292 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
Metadata:
creation_time : 2014-07-31 17:58:58
handler_name : Video Media Handler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s
Metadata:
creation_time : 2014-07-31 17:58:58
handler_name : Sound Media Handler

Begin: 2 9100000avc1: no match beacuse of nal type: 9

Compilation errors:
padraigd@pjd:~/Documents/untrunc/untrunc_git$ g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/usr/local/lib -lavformat -lavcodec -lavutiltrack.cpp: In member function ‘void Track::parse(Atom_, Atom_)’:
track.cpp:244:8: warning: ‘int avcodec_open(AVCodecContext_, AVCodec_)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3711) [-Wdeprecated-declarations]
if(avcodec_open(codec.context, codec.codec)<0)
^
track.cpp:244:47: warning: ‘int avcodec_open(AVCodecContext_, AVCodec_)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3711) [-Wdeprecated-declarations]
if(avcodec_open(codec.context, codec.codec)<0)

@sputnick-dev
Copy link

Same thing for me, untrunc compiled with libav-0.8.7 on archlinux x86_64 :

./untrunc /tmp/GOPR0195.MP4 /tmp/GOPR0200.MP4 
Reading: /tmp/GOPR0195.MP4
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Abandon (core dumped)

I have 8GB RAM and the file is 2GB

@sebix
Copy link
Contributor

sebix commented Jan 13, 2018

Ubuntu 13.04 is EOL

dmelo added a commit to dmelo/untrunc that referenced this issue Nov 22, 2022
Without linking, the following error happens:

```
/usr/bin/ld: ./libav/libavformat/libavformat.a(matroskadec.o): in function `matroska_decode_buffer':
/home/dmelo/proj3/untrunc/libav/libavformat/matroskadec.c:1163: undefined reference to `BZ2_bzDecompressInit'
/usr/bin/ld: /home/dmelo/proj3/untrunc/libav/libavformat/matroskadec.c:1177: undefined reference to `BZ2_bzDecompress'
/usr/bin/ld: /home/dmelo/proj3/untrunc/libav/libavformat/matroskadec.c:1171: undefined reference to `BZ2_bzDecompressEnd'
/usr/bin/ld: /home/dmelo/proj3/untrunc/libav/libavformat/matroskadec.c:1180: undefined reference to `BZ2_bzDecompressEnd'
```

Running on Fedora 35:

```
❯ uname -a
Linux solomon 5.19.16-100.fc35.x86_64 ponchio#1 SMP PREEMPT_DYNAMIC Sun Oct 16 21:50:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
```
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

8 participants