Skip to main content
added 169 characters in body
Source Link
golimar
  • 1.7k
  • 1
  • 23
  • 37

In case untrunc doesn't support the codec inside your file, you can try to fix it with an hex editor:

  1. get another file with the same format, I got a bigger one but probably any length will work
  2. open both files in an hex editor
  3. replace the mdat section in the "ok" file with the mdat section in the "broken" file, without the header (i.e. copy only the bytes after 'mdat')
  4. it would probably already work like that, if not, the 4 bytes before 'mdat' specify the size of the mdat section, the current value will be the old size ("ok" file mdat section size), replace it with the new size ("broken" file mdat section size)

I ended up coding a simple program to do it: https://github.com/golimarrrr/fix-3gp

Both the program and by hand using the hex editor should create the same fixed file

In case untrunc doesn't support the codec inside your file, you can try to fix it with an hex editor:

  1. get another file with the same format, I got a bigger one but probably any length will work
  2. open both files in an hex editor
  3. replace the mdat section in the "ok" file with the mdat section in the "broken" file, without the header (i.e. copy only the bytes after 'mdat')
  4. it would probably already work like that, if not, the 4 bytes before 'mdat' specify the size of the mdat section, the current value will be the old size ("ok" file mdat section size), replace it with the new size ("broken" file mdat section size)

In case untrunc doesn't support the codec inside your file, you can try to fix it with an hex editor:

  1. get another file with the same format, I got a bigger one but probably any length will work
  2. open both files in an hex editor
  3. replace the mdat section in the "ok" file with the mdat section in the "broken" file, without the header (i.e. copy only the bytes after 'mdat')
  4. it would probably already work like that, if not, the 4 bytes before 'mdat' specify the size of the mdat section, the current value will be the old size ("ok" file mdat section size), replace it with the new size ("broken" file mdat section size)

I ended up coding a simple program to do it: https://github.com/golimarrrr/fix-3gp

Both the program and by hand using the hex editor should create the same fixed file

Source Link
golimar
  • 1.7k
  • 1
  • 23
  • 37

In case untrunc doesn't support the codec inside your file, you can try to fix it with an hex editor:

  1. get another file with the same format, I got a bigger one but probably any length will work
  2. open both files in an hex editor
  3. replace the mdat section in the "ok" file with the mdat section in the "broken" file, without the header (i.e. copy only the bytes after 'mdat')
  4. it would probably already work like that, if not, the 4 bytes before 'mdat' specify the size of the mdat section, the current value will be the old size ("ok" file mdat section size), replace it with the new size ("broken" file mdat section size)