Skip to content

Commit 6afd22c

Browse files
authored
[fix] Video templates to use Video tag and sync (#1480)
* [fix] Video templates to use Video tag and sync
1 parent b705102 commit 6afd22c

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

label_studio/annotation_templates/videos/video-classification/config.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<View>
2-
<HyperText name="video" value="$video"/>
2+
<Video name="video" value="$video"/>
33
<Choices name="choice" toName="video" showInLine="true">
44
<Choice value="Blurry" />
55
<Choice value="Sharp" />
66
</Choices>
77
</View>
88

99
<!-- {"data": {
10-
"video": "<video src='static/samples/opossum_snow.mp4' width=100% controls>",
11-
"videoSource": "/static/samples/opossum_snow.mp4"
10+
"video": "/static/samples/opossum_snow.mp4"
1211
},
1312
"predictions": [{"result":
1413
[

label_studio/annotation_templates/videos/video-classification/config.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ image: /static/templates/video-classification.png
55
details: <h1>Classify video</h1>
66
config: |
77
<View>
8-
<HyperText name="video" value="$video"/>
8+
<Video name="video" value="$video"/>
99
<Choices name="choice" toName="video" showInLine="true">
1010
<Choice value="Blurry" />
1111
<Choice value="Sharp" />
@@ -15,8 +15,7 @@ config: |
1515
<!-- {
1616
1717
"data": {
18-
"video": "<video src='static/samples/opossum_snow.mp4' width=100% controls>",
19-
"videoSource": "/static/samples/opossum_snow.mp4"
18+
"video": "/static/samples/opossum_snow.mp4"
2019
},
2120
2221
"annotations": [{"result":
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
<View>
22
<Header value="Video timeline segmentation via AudioPlus sync trick"/>
3-
<HyperText name="video" value="$video"/>
3+
<Video name="video" value="$video" sync="audio"/>
44
<Labels name="tricks" toName="audio" choice="multiple">
55
<Label value="Kickflip" background="#1BB500" />
66
<Label value="360 Flip" background="#FFA91D" />
77
<Label value="Trick" background="#358EF3" />
88
</Labels>
9-
<AudioPlus name="audio" value="$videoSource" speed="false"/>
9+
<AudioPlus name="audio" value="$video" sync="video" speed="false"/>
1010
</View>
1111

1212
<!--
13-
It's very important to prepare task data correctly,
14-
it includes HyperText $video and
15-
it must be like this example below:
13+
Audio tag uses the same $video file to be in sync, video is muted
1614
-->
1715

1816
<!-- {
19-
"video": "<video src='/static/samples/opossum_snow.mp4' width=100% muted/><img src onerror=\"$=n=>document.querySelector(n);a=$('.ls-editor audio');v=$('video');a.onseeked=()=>{v.currentTime=a.currentTime};a.onplay=()=>v.play();a.onpause=()=>v.pause()\" />",
20-
"videoSource": "/static/samples/opossum_snow.mp4"
17+
"video": "/static/samples/opossum_snow.mp4"
2118
} -->

label_studio/annotation_templates/videos/video-timeline-segmentation/config.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,20 @@ details: <h1>Select and classify video segments</h1>
66
config: |
77
<View>
88
<Header value="Video timeline segmentation via AudioPlus sync trick"/>
9-
<HyperText name="video" value="$video"/>
9+
<Video name="video" value="$video" sync="audio"/>
1010
<Labels name="tricks" toName="audio" choice="multiple">
1111
<Label value="Kickflip" background="#1BB500" />
1212
<Label value="360 Flip" background="#FFA91D" />
1313
<Label value="Trick" background="#358EF3" />
1414
</Labels>
15-
<AudioPlus name="audio" value="$videoSource" speed="false"/>
15+
<AudioPlus name="audio" value="$video" sync="video" speed="false"/>
1616
</View>
1717
1818
<!--
19-
It's very important to prepare task data correctly,
20-
it includes HyperText $video and
21-
it must be like this example below:
19+
Audio tag uses the same $video file to be in sync, video is muted
2220
-->
2321
2422
<!-- {
25-
"video": "<video src='/static/samples/opossum_snow.mp4' width=100% muted/><img src onerror=\"$=n=>document.querySelector(n);a=$('.ls-editor audio');v=$('video');a.onseeked=()=>{v.currentTime=a.currentTime};a.onplay=()=>v.play();a.onpause=()=>v.pause()\" />",
26-
"videoSource": "/static/samples/opossum_snow.mp4"
23+
"video": "/static/samples/opossum_snow.mp4"
2724
} -->
2825

0 commit comments

Comments
 (0)