videolang / video

Source Code for Video language.
https://lang.video
Apache License 2.0
125 stars 12 forks source link

can producer length be non-integers? #45

Closed stchang closed 6 years ago

stchang commented 6 years ago

The following program (with version v0.2-beta.1):

#lang video
(displayln (get-property (clip "vid.mp4") "length"))

prints a non-integer number 83/15.

Is this expected?

(The same program produces an error on master)

stchang commented 6 years ago

fwiw, here's the error on master

bytes->string/locale: contract violation
  expected: bytes?
  given: #<cpointer:av-bprint>
  argument position: 1st
  other arguments...:
   #\?
  context...:
   video/private/init.rkt:68:2: for-loop
   video/private/init.rkt:107:5
LeifAndersen commented 6 years ago

Yes, the length can be any real?. This is because length is written in terms of seconds. In v0.1 it was in terms of frames because I naively thought it was atomic. Looking into video encodings more I realized that was foolish and seconds was a much better unit, allowing for sub-frames clips.

I will take a look into the error, thanks for catching it.

stchang commented 6 years ago

Ok that makes sense, thanks.

(I think the documentation might still in terms of frames though.)