Browse Source

add aspectRatio and samplingRate to asset JS object. update docs

master
Jonathan Cobb 3 years ago
parent
commit
f7b0cac7f0
3 changed files with 17 additions and 0 deletions
  1. +6
    -0
      docs/concepts.md
  2. +6
    -0
      docs/jvc_js.md
  3. +5
    -0
      src/main/java/jvc/model/js/JAssetJs.java

+ 6
- 0
docs/concepts.md View File

@@ -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


+ 6
- 0
docs/jvc_js.md View File

@@ -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.



+ 5
- 0
src/main/java/jvc/model/js/JAssetJs.java View File

@@ -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()) {


Loading…
Cancel
Save