Comments (4)
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.
@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.
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.
from mp4parser.
Related Issues (20)
- On the fly HOT 1
- Class Not Found Exception : org,mp4parser.boxes.iso.14496.part12.FileTypeBox.
- Java mp4parser to create a single .m4s fragment (without malformation)
- Write MP4 file from RTSP stream
- MovieCreator.build(file) NullPointerException
- mux bytebuffer audio and video
- VP9 support for mp4parser
- Will your library support OpenHarmony platform by JavaScript language ? HOT 1
- Cant Trim Videos
- How to release resources HOT 1
- java.lang.OutOfMemoryError: Direct buffer memory
- NullPointerException when trying on Android corrupt video file
- Latest Git Tag not pushed
- Can this be used to add timed metadata?
- Can you provide a guide on how to install?
- Why are so many tags updated on Apr 26, 2022?
- Android SDK mp4parser issue while implementation to other project because of dependency
- convert video in 3 seconds segments
- Adding HEIF Support
- Buffer size should be checked when parsing font name field of QuicktimeText block
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mp4parser.