diff --git a/docs/concepts.md b/docs/concepts.md index bd489b1..1d1bbdd 100644 --- a/docs/concepts.md +++ b/docs/concepts.md @@ -30,6 +30,12 @@ Assets expose properties that can be referenced in operations. The properties cu * `duration`: duration of the audio/video in seconds (audio and video assets only) * `width`: width of the video in pixels (video and image assets only) * `height`: width of the video in pixels (video and image assets only) +* `aspectRatio`: ratio of width / height (video and image assets only) +* `samplingRate`: sampling rate in Hz (audio assets only) +* `tracks`: array of tracks. only includes audio and video tracks (video only) +* `audioTracks`: array of audio tracks (video only) +* `videoTracks`: array of video tracks (video only) +* `assets`: for a list asset, these are the nested sub-assets ## Operations Operations represent transformations to perform on the inputs, and validations diff --git a/docs/jvc_js.md b/docs/jvc_js.md index b216bb9..43b97e7 100644 --- a/docs/jvc_js.md +++ b/docs/jvc_js.md @@ -61,6 +61,12 @@ Resolution width in pixes (video or image). #### `height` Resolution height in pixes (video or image). +#### `aspectRatio` +Ratio of width / height (video or image). + +#### `samplingRate` +Sampling rate in Hz (audio). + #### `tracks` An array of the tracks in a video. Only includes audio and video tracks. diff --git a/src/main/java/jvc/model/js/JAssetJs.java b/src/main/java/jvc/model/js/JAssetJs.java index 281dd97..4a1951e 100644 --- a/src/main/java/jvc/model/js/JAssetJs.java +++ b/src/main/java/jvc/model/js/JAssetJs.java @@ -16,6 +16,8 @@ public class JAssetJs { public Double duration; public Integer width; public Integer height; + public Double aspectRatio; + public Integer samplingRate; public JTrackJs[] tracks = EMPTY_TRACKS; public JTrackJs[] videoTracks = EMPTY_TRACKS; public JTrackJs[] audioTracks = EMPTY_TRACKS; @@ -31,6 +33,9 @@ public class JAssetJs { final BigDecimal h = asset.height(); this.height = h == null ? null : h.intValue(); + this.aspectRatio = asset.aspectRatio() == null ? Double.NaN : asset.aspectRatio().doubleValue(); + this.samplingRate = asset.hasSamplingRate() ? asset.samplingRate().intValue() : 0; + if (asset.hasInfo()) { final JMediaInfo info = asset.getInfo(); for (JTrack track : info.getMedia().getTrack()) {