Fedora Linux Support Community & Resources Center
  #1  
Old 26th May 2017, 05:35 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Repair VIDEO with ffmpeg

Some video files re corrupted. Recording made an error.

How can I repair mp4 or wmv.

Like this?

Code:
recover_mp4_to_h264.exe good.MP4 --avcc

recover_mp4_to_h264.exe bad.MP4 bad.h264 bad.aac --android

ffmpeg -i bad.aac -acodec libvo_aacenc -b:a 96k fixed.aac

ffmpeg -r 30 -i bad.h264 -i fixed.aac -vcodec copy -acodec copy -bsf:a aac_adtstoasc fixed.mp4
Reply With Quote
  #2  
Old 26th May 2017, 07:29 PM
smr54 Offline
Registered User
 
Join Date: Jan 2010
Posts: 7,130
linuxfirefox
Re: Repair VIDEO with ffmpeg

recover_mp4_to_h264.exe sounds like a Windows program. I've never tried it. Doing a quick google indicates that there are a few other tools, but apparently, success depends upon how badly corrupted the original file is.
Reply With Quote
  #3  
Old 31st May 2017, 02:19 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Re: Repair VIDEO with ffmpeg

Thank You for help.
Why are the file damaged?
Battery became empty and so the machine could not close the file.
So I cannot play it.

So the error is only at the end of the file.

Is it possible

I open file without control with ffmpeg and I copy into a new container the file minus 3 minutes, the end.
Is this an idea?
Reply With Quote
  #4  
Old 1st June 2017, 06:01 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Re: Repair VIDEO with ffmpeg

https://github.com/ponchio/untrunc

I found that.
I could install but its not running. Error message: File not found.
Reply With Quote
  #5  
Old 1st June 2017, 07:53 PM
smr54 Offline
Registered User
 
Join Date: Jan 2010
Posts: 7,130
linuxchrome
Re: Repair VIDEO with ffmpeg

find out the length of the video, then you can do ffmpeg -i myfile -t <however_many_seconds--minus 3 minute> outfile
Reply With Quote
  #6  
Old 2nd June 2017, 03:04 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Re: Repair VIDEO with ffmpeg

Can I do it without knowing the length ?

Just save one minute for a check up.

Thank You.

ffmpeg -i myfileme.mp4 -t <120> save.mp4


Is this ok for saving 2 minutes?
Reply With Quote
  #7  
Old 2nd June 2017, 03:46 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Re: Repair VIDEO with ffmpeg

ffmpeg -i test.mp4 -t 00:01:00 aus.mp4

This is the order.

And it works with fine files and I can cut but the damaged file was not accepted.
Reply With Quote
  #8  
Old 2nd June 2017, 06:18 PM
smr54 Offline
Registered User
 
Join Date: Jan 2010
Posts: 7,130
linuxchrome
Re: Repair VIDEO with ffmpeg

It may have corrupted metadata. If it isn't accepted by ffmpeg, you could try mencoder (which I haven't used in a long time and may even use ffmpeg, I'm not sure.) Otherwise, you may be out of luck.

HOWEVER, I AM NO EXPERT. You can try googling for other solutions.
Reply With Quote
  #9  
Old 2nd June 2017, 08:14 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Re: Repair VIDEO with ffmpeg

Thank You for Your help.

Can You explain me or us

why is it


./untruc

and

not

untrunc

what is the ./

?

Regards


***


I could find:


https://de.wikipedia.org/wiki/MEncoder

But there is noting written about repair.....?

Last edited by matheandcreate; 2nd June 2017 at 08:19 PM.
Reply With Quote
  #10  
Old 2nd June 2017, 10:14 PM
smr54 Offline
Registered User
 
Join Date: Jan 2010
Posts: 7,130
linuxchrome
Re: Repair VIDEO with ffmpeg

Hrrm, I posted an answer and it seems to have disappeared. Maybe I closed it too soon.

Anyway, as far as an explanation of using ./ here's a fairly detailed one.

https://askubuntu.com/questions/3206...rent-directory
Reply With Quote
  #11  
Old 3rd June 2017, 12:29 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Re: Repair VIDEO with ffmpeg

Thank You.
I did compile.

So I cannot say untrunc but ./untrunc.

Ok so far.
But its not starting.
Reply With Quote
  #12  
Old 3rd June 2017, 01:21 PM
smr54 Offline
Registered User
 
Join Date: Jan 2010
Posts: 7,130
linuxfirefox
Re: Repair VIDEO with ffmpeg

Did it compile successfully. Did the compilation possibly fail?
Reply With Quote
  #13  
Old 3rd June 2017, 03:04 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Re: Repair VIDEO with ffmpeg

Did it compile successfully. Did the compilation possibly fail?

No
Compilation was fine.
And it did create files, I think nessessary files.
I can post a list.

Thank You.
Reply With Quote
  #14  
Old 3rd June 2017, 03:09 PM
smr54 Offline
Registered User
 
Join Date: Jan 2010
Posts: 7,130
linuxchrome
Re: Repair VIDEO with ffmpeg

By the way, to get the duration of a video (generally, probably won't work in this case, since you say ffmpeg won't accept it) one can use ffprobe -hide_banner myvideo which will give various information, including duration. To just get the duration

ffprobe myfile 2>&1 |grep Duration

(It prints out to STDERR).
Reply With Quote
  #15  
Old 3rd June 2017, 05:46 PM
matheandcreate's Avatar
matheandcreate Offline
Registered User
 
Join Date: Mar 2012
Location: Frankfurt
Posts: 85
linuxubuntuchrome
Re: Repair VIDEO with ffmpeg

Sorry

Bad concentration.

I do
./untrunc

ERROR Message

bash ./untrunc : (((in German language) cannot find file?

How can I delete the error message

I said ./untrunc box.mp4 destroy.mp4
destroy is wrong
box.mp4 is a correct mp4.

What did I do wrong?
Reply With Quote
Reply

Tags
ffmpeg , repair , video

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VHS - Video Handler Script, using ffmpeg sea Video 60 28th January 2016 03:16 PM
[FFMPEG] Encoding video with [2|3]-Pass sea Media software 0 13th August 2014 02:44 PM
add title to video with ffmpeg? is it possible? tunisiano1978 Using Fedora 2 24th June 2010 10:44 PM
blank video using ffmpeg convesion to mp4 samfraser Using Fedora 1 8th May 2008 10:56 PM
ffmpeg - recording video, but no sound... code_astronomer Using Fedora 2 27th April 2006 06:54 PM


Current GMT-time: 15:14 (Sunday, 22-10-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat