Explorar o código

master: Fixed 旋转录像视频、修复问题

gitboyzcf hai 7 meses
pai
achega
8dbae20151

+ 7 - 1
src/components/Icon.vue

@@ -61,7 +61,7 @@ const props = defineProps({
 })
 
 const iconCom = shallowRef(null)
-onMounted(() => {
+const setIcon = () => {
   switch (props.icon) {
     case 'wpf:panorama':
       iconCom.value = WpfPanorama
@@ -220,5 +220,11 @@ onMounted(() => {
       console.error(`${props.icon}需要到 src/components/Icon.vue 中配置改图标`)
       break
   }
+}
+watch(() => props.icon, (newV) => {
+  setIcon()
+})
+onMounted(() => {
+  setIcon()
 })
 </script>

+ 1 - 1
src/hooks/useWorker.js

@@ -145,7 +145,7 @@ export default function useWorker(url, className, callback = () => {}) {
         console.log(msg)
       })
       await ffmpeg.writeFile('test.mp4', await fetchFile(message.data.Data))
-      ffmpeg.exec(['-i', 'test.mp4', '-c', 'copy', '-map', '0', 'out.mp4'])
+      ffmpeg.exec(['-i', 'test.mp4', '-c', 'copy', '-metadata:s:v', 'rotate=90', 'out.mp4'])
       const data = await ffmpeg.readFile('out.mp4')
       ffmpeg.deleteFile('test.mp4')
       DownloadStreamSaver(

+ 5 - 5
src/views/VideoMonitoring/components/Header.vue

@@ -44,7 +44,7 @@
             :icon="item.iCom"
             :width="item.w"
             :height="item.h"
-            color="#8ac5ff"
+            :color="item.color"
           />
         </div>
       </div>
@@ -206,7 +206,7 @@ const btns = [
   // }
 ]
 
-const list = shallowRef([
+const list = ref([
   // {
   //   iCom: 'ant-design:tag-outlined',
   //   label: '标签过滤',
@@ -217,7 +217,7 @@ const list = shallowRef([
   {
     iCom: 'iconoir:screenshot',
     label: '截图',
-    color: 'white',
+    color: '#8ac5ff',
     type: 'jt',
     w: 20,
     h: 20
@@ -225,7 +225,7 @@ const list = shallowRef([
   {
     iCom: 'carbon:video',
     label: '录像',
-    color: 'white',
+    color: '#8ac5ff',
     type: 'lx',
     class: '',
     w: 25,
@@ -254,7 +254,7 @@ const listComputed = computed(() => {
         item.class = 'update-style'
       } else {
         item.iCom = 'carbon:video'
-        item.color = 'white'
+        item.color = '#8ac5ff'
         item.class = ''
       }
     }