Skip to content

Document basic FFmpegProbeResult usage#32

Merged
bramp merged 2 commits intobramp:masterfrom
stonio:patch-1
Jun 21, 2016
Merged

Document basic FFmpegProbeResult usage#32
bramp merged 2 commits intobramp:masterfrom
stonio:patch-1

Conversation

@stonio
Copy link
Copy Markdown
Contributor

@stonio stonio commented Jun 20, 2016

Small section in documentation to resolve #30.

README.md Outdated
FFprobe ffprobe = new FFprobe("/path/to/ffprobe");
FFmpegProbeResult probeResult = ffprobe.probe("input.mp4");

double duration = probeResult.getStreams().get(0).duration; // Get stream[0] duration in seconds
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we show a few more examples:

FFmpegStream stream =  probeResult.getStreams().get(0); // Get the first stream
System.out.format("Duration: %d Width: %d Height: %d", stream.duration, stream.width, stream.height);

or maybe just

FFmpegStream stream =  probeResult.getStreams().get(0); // Get the first stream
stream.codec_type; // Either Video or Audio
stream.duration // Duration in seconds
stream.width
stream.height

@bramp
Copy link
Copy Markdown
Owner

bramp commented Jun 21, 2016

Looks good. My only last issue is that we assume stream[0] is a Video. If we could check stream.codec_type that would be idea. However, I'll accept now, and we can perhaps fix that later.

@bramp bramp merged commit 90feac2 into bramp:master Jun 21, 2016
@stonio stonio deleted the patch-1 branch June 21, 2016 15:54
bramp pushed a commit that referenced this pull request Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how to use FFmpegProbeResult to get video properties (duration,size,dimension)

2 participants