egnor / pivid

Experimental video code for Linux / Raspberry Pi
MIT License
28 stars 4 forks source link

Support looping of a video without timestamps #6

Open pinballpower opened 2 years ago

pinballpower commented 2 years ago

The "repeat" parameter in the "play" definition is only working if "t" and "v" are defined. It would be good to have this working without timestamps - just loop the whole video. Otherwise the requesting program first needs to parse the file to detect its length.

egnor commented 2 years ago

I can certainly see how that would be handy. For what it's worth, you can use the /media/... URL to get metadata about the file, including the length; you don't have to literally parse it yourself. (https://github.com/egnor/pivid/blob/main/doc/protocol.md#get-mediafile---fetch-media-file-metadata)

In the general case one might want to do various things based on the media length, but it might be worth adding some direct support for the simple common cases that don't require the app making a separate request to load media metadata.