Video Duration: The duration of a video is now shown on thumbnails and bellow the video player
Asset nodes now have a new field called "properties.duration_seconds". This holds a copy of the duration stored on the referenced video file and stays in sync using eve hooks. To migrate existing duration times from files to nodes you need to run the following: ./manage.py maintenance reconcile_node_video_duration -ag There are 2 more maintenance commands to be used to determine if there are any missing durations in either files or nodes: find_video_files_without_duration find_video_nodes_without_duration FFProbe is now used to detect what duration a video file has. Reviewed by Sybren.
This commit is contained in:
@@ -280,3 +280,23 @@ class VideoSizeTest(AbstractPillarTest):
|
||||
size = file_storage._video_cap_at_1080(2048, 2000)
|
||||
self.assertIsInstance(size[0], int)
|
||||
self.assertIsInstance(size[1], int)
|
||||
|
||||
|
||||
class VideoDurationTest(AbstractPillarTest):
|
||||
def test_video_duration_from_container(self):
|
||||
from pillar.api import file_storage
|
||||
from pathlib import Path
|
||||
|
||||
with self.app.test_request_context():
|
||||
fname = Path(__file__).with_name('video-tiny.mkv')
|
||||
|
||||
self.assertEqual(1, file_storage._video_duration_seconds(fname))
|
||||
|
||||
def test_video_duration_from_stream(self):
|
||||
from pillar.api import file_storage
|
||||
from pathlib import Path
|
||||
|
||||
with self.app.test_request_context():
|
||||
fname = Path(__file__).with_name('video-tiny.mp4')
|
||||
|
||||
self.assertEqual(2, file_storage._video_duration_seconds(fname))
|
||||
|
Reference in New Issue
Block a user