Giter Club home page Giter Club logo

Comments (4)

sannies avatar sannies commented on August 21, 2024
public static void main(String[] args) throws IOException {
    IsoFile isoFile = new IsoFile(args[0]);
    List<TrackHeaderBox> tkhds = Path.getPaths(isoFile, "/moov/trak/tkhd");
    for (TrackHeaderBox tkhd : tkhds) {
        System.err.println(tkhd.getHeight() + "x" + tkhd.getWidth());
    }
}

from mp4parser.

ytrezq avatar ytrezq commented on August 21, 2024

@sannies : Yes, but you declaredgetWidth()with

public class TrackHeaderBox extends AbstractFullBox {

    public static final String TYPE = "tkhd";

    private double width;
    public double getWidth() {
        return width;
    }

I'm trying to write a solve this problem. So I need to understand how an implementation work.

from mp4parser.

sannies avatar sannies commented on August 21, 2024

I think you need to dig a bit deeper here. The actual value is parsed from an input file. Have a look at the _parseDetails method. Unfortunately an MP4 container is a bit more complex than let's say a jpeg or gif file and the track header is not always at the same place/offset. The tkhd (TrackHeaderBox) contains width and height as the muxer (the software that wraps raw h264 streams in mp4) has read it from the raw h264 stream. The h264 stream itself has the width and height in its Sequence Parameter Set.
You might want to have a look at the PrintStructure example as it parses through a file's structure without too much overhead. It should be easily adoptable to read from a http based stream. When you find the tkhd box you can then extract the width/height by hand (check _parseDetails of the TrackHeaderBox class)

from mp4parser.

ytrezq avatar ytrezq commented on August 21, 2024

@sannies : More details here.

from mp4parser.

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.