mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-23 19:17:44 -05:00
reorganize /recordings JSON response
I want to start returning the pixel aspect ratio of each video sample entry. It's silly to duplicate it for each returned recording, so let's instead return a videoSampleEntryId and then put all the information about each VSE once. This change doesn't actually handle pixel aspect ratio server-side yet. Most likely I'll require a new schema version for that, to store it as a new column in the database. Codec-specific logic in the database layer is awkward and I'd like to avoid it. I did a similar schema change to add the rfc6381_codec. I also adjusted ui-src/lib/models/Recording.js in a few ways: * fixed a couple mismatches between its field name and the key defined in the API. Consistency aids understanding. * dropped all the getters in favor of just setting the fields (with type annotations) as described here: https://google.github.io/styleguide/jsguide.html#features-classes-fields * where the wire format used undefined (to save space), translate it to a more natural null or false.
This commit is contained in:
@@ -91,7 +91,7 @@ export default class RecordingFormatter {
|
||||
recording.videoSampleEntryWidth +
|
||||
'x' +
|
||||
recording.videoSampleEntryHeight,
|
||||
frameRate: frameRateFmt.format(recording.frameCount / duration),
|
||||
frameRate: frameRateFmt.format(recording.videoSamples / duration),
|
||||
size: sizeFmt.format(recording.sampleFileBytes / 1048576) + ' MB',
|
||||
rate:
|
||||
sizeFmt.format(recording.sampleFileBytes / duration * 0.000008) +
|
||||
|
||||
Reference in New Issue
Block a user