Author Topic: "Broken" MP4 files  (Read 1249 times)

oshae

  • Newbie
  • *
  • Posts: 5
"Broken" MP4 files
« on: January 21, 2018, 09:18:05 PM »
Hello all

I'm trying to fix some MP4 videos that do not function properly. It's kind of hard to describe the symptom, if there was just a word for it I would maybe have an easier time searching the internet for a solution.

Essentially, with most of them the play length that is detected is very long. Like if it's a 1 hour video, the player might think it's 8 hours. The video will play and you can seek in it, but you can only seek by clicking on a small portion of the progress bar. Otherwise you go outside it into the empty space of the video and the screen goes black. I have been able to fix these with Avidemux, by just choosing the beginning as A and where the video truly ends as B and then copying.

Some others are not so simple. In another, the first say 20 minutes of the video encompasses all of what the player knows about. So if you skip to what you think is the end it's actually only about 20 minutes into the video. In Avidemux, the progress bar will move almost to the end of the video and then stop. But the video keeps playing all the way to the end. If I play the video in a normal video player, after the first 20 minutes that is normal, the player goes blank and progress freezes. These I have not been able to fix. I did just a straight copy of the whole video, the file size ended up smaller and it was only the first 20 playable minutes. It's like Avidemux can see what is there but cannot assemble it when doing a copy.

Sorry if my description is terrible. It's hard to explain without seeing. I'm wondering if I need to re-encode them versus just a copy operation?

Thanks in advance for any hints!

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6052
Re: "Broken" MP4 files
« Reply #1 on: January 22, 2018, 07:08:22 AM »
Make sure you're using the latest (nightly) avidemux. http://avidemux.org/nightly/
Delete the .idx2 for the related videos, and try copy operation again.
If the issue is still there, then try re-encoding one. See if that would help.
« Last Edit: January 22, 2018, 04:35:35 PM by Jan Gruuthuse »

oshae

  • Newbie
  • *
  • Posts: 5
Re: "Broken" MP4 files
« Reply #2 on: January 22, 2018, 04:32:43 PM »
What if it is a file someone already encoded and there are no idx files?

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6052
Re: "Broken" MP4 files
« Reply #3 on: January 22, 2018, 04:34:21 PM »
The index file would be created, in most cases upon loading into avidemux. (Not for mkv)
Index files are created only for MpegTS and MpegPS streams.
« Last Edit: January 23, 2018, 01:33:37 PM by Jan Gruuthuse »

oshae

  • Newbie
  • *
  • Posts: 5
Re: "Broken" MP4 files
« Reply #4 on: January 22, 2018, 05:30:48 PM »
And if I see no index files? I'm looking where the video is stored and don't see anything. Hidden files etc. shown.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2304
Re: "Broken" MP4 files
« Reply #5 on: January 23, 2018, 12:41:38 AM »
Index files are created only for MpegTS and MpegPS streams.

If a MP4 video container specifies an excessive video duration, Avidemux won't discard it AFAIR, but setting the B marker at the last frame and saving the video in copy mode should fix this. If the duration is not sufficient, it is ignored. Providing samples would allow to look into the issue if something goes wrong here.

oshae

  • Newbie
  • *
  • Posts: 5
Re: "Broken" MP4 files
« Reply #6 on: January 25, 2018, 12:43:50 AM »
I would upload some samples, but they are quite large. And the content is personal.

I've fixed a few of them. Generally speaking, the ones where the video runtime is much longer than the actual content itself, I can cut out the end and copy it.

The ones I can't fix are the ones where the runtime is shorter than the actual content. The progress bar in Avidemux moves to the end after about 30 minutes of actual video content and stops. But then the video keeps playing for the next 1.5hours and as you watch it looks like it is sped up, like fast forwarding.

Wish I understood more about video encoding/editing. I'm sure I could fix them somehow.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2304
Re: "Broken" MP4 files
« Reply #7 on: January 25, 2018, 08:19:27 AM »
Could you at least launch Avidemux, load the said video, then compress and attach the log file (admlog.txt from %localappdata%\avidemux\ on Windows; redirected console output on Linux and macOS)?

oshae

  • Newbie
  • *
  • Posts: 5
Re: "Broken" MP4 files
« Reply #8 on: January 26, 2018, 11:27:07 PM »
Just open the file and gather the log? Or try to edit/copy the video first then get the log?

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2304
Re: "Broken" MP4 files
« Reply #9 on: January 26, 2018, 11:50:46 PM »
For now just load the video, no other operations prior to getting the log.

GeoSlv

  • Newbie
  • *
  • Posts: 12
Re: "Broken" MP4 files
« Reply #10 on: January 28, 2018, 09:47:23 PM »
It's because of faulty muxing. In avi it's faulty interleaving. Maybe a bad combination of video and audio. Maybe fault of converter /editor.