anthwlock / untrunc

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

expression result unused [-Wunused-value] #3

Closed upperdecker954 closed 6 years ago

upperdecker954 commented 6 years ago

Hey, I've been working at this for days upon days now trying to get my GoPro footage to come back to life. I've started with ponchio's release, but it was creating a 3kb file and giving me an error: [aac @ 0x7f89b0000a00] channel element 2.3 is not allocated

I stumbled across your fork, as you have the most recently updated version. unfortunately, I'm getting tons of warnings: expression result unused [-Wunused-value]

Theses warnings are showing for common.h.

an example error is:

7 warnings generated.
In file included from sps-info.cpp:1:
In file included from ./sps-info.h:4:
./common.h:19:2: warning: expression result unused [-Wunused-value]
        creator{ 0, ( std::cout << (std::forward<Args>(args)), 0) ... };
        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./common.h:32:2: note: in instantiation of function template specialization 'logg<char const (&)[18]>'
      requested here
        logg(std::forward<Args>(x)...);
        ^
sps-info.cpp:25:2: note: in instantiation of function template specialization 'logg<char const (&)[18]>'
      requested here
        logg(V, "decoding SPS ...\n");
        ^
In file included from sps-info.cpp:1:
In file included from ./sps-info.h:4:
./common.h:19:2: warning: expression result unused [-Wunused-value]
        creator{ 0, ( std::cout << (std::forward<Args>(args)), 0) ... };
        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./common.h:32:2: note: in instantiation of function template specialization 'logg<char const (&)[21], int &,
      char>' requested here
        logg(std::forward<Args>(x)...);
        ^
sps-info.cpp:32:2: note: in instantiation of function template specialization 'logg<char const (&)[21], int
      &, char>' requested here
        logg(V, "log2_max_frame_num: ", log2_max_frame_num, '\n');

Also, I had to tweak the command line when I compile everything:

g++ -o untrunc -O3 -I./libav-12.3 *.cpp -L./libav-12.3/libavformat -lavformat -L./libav-12.3/libavcodec -lavcodec -L./libav-12.3/libavresample -lavresample -L./libav-12.3/libavutil -lavutil -lpthread -lz -framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration -std=c++11 -lbz2

any help would be great

upperdecker954 commented 6 years ago

I should probably also add, that I tried to ignore the warnings...but it actually did less than poncho's release:

./untrunc -i good.MP4 bad.mp4
Info: reading good.MP4
Info: parsing healthy moov atom ... 
Info: avcC got decoded
No codec found!
anthwlock commented 6 years ago

Hi, compile with this: g++ -o untrunc -O3 *.cpp -lavformat -lavcodec -lavutil. No internal libav source is needed. If you upload an example I will take a look. These warnings shouldn't be much of a problem.

anthwlock commented 6 years ago

closing this because of inactivity.