eluv-io / elv-live-js

Eluvio Live JavaScript SDK
MIT License
4 stars 3 forks source link

Enhance time spec for stream insertions #122

Closed elv-serban closed 1 year ago

elv-serban commented 1 year ago

Quick enhancement for the ./elv-stream insertion

Now insertion time can be specified as follows:

(a) Seconds (float) since stream start

120.050

(b) Seconds from now (same as above but use --from_now flag)

60.000 --from_now

(c) Wall time (absolute) using this ISO format (can have milliseconds; always UTC!)

2023-06-06T06:05:00.700Z

Example (the most common example for testing):

/elv-stream insertion iq__rNTPXZR6hiCrCHPCSidkjZtNsdb  120 hq__8iY9aVTRNsM6hXobZGFCp1u5bTijKvJ5kEQUr6ZV6SpZbUhjDBKfsbfWN9ui6B1poXwSK6RRCa --duration 25
elv-reza commented 1 year ago

Can we add some (optional) params when initializing / creating streams? These params would be stream params including transcoding params and can be passed as a json file.

elv-reza commented 1 year ago

I did some tests with the script. We also need to check the input params and validate some of the params when we do ad insertion. We have to check the is a valid hash and it points to a valid ad object (i.e it doesn't point to another live object). I managed to create an ad that points to the same live object, which has to be prevented by the script.

elv-reza commented 1 year ago

You can not insert an (some) ad(s) if the stream is not started yet but created.

./elv-stream insertion iq__XWt2pYobSzv4pVnzC8u3fUPFgqF 90 hq__5ic3LaopYAtgd8Vo4vFPGSNHLxaDTJtBxGhuPwnakRsTdwgbL8qGWMPhv8S2f5GrYtKs1wLSC6
Time: 90 since start
ERROR: TypeError: Cannot read property 'recording_sequence' of undefined
    at EluvioLiveStream.Insertion (/home/reza/eluvio/elv-live-js/src/LiveStream.js:727:31)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async CmdStreamInsertion (/home/reza/eluvio/elv-live-js/utilities/EluvioLiveStreamCli.js:154:18)
elv-serban commented 1 year ago

Good point - I addressed it with the latest commit in the branch insertion-time-recordings. PR open