Open themysciraa opened 5 years ago
can you do file /path/to/untrunc
?
I once had this issue because I tried to run a 32bit executable on a 64bit system.
@anthwlock Hi, I've tried your suggestion, typed this into terminal file /path/to/untrunc
but got this error msg
/path/to/untrunc: cannot open '/path/to/untrunc' (No such file or directory)
Maybe replace '/path/to/untrunc' with the path to untrunc?
@anthwlock The folder where I ran the command unzip master.zip
and then cd untrunc-master
, is that the path to untrunc?
You are then in the folder containing the untrunc executable.
You can do pwd
to print the working/current directory.
@anthwlock
This is my untrunc-master folder. I can only see one file named untrunc which is the untrunc.pro
file. Is that the untrunc executable? Or my untrunc executable is missing?
Also at the https://github.com/ponchio/untrunc page, I see the same untrunc.pro but not untrunc.
untrunc.pro is a project file used by qtcreator.
Maybe your compilation failed? If so, try to compile my fork, the compilation is way easier there.
@anthwlock sorry for the late reply.
Mac OS doesn't support apt-get, so I googled for a way around it, the suggestion was to use homebrew. Tried brew install libavformat-dev libavcodec-dev libavutil-dev
but it doesn't work.
I think brew install ffmpeg
should do.
@anthwlock I've actually had ffmpeg installed long ago. Please guide me along step by step to install and compile untrunc using your fork, taking into consideration my Mac OS already has ffmpeg installed.
The only step needed after you have ffmpeg and its public headers is make
.
If it fails please post it's output
@anthwlock sorry please bear with me, I'm really lost. I'm not familiar with command line, if it's a step by step guide, I can follow it to a T.
What's public headers?
and
Do I just type make
and enter? Do I need any prefix or suffix to it?
The public headers are what tells the c/c++ compiler what the ffmpeg library has to offer. You don't need these in order to run applications using ffmpeg, but only in order to build them.
I assume that brew install ffmpeg
also installs these public headers, and that you used brew to install ffmpeg.
Yes, just typing make
should suffice. It won't install anything, it will just create the untrunc executable in the directory where the Makefile is, which should be the current directory.
@anthwlock I think it failed to compile at make, this is the output:
make untrunc: ffmpeg: shared
c++ -MMD -MP -DUNTR_VERSION=\"\" -std=c++11 -g -o .build_shared/src/atom.o -c src/atom.cpp
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:41:12: error: unknown type name 'off64_t'; did you mean 'off_t'?
void seek(off64_t p);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:42:16: error: unknown type name 'off64_t'; did you mean 'off_t'?
void seekSafe(off64_t p);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:43:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t pos();
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:45:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64t length() { return size; }
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:57:24: error: unknown type name 'off64_t'; did you mean 'off_t'?
const uchar* getPtrAt(off64_t pos, int size_requested);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:63:20: error: unknown type name 'off64_t'; did you mean 'off_t'?
size_t fillBuffer(off64_t location);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:65:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64t size;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:67:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t bufbegin = 0;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:68:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t bufoff = 0;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:77:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t pos();
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
src/atom.h:49:9: error: unknown type name 'off64_t'; did you mean 'off_t'?
static off64_t findNextAtomOff(FileRead& file, const Atom start...
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
src/atom.cpp:88:1: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t Atom::findNextAtomOff(FileRead& file, const Atom start_atom, bo...
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:90:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t next_off = startatom->start + startatom->length;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:101:6: error: unknown type name 'off64_t'; did you mean 'off_t'?
for(off64_t off=startatom->start+8; off < file.length();) {
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:117:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t off = findNextAtomOff(file, &atom);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:128:4: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t next_off = off + length;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:395:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t start = output.pos();
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:399:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t offset = filebegin;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:416:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t end = output.pos();
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t offt;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:9:
src/common.h:31:2: warning: expression result unused [-Wunused-value]
creator{ 0, ( std::cout << (std::forward~~~~~~~~~~~~
src/common.h:46:2: note: in instantiation of function template specialization
'logg<char const (&)[10], long long &, char>' requested here
logg(std::forward~~~~~~~~~~~~
src/common.h:46:2: note: in instantiation of function template specialization
'logg<char const (&)[11], long long &, char>' requested here
logg(std::forward~~~~~~~~~~~~
src/common.h:46:2: note: in instantiation of function template specialization
'logg<char const (&)[9], std::~~~~~~~~~~~~
src/common.h:46:2: note: in instantiation of function template specialization
'logg~~~~~~~~~~~~
src/common.h:46:2: note: in instantiation of function template specialization
'logg<char const (&)[23], long long &, char const (&)[2]>' requested here
logg(std::forward~~~~~~~~~~~~~
src/atom.cpp:45:24: note: in instantiation of function template specialization
'ss<char const (&)[13], long long &>' requested here
if (start < 0) throw ss("atom start: ", start); // this is i...
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:9:
src/common.h:53:2: warning: expression result unused [-Wunused-value]
creator{ 0, ( ss << (std::forward~~~~~~~~~~~~~
src/atom.cpp:46:58: note: in instantiation of function template specialization
'ss<char const (&)[21], std::~~~~~~~~~~~~~
src/atom.cpp:83:10: note: in instantiation of function template specialization
'ss<char const (&)[30], std::1::basicstring~~~~~~~~~~~~
src/common.h:46:2: note: in instantiation of function template specialization
'logg<char const (&)[2], std::~~~~~~~~~~~~~
src/atom.cpp:127:12: note: in instantiation of function template specialization
'ss<long long &, char const (&)[3], std::__1::basicstring
Please try this branch.
The problem was that g++ defines _LARGEFILE64_SOURCE,
but clang++ does not.
@anthwlock sorry I got busy suddenly and couldn't try it out earlier. using the branch you recommended, I still have some errors:
make untrunc: ffmpeg: shared
c++ -MMD -MP -DUNTR_VERSION=\"\" -std=c++11 -Doff64_t=off64_t -g -o .build_shared/src/atom.o -c src/atom.cpp
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:41:12: error: unknown type name 'off64_t'; did you mean
'int64_t'?
void seek(off64_t p);
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:42:16: error: unknown type name 'off64_t'; did you mean
'int64_t'?
void seekSafe(off64_t p);
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:43:2: error: unknown type name 'off64_t'; did you mean 'int64_t'?
off64_t pos();
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:45:2: error: unknown type name 'off64_t'; did you mean '__int64_t'?
off64t length() { return size; }
^~~
__int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:57:24: error: unknown type name 'off64_t'; did you mean
'__int64_t'?
const uchar* getPtrAt(off64_t pos, int size_requested);
^~~
__int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:63:20: error: unknown type name 'off64_t'; did you mean
'__int64_t'?
size_t fillBuffer(off64_t location);
^~~
__int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:65:2: error: unknown type name 'off64_t'; did you mean '__int64_t'?
off64t size;
^~~
__int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:67:2: error: unknown type name 'off64_t'; did you mean 'int64_t'?
off64_t bufbegin = 0;
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:68:2: error: unknown type name 'off64_t'; did you mean 'int64_t'?
off64_t bufoff = 0;
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:77:2: error: unknown type name 'off64_t'; did you mean 'int64_t'?
off64_t pos();
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
In file included from src/atom.cpp:2:
src/atom.h:49:9: error: unknown type name 'off64_t'; did you mean 'int64_t'?
static off64_t findNextAtomOff(FileRead& file, const Atom* start...
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
src/atom.cpp:88:1: error: unknown type name 'off64_t'; did you mean
'__int64_t'?
off64_t Atom::findNextAtomOff(FileRead& file, const Atom* start_atom, bo...
^~~
__int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
src/atom.cpp:90:2: error: unknown type name 'off64_t'; did you mean
'__int64_t'?
off64_t next_off = startatom->start + startatom->length;
^~~
__int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
src/atom.cpp:101:6: error: unknown type name 'off64_t'; did you mean
'int64_t'?
for(off64_t off=startatom->start+8; off < file.length();) {
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
src/atom.cpp:117:2: error: unknown type name 'off64_t'; did you mean
'int64_t'?
off64_t off = findNextAtomOff(file, &atom);
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
src/atom.cpp:128:4: error: unknown type name 'off64_t'; did you mean
'__int64_t'?
off64_t next_off = off + length;
^~~
__int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
src/atom.cpp:395:2: error: unknown type name 'off64_t'; did you mean
'int64_t'?
off64_t start = output.pos();
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
src/atom.cpp:399:2: error: unknown type name 'off64_t'; did you mean
'int64_t'?
off64_t offset = filebegin;
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: 'int64_t' declared here
typedef long long __int64_t;
^
src/atom.cpp:416:2: error: unknown type name 'off64_t'; did you mean
'int64_t'?
off64_t end = output.pos();
^~~
int64_t
^
/usr/include/i386/_types.h:46:20: note: '__int64_t' declared here typedef long long __int64_t; ^ 19 errors generated. make: *** [.build_shared/src/atom.o] Error 1
@anthwlock sorry it still doesn't work, it looks like a different set of errors
make untrunc: ffmpeg: shared
c++ -MMD -MP -DUNTR_VERSION=\"\" -std=c++11 -D_LARGEFILE64_SOURCE -g -o .build_shared/src/atom.o -c src/atom.cpp
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:41:12: error: unknown type name 'off64_t'; did you mean 'off_t'?
void seek(off64_t p);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:42:16: error: unknown type name 'off64_t'; did you mean 'off_t'?
void seekSafe(off64_t p);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:43:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t pos();
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:45:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64t length() { return size; }
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:57:24: error: unknown type name 'off64_t'; did you mean 'off_t'?
const uchar* getPtrAt(off64_t pos, int size_requested);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:63:20: error: unknown type name 'off64_t'; did you mean 'off_t'?
size_t fillBuffer(off64_t location);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:65:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64t size;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:67:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t bufbegin = 0;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:68:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t bufoff = 0;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
In file included from src/atom.h:10:
src/file.h:77:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t pos();
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
In file included from src/atom.cpp:2:
src/atom.h:49:9: error: unknown type name 'off64_t'; did you mean 'off_t'?
static off64_t findNextAtomOff(FileRead& file, const Atom start...
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
src/atom.cpp:88:1: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t Atom::findNextAtomOff(FileRead& file, const Atom start_atom, bo...
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:90:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t next_off = startatom->start + startatom->length;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:101:6: error: unknown type name 'off64_t'; did you mean 'off_t'?
for(off64_t off=startatom->start+8; off < file.length();) {
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:117:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t off = findNextAtomOff(file, &atom);
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:128:4: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t next_off = off + length;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:395:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t start = output.pos();
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef darwin_off_t off_t;
^
src/atom.cpp:399:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t offset = filebegin;
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
src/atom.cpp:416:2: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t end = output.pos();
^~~
off_t
/usr/include/sys/_types/_off_t.h:31:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
19 errors generated.
make: *** [.build_shared/src/atom.o] Error 1
Replaced all off64_t
with off_t
and instead used -D_FILE_OFFSET_BITS=64
.
Now it should work!
Yes, it worked now! THANK YOU SO MUCH! You have no idea how you have saved my life. That damaged video meant a lot to me, and now it's finally repaired. Thank you again for your patience to help me with all the technical issues that I have no clue about. You are a saint @anthwlock !
no problem :)
I have compiled untrunc as per README doc guide on Mac OS
but I get this error when I try to use it:
-bash: ./untrunc: No such file or directory
I have tried changing my working directory by cd /Users/Home/untrunc-master but I still get the same error.
When I open up untrunc-master folder to check, I see untrunc.pro file, so I tried using that and got
-bash: ./untrunc.pro: Permission denied
Please help me