Spaces:
Sleeping
Sleeping
update personnal fps
Browse files
src/components/SegmentationSidebar.vue
CHANGED
@@ -65,6 +65,7 @@
|
|
65 |
|
66 |
<!-- Sélecteur de FPS -->
|
67 |
<div class="fps-selector">
|
|
|
68 |
<select
|
69 |
id="fps-select"
|
70 |
v-model="selectedFps"
|
@@ -79,6 +80,27 @@
|
|
79 |
<option value="60">60 FPS</option>
|
80 |
<option value="120">120 FPS</option>
|
81 |
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
</div>
|
83 |
</div>
|
84 |
|
@@ -225,6 +247,8 @@ export default {
|
|
225 |
videoStore,
|
226 |
annotationStore,
|
227 |
selectedFps: videoStore.fps || 25,
|
|
|
|
|
228 |
currentViewIndex: 0,
|
229 |
transitionName: 'slide-right',
|
230 |
uploadedConfig: null,
|
@@ -331,7 +355,36 @@ export default {
|
|
331 |
},
|
332 |
|
333 |
updateFps() {
|
334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
},
|
336 |
|
337 |
// Config upload methods
|
@@ -816,6 +869,8 @@ export default {
|
|
816 |
gap: 8px;
|
817 |
padding: 12px;
|
818 |
border-radius: 8px;
|
|
|
|
|
819 |
}
|
820 |
|
821 |
.fps-select {
|
@@ -833,6 +888,76 @@ export default {
|
|
833 |
border-color: #4CAF50;
|
834 |
}
|
835 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
836 |
/* Config Upload Page Styles */
|
837 |
.config-upload-page {
|
838 |
display: flex;
|
|
|
65 |
|
66 |
<!-- Sélecteur de FPS -->
|
67 |
<div class="fps-selector">
|
68 |
+
<label for="fps-select" class="fps-label">FPS prédéfini</label>
|
69 |
<select
|
70 |
id="fps-select"
|
71 |
v-model="selectedFps"
|
|
|
80 |
<option value="60">60 FPS</option>
|
81 |
<option value="120">120 FPS</option>
|
82 |
</select>
|
83 |
+
<div class="custom-fps">
|
84 |
+
<label for="custom-fps-input">FPS personnalisé</label>
|
85 |
+
<div class="custom-fps-row">
|
86 |
+
<input
|
87 |
+
id="custom-fps-input"
|
88 |
+
type="number"
|
89 |
+
min="1"
|
90 |
+
step="0.01"
|
91 |
+
v-model="customFps"
|
92 |
+
@keydown.enter="applyCustomFps"
|
93 |
+
class="fps-input"
|
94 |
+
placeholder="ex: 29.97"
|
95 |
+
/>
|
96 |
+
<button class="apply-fps-btn" @click="applyCustomFps" title="Appliquer" aria-label="Appliquer">
|
97 |
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
98 |
+
<path d="M20 6L9 17l-5-5"/>
|
99 |
+
</svg>
|
100 |
+
</button>
|
101 |
+
</div>
|
102 |
+
<p v-if="fpsError" class="fps-error">{{ fpsError }}</p>
|
103 |
+
</div>
|
104 |
</div>
|
105 |
</div>
|
106 |
|
|
|
247 |
videoStore,
|
248 |
annotationStore,
|
249 |
selectedFps: videoStore.fps || 25,
|
250 |
+
customFps: '',
|
251 |
+
fpsError: '',
|
252 |
currentViewIndex: 0,
|
253 |
transitionName: 'slide-right',
|
254 |
uploadedConfig: null,
|
|
|
355 |
},
|
356 |
|
357 |
updateFps() {
|
358 |
+
const parsed = parseFloat(String(this.selectedFps))
|
359 |
+
this.videoStore.setFps(parsed)
|
360 |
+
if (this.annotationStore.currentSession) {
|
361 |
+
this.annotationStore.currentSession.frameRate = parsed
|
362 |
+
if (this.annotationStore.currentSession.metadata) {
|
363 |
+
this.annotationStore.currentSession.metadata.fps = parsed
|
364 |
+
}
|
365 |
+
}
|
366 |
+
},
|
367 |
+
|
368 |
+
applyCustomFps() {
|
369 |
+
this.fpsError = ''
|
370 |
+
const value = typeof this.customFps === 'string' ? this.customFps.replace(',', '.') : this.customFps
|
371 |
+
const parsed = parseFloat(value)
|
372 |
+
if (isNaN(parsed)) {
|
373 |
+
this.fpsError = 'Veuillez entrer un nombre valide.'
|
374 |
+
return
|
375 |
+
}
|
376 |
+
if (parsed <= 0 || parsed > 1000) {
|
377 |
+
this.fpsError = 'La valeur doit être > 0 et raisonnable (< 1000).'
|
378 |
+
return
|
379 |
+
}
|
380 |
+
this.videoStore.setFps(parsed)
|
381 |
+
this.selectedFps = String(parsed)
|
382 |
+
if (this.annotationStore.currentSession) {
|
383 |
+
this.annotationStore.currentSession.frameRate = parsed
|
384 |
+
if (this.annotationStore.currentSession.metadata) {
|
385 |
+
this.annotationStore.currentSession.metadata.fps = parsed
|
386 |
+
}
|
387 |
+
}
|
388 |
},
|
389 |
|
390 |
// Config upload methods
|
|
|
869 |
gap: 8px;
|
870 |
padding: 12px;
|
871 |
border-radius: 8px;
|
872 |
+
background: #424242;
|
873 |
+
color: white;
|
874 |
}
|
875 |
|
876 |
.fps-select {
|
|
|
888 |
border-color: #4CAF50;
|
889 |
}
|
890 |
|
891 |
+
.custom-fps {
|
892 |
+
display: flex;
|
893 |
+
flex-direction: column;
|
894 |
+
gap: 6px;
|
895 |
+
}
|
896 |
+
|
897 |
+
.custom-fps-row {
|
898 |
+
display: grid;
|
899 |
+
grid-template-columns: 1fr 36px;
|
900 |
+
gap: 8px;
|
901 |
+
align-items: center;
|
902 |
+
}
|
903 |
+
|
904 |
+
.fps-input {
|
905 |
+
background: #363636;
|
906 |
+
border: 1px solid #555;
|
907 |
+
border-radius: 4px;
|
908 |
+
color: white;
|
909 |
+
padding: 8px 12px;
|
910 |
+
font-size: 0.9rem;
|
911 |
+
width: 100%;
|
912 |
+
height: 36px;
|
913 |
+
appearance: textfield;
|
914 |
+
-webkit-appearance: none;
|
915 |
+
min-width: 0;
|
916 |
+
}
|
917 |
+
|
918 |
+
/* Masquer les flèches du type number (Chrome/Edge) */
|
919 |
+
.fps-input::-webkit-outer-spin-button,
|
920 |
+
.fps-input::-webkit-inner-spin-button {
|
921 |
+
-webkit-appearance: none;
|
922 |
+
margin: 0;
|
923 |
+
}
|
924 |
+
|
925 |
+
/* Masquer les flèches du type number (Firefox) */
|
926 |
+
.fps-input[type="number"] {
|
927 |
+
-moz-appearance: textfield;
|
928 |
+
appearance: textfield;
|
929 |
+
}
|
930 |
+
|
931 |
+
.apply-fps-btn {
|
932 |
+
background: #424242;
|
933 |
+
border: 1px solid #555;
|
934 |
+
border-radius: 4px;
|
935 |
+
color: white;
|
936 |
+
padding: 0;
|
937 |
+
font-size: 0.9rem;
|
938 |
+
cursor: pointer;
|
939 |
+
height: 36px;
|
940 |
+
width: 36px;
|
941 |
+
white-space: nowrap;
|
942 |
+
display: inline-flex;
|
943 |
+
align-items: center;
|
944 |
+
justify-content: center;
|
945 |
+
}
|
946 |
+
|
947 |
+
.apply-fps-btn:hover {
|
948 |
+
background: #4a4a4a;
|
949 |
+
}
|
950 |
+
|
951 |
+
.fps-error {
|
952 |
+
color: #ff7675;
|
953 |
+
font-size: 0.8rem;
|
954 |
+
}
|
955 |
+
|
956 |
+
.fps-label {
|
957 |
+
color: #ccc;
|
958 |
+
font-size: 0.8rem;
|
959 |
+
}
|
960 |
+
|
961 |
/* Config Upload Page Styles */
|
962 |
.config-upload-page {
|
963 |
display: flex;
|