Giter Site home page Giter Site logo

Comments (6)

ponchio avatar ponchio commented on August 27, 2024

from untrunc.

dopeless avatar dopeless commented on August 27, 2024

Hello, have you had a chance to take a look at the videos? I've sent them to you via email a month ago, and still got no answer. Thanks.

from untrunc.

ponchio avatar ponchio commented on August 27, 2024

from untrunc.

dopeless avatar dopeless commented on August 27, 2024

Hi, first of all - thank you so much for taking time to fix it.
I've tried to fix it myself, as you described - and it really works! The video is fully restored!
But how can i calculate (or at least estimate) the samples count for other videos?
I mean, how can I get the reported number, and if I get it - do I need just to guess the real working number, or is there some way you've got the 24064?
Now I'm very close to get all the videos restored, hope for the last bit of help from you )
Thanks again.

P.S. And what does the -b option do?

from untrunc.

ponchio avatar ponchio commented on August 27, 2024

As you know you need a working video with the same characteristics.

if you run untrunc -a good.mp4, you will see each chunk size and offset. In your case the size reported is 288288 which /12 is 24024 (because it is computed from the data written in the atom stsz.
BUT if you check the distance from the offset of an audio packet (for example the first packet is 51799040) and the offset of the next video packet 52087808, it is 288768 (or 24064x12).

This can happens usually for padding (zero or random) , but in your case the additional 480 bytes seems filled with audio samples, can for memory alighment, for page allocations etc.

In your case the extra length is constant, contains audio, the sequence of video/audio is very regular, it could very possibly that I am wrong in interpreting the values (I tried to follo the documentation, but it sucks, when it exists).

Anyway unless you changed the audio parameters it is very likely that all the mp4 have the same problem and solution.

-b instructs untrunc on where the mdat (the atom containing the packets) starts, we only need to point it at the beginning of packet and in our case video packets are easier to spot.

If you want to spot a video packet use a hexeditor (bless for ubuntu works great), search for the ascii text "icpf", and the video packet starts 4 bytes before (works only for your video codec apch, obviously) (you can use the -a options to get the offsets in the good video).

from untrunc.

dopeless avatar dopeless commented on August 27, 2024

That was much mor, than a "bit".
Everything seems more or less clear now.
I'll try to fix some videos on the weekend.
Thank you one more time.

from untrunc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.