Drive disaster

No probs, good luck for tomorrow.

Just noticed … SeZo has made exactly 1337 posts to date :slight_smile:

You lost me there. Why is 1337 significant? :-
OK, now it is 1338 :stuck_out_tongue:

Kiddie “hacker” term for “elite”.

I guess you’re now a “leeb” :-/

OK I tried your suggestions , mplayer would play the sound but no video just the same as VLC, running the other commands you posted made no difference

ffmpeg -y -i <oldfile.mp4> -acodec copy -vcodec copy <newfile.mp4>[/code



Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) → 29.97 (30000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘f001.mp4’:
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2013-09-04 22:27:21
title : E3-Backpack
encoder : HandBrake rev0 2013051899
Duration: 00:00:52.19, start: 0.100100, bitrate: 1619 kb/s
Stream #0.0(und): Video: h264, 722x406, 1701 kb/s, 24.93 fps, 29.97 tbr, 90k tbn, 180k tbc
Metadata:
creation_time : 2013-09-04 22:27:21
Stream #0.1(und): Audio: aac, 48000 Hz, stereo, s16, 174 kb/s
Metadata:
creation_time : 2013-09-04 22:27:21
Output #0, mp4, to ‘x001.mp4’:
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2013-09-04 22:27:21
title : E3-Backpack
encoder : Lavf53.21.1
Stream #0.0(und): Video: libx264, 722x406, q=2-31, 1701 kb/s, 90k tbn, 90k tbc
Metadata:
creation_time : 2013-09-04 22:27:21
Stream #0.1(und): Audio: libvo_aacenc, 48000 Hz, stereo, 174 kb/s
Metadata:
creation_time : 2013-09-04 22:27:21
Stream mapping:
Stream #0.0 → #0.0
Stream #0.1 → #0.1
Press ctrl-c to stop encoding
frame= 698 fps= 0 q=-1.0 Lsize= 6710kB time=34.07 bitrate=1613.5kbits/s
video:5574kB audio:1108kB global headers:0kB muxing overhead 0.420404%
graeme@Linux1 ~/fixed $



--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



ffmpeg -y -i <oldfile.mp4> -acodec copy -vcodec libx264 <newfile.mp4>






Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) → 29.97 (30000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘f001.mp4’:
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2013-09-04 22:27:21
title : E3-Backpack
encoder : HandBrake rev0 2013051899
Duration: 00:00:52.19, start: 0.100100, bitrate: 1619 kb/s
Stream #0.0(und): Video: h264, 722x406, 1701 kb/s, 24.93 fps, 29.97 tbr, 90k tbn, 180k tbc
Metadata:
creation_time : 2013-09-04 22:27:21
Stream #0.1(und): Audio: aac, 48000 Hz, stereo, s16, 174 kb/s
Metadata:
creation_time : 2013-09-04 22:27:21
[buffer @ 0x96faf00] Invalid pixel format string ‘-1’
Error opening filters!
graeme@Linux1 ~/fixed

$ 

The good news is that the fixed files will play in avidemux albeit heavily pixilated and sound out of sync 
I tried to upload a sample to videobin which transcodes to ogg vorbis but it too only played the sound

If you think it would be easier I could send you a sample video to let you work on it directly but if you think it would be better to keep doing it this way that's fine :)


Many thanks


Graeme
If you think it would be easier I could send you a sample video to let you work on it directly but if you think it would be better to keep doing it this way that's fine :)

Just drop the sample video somewhere and then pm me the link.

[EDIT]
Looks like we are getting somewhere.
I had to download the earlier version of untrunc from here and used the already compiled untrunc executive from the extracted file.
run it with:

./untrunc ref1.mp4 004.mp4

This produced the video but only the sound was playable.
First tried avidemux:

avidemux --rebuild-index  --force-alt-h264 --load 004.mp4_fixed.mp4 --save "video.avi" --output-format AVI --quit

This produced a good quality playable video (sound is way out of sync)
Then tried ffmpg (sent you the link)

ffmpeg -i 004.mp4_fixed.mp4 -acodec copy -vcodec libx264 -s 722x406 -r 25 004-fixed.mp4

which produced similar result to the previous try (slightly smaller file size) unfortunately the audio is still out of sync.
See if you can reproduce that.

Ok I’ve downloaded the untrunc v1.0 .tar file as per your link to my Downloads folder nut I’m not really sure what you mean by this bit

and used the already compiled untrunc executive from the extracted file.

I managed to identify all the fixed.mp4 files I have by listening to the sound tracks and the videos I’m after ( 2 that I can think of) are not there so I suspect they’re among a load of .mov files (83 in total)

I tried fixing them using this format

./untrunc /home/graeme/movref.mov /home/graeme/Corrupted/mov/mov084.mov

but although it produced fixed files they wouldn’t play audio or video so i have no way to identify them.

I had a look at the Blondie video you worked on and the result is spot on other than the sound sync, the sound is too far advanced by approximately 2.5 secs and although I was able to correct that at the beginning of the video it seemed to run out again as the video progressed but I’m not 100% sure of that, I find adjusting audio sync gets more difficult the closer you get to it being right if that makes any sense.

Anyway thanks so much for your help I really appreciate it :slight_smile:

Graeme

Ok I've downloaded the untrunc v1.0 .tar file as per your link to my Downloads folder nut I'm not really sure what you mean by this bit
Quote
and used the already compiled untrunc executive from the extracted file.</blockquote></blockquote> 

If you look in ~/Downloads/untrunc_1.0/ there should be a file named untrunc which is an executable. I used that on mine.
You should test the corrupt files first with ffmpeg:

ffmpeg -i <filename>

If you get this line: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x9ada840] moov atom not found then run untrunc on it, otherwise you will need to find different method to repair the file.

Ok that’s clear and understood, I’ll try your suggestions tonight when I get home

Many thanks

Graeme

Hi again

I’m working on the .mov files here’s the output of a sample file using ffmpeg

graeme@Linux1 ~ $ cd /home/graeme/Corrupted/mov
graeme@Linux1 ~/Corrupted/mov $ ffmpeg -i mov000.mov
WARNING: gnome-keyring:: couldn't connect to: /run/user/graeme/keyring-0BhfOy/pkcs11: No such file or directory
ffmpeg version 0.8.9-6:0.8.9-0ubuntu0.13.04.1, Copyright (c) 2000-2013 the Libav developers
  built on Nov  9 2013 19:15:52 with gcc 4.7.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9bb5840] moov atom not found
mov000.mov: Invalid data found when processing input
graeme@Linux1 ~/Corrupted/mov $ 

I tried to run untrunc on all the .mov files I have and although it placed fixed files in the folder none of them produced any audio or video

I tried to open the untrunc v1.0 executable and I can’t get it to open, if I click on “Execute” nothing happens and if I click “Execute in Terminal” the terminal flashes up for a second then disappears.

Many thanks

Graeme

I tried to open the untrunc v1.0 executable and I can't get it to open, if I click on "Execute" nothing happens and if I click "Execute in Terminal" the terminal flashes up for a second then disappears.
I just copied the untrunc executable to the folder where the clips reside. Then opened the terminal in that folder and run like this;
./untrunc ref.mp4 corrupt.mp4

I’m obviously doing this wrong I’m sorry :-[

graeme@Linux1 ~ $ cd /home/graeme/Corrupted/mov
graeme@Linux1 ~/Corrupted/mov $ ./untrunc movref.mov mov000.mov
bash: ./untrunc: cannot execute binary file
graeme@Linux1 ~/Corrupted/mov $ sudo ./untrunc movref.mov mov000.mov
[sudo] password for graeme: 
./untrunc: 1: ./untrunc: ELF: not found
./untrunc: 2: ./untrunc: Syntax error: "(" unexpected
graeme@Linux1 ~/Corrupted/mov $ 

Graeme

Did you copy ~/Downloads/untrunc_1.0/untrunc to /home/graeme/Corrupted/mov ?
If not then do it like this:

cp ~/Downloads/untrunc_1.0/untrunc /home/graeme/Corrupted/mov

then cd in (just in case)

cd /home/graeme/Corrupted/mov

then run

./untrunc movref.mov mov000.mov
graeme@Linux1 ~ $ cp ~/Downloads/untrunc_1.0/untrunc /home/graeme/Corrupted/mov
graeme@Linux1 ~ $ cd /home/graeme/Corrupted/mov
graeme@Linux1 ~/Corrupted/mov $ ./untrunc movref.mov mov000.mov
bash: ./untrunc: cannot execute binary file
graeme@Linux1 ~/Corrupted/mov $ 

OK, try to change the executable flag:

sudo chmod +x /home/graeme/Corrupted/mov/untrunc

Sorry SeZo

graeme@Linux1 ~/Corrupted/mov $ sudo chmod +x /home/graeme/Corrupted/mov/untrunc[sudo] password for graeme: 
graeme@Linux1 ~/Corrupted/mov $ ./untrunc movref.mov mov000.movbash: ./untrunc: cannot execute binary file
graeme@Linux1 ~/Corrupted/mov $ 

If it mentions ELF, isn’t that usually an error you see when trying to run a 64bit executable on a 32bit system … or vice-versa ?

#------------------------------------------------- # # Project created by QtCreator 2012-10-28T12:50:54 # #-------------------------------------------------

QT -= core
QT -= gui

TARGET = untrunc
CONFIG += console
CONFIG -= -qt app_bundle

TEMPLATE = app

SOURCES += main.cpp
atom.cpp
mp4.cpp
file.cpp
track.cpp

HEADERS +=
atom.h
mp4.h
file.h
track.h

INCLUDEPATH += -I/usr/local/lib
LIBS += -L/usr/local/lib -lavformat -lavcodec -lavutil

#QMAKE_LFLAGS += -static
#LIBS += /usr/lib/x86_64-linux-gnu/libavcodec.a \

/usr/lib/x86_64-linux-gnu/libavformat.a \

/usr/lib/x86_64-linux-gnu/libavutil.a

The bottom 3 lines suggest it’s 64 bit :frowning:

Graeme

Mark might be right, it worked on my 64bit system.

The bottom 3 lines are commented out. So not relevant.
Source code is usually neutral, you compile against the target (32 bit or 64)

Perhaps better to compile that from the source.

cd ~/Downloads/untrunc_1.0/

then

g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/usr/local/lib -lavformat -lavcodec -lavutil

See if that version fares any better

graeme@Linux1 ~ $ cd ~/Downloads/untrunc_1.0/
graeme@Linux1 ~/Downloads/untrunc_1.0 $ 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:169:8: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
track.cpp:169:47: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
mp4.cpp: In member function ‘void Mp4::open(std::string)’:
mp4.cpp:53:5: warning: ‘void avcodec_init()’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3812) [-Wdeprecated-declarations]
mp4.cpp:53:18: warning: ‘void avcodec_init()’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3812) [-Wdeprecated-declarations]
mp4.cpp:57:17: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1368) [-Wdeprecated-declarations]
mp4.cpp:57:77: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1368) [-Wdeprecated-declarations]
mp4.cpp:61:8: warning: ‘int av_find_stream_info(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1412) [-Wdeprecated-declarations]
mp4.cpp:61:35: warning: ‘int av_find_stream_info(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1412) [-Wdeprecated-declarations]
mp4.cpp:64:5: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1902) [-Wdeprecated-declarations]
mp4.cpp:64:48: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1902) [-Wdeprecated-declarations]
graeme@Linux1 ~/Downloads/untrunc_1.0 $ cd /home/graeme/Corrupted/mov
graeme@Linux1 ~/Corrupted/mov $ ./untrunc movref.mov mov000.mov
bash: ./untrunc: cannot execute binary file
graeme@Linux1 ~/Corrupted/mov $ sudo ./untrunc movref.mov mov000.mov[sudo] password for graeme: 
./untrunc: 1: ./untrunc: ELF: not found
./untrunc: 2: ./untrunc: Syntax error: "(" unexpected
graeme@Linux1 ~/Corrupted/mov $