1
1
<script setup lang="ts">
2
2
import { useVModel } from ' @vueuse/core'
3
3
import { nextTick } from ' vue'
4
- import { getFilename , mimeType , recordCamera , recorder , recordingName } from ' ../logic/recording'
4
+ import { bitRate , frameRate , getFilename , mimeType , recordCamera , recorder , recordingName , resolution } from ' ../logic/recording'
5
5
import DevicesSelectors from ' ./DevicesSelectors.vue'
6
6
import Modal from ' ./Modal.vue'
7
7
@@ -18,6 +18,14 @@ const value = useVModel(props, 'modelValue', emit)
18
18
19
19
const { startRecording } = recorder
20
20
21
+ const frameRateOptions = [15 , 24 , 30 , 60 ]
22
+ const resolutionOptions = [
23
+ { value: ' 1280x720' , label: ' 720p (1280x720)' },
24
+ { value: ' 1920x1080' , label: ' 1080p (1920x1080)' },
25
+ { value: ' 2560x1440' , label: ' 1440p (2560x1440)' },
26
+ { value: ' 3840x2160' , label: ' 2160p (3840x2160)' },
27
+ ]
28
+
21
29
function close() {
22
30
value .value = false
23
31
}
@@ -27,6 +35,7 @@ async function start() {
27
35
await nextTick ()
28
36
startRecording ({
29
37
mimeType: mimeType .value ,
38
+ bitsPerSecond: bitRate .value * 1024 ,
30
39
})
31
40
}
32
41
</script >
@@ -51,6 +60,48 @@ async function start() {
51
60
<div >This will be used in the output filename that might <br >help you better organize your recording chips.</div >
52
61
</div >
53
62
</div >
63
+
64
+ <div class =" form-text" >
65
+ <label for =" framerate" >Frame Rate</label >
66
+ <select
67
+ v-model =" frameRate"
68
+ class =" bg-transparent text-current border border-main rounded px-2 py-1"
69
+ name =" framerate"
70
+ >
71
+ <option v-for =" rate in frameRateOptions" :key =" rate" :value =" rate" >
72
+ {{ rate }} fps
73
+ </option >
74
+ </select >
75
+ </div >
76
+
77
+ <div class =" form-text" >
78
+ <label for =" resolution" >Resolution</label >
79
+ <select
80
+ v-model =" resolution"
81
+ class =" bg-transparent text-current border border-main rounded px-2 py-1"
82
+ name =" resolution"
83
+ >
84
+ <option v-for =" res in resolutionOptions" :key =" res.value" :value =" res.value" >
85
+ {{ res.label }}
86
+ </option >
87
+ </select >
88
+ </div >
89
+
90
+ <div class =" form-text" >
91
+ <label for =" bitrate" >Bitrate</label >
92
+ <div class =" relative" >
93
+ <input
94
+ v-model.number =" bitRate"
95
+ type =" number"
96
+ min =" 1000"
97
+ step =" 1000"
98
+ class =" bg-transparent text-current border border-main rounded px-2 py-1 w-full pr-12"
99
+ name =" bitrate"
100
+ >
101
+ <span class =" absolute right-3 top-1/2 transform -translate-y-1/2 text-sm opacity-50" >kbps</span >
102
+ </div >
103
+ </div >
104
+
54
105
<div class =" form-check" >
55
106
<input
56
107
v-model =" recordCamera"
0 commit comments