Browse Source

zhao:1修改转码设置 2录制设置统一大小

tags/录制修改前
耀 4 years ago
parent
commit
9b273a2979
1 changed files with 21 additions and 6 deletions
  1. 21
    6
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 21
- 6
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

2289
         }
2289
         }
2290
 
2290
 
2291
         #endregion
2291
         #endregion
2292
+
2292
         #region 新上传 显示缩略图
2293
         #region 新上传 显示缩略图
2293
         #region 初始值
2294
         #region 初始值
2294
         /// <summary>
2295
         /// <summary>
2333
                 //根据页面大小获取每页显示的数量 H300W250
2334
                 //根据页面大小获取每页显示的数量 H300W250
2334
                 int videoRow = (int)((GridMyVideo.ActualHeight - 50) / 300);
2335
                 int videoRow = (int)((GridMyVideo.ActualHeight - 50) / 300);
2335
                 int videColumn = (int)(GridMyVideo.ActualWidth / 250);
2336
                 int videColumn = (int)(GridMyVideo.ActualWidth / 250);
2336
-                PageShowNum = videoRow * videColumn;
2337
+                PageShowNum = (videoRow == 0 ? 1 : videoRow) * (videColumn == 0 ? 1 : videColumn);
2337
                 //获取总页数
2338
                 //获取总页数
2338
                 TotalPage = model_VideoList.Count / PageShowNum + (model_VideoList.Count % PageShowNum > 0 ? 1 : 0);
2339
                 TotalPage = model_VideoList.Count / PageShowNum + (model_VideoList.Count % PageShowNum > 0 ? 1 : 0);
2339
                 //如果当前页大于总页数 总页数为当前页
2340
                 //如果当前页大于总页数 总页数为当前页
2445
         }
2446
         }
2446
         #endregion
2447
         #endregion
2447
         #endregion
2448
         #endregion
2449
+
2448
         #region 录制窗口
2450
         #region 录制窗口
2449
         #region 变量
2451
         #region 变量
2450
         /// <summary>
2452
         /// <summary>
2504
         /// 录制计时
2506
         /// 录制计时
2505
         /// </summary>
2507
         /// </summary>
2506
         private DateTime SRTime = DateTime.Now;
2508
         private DateTime SRTime = DateTime.Now;
2509
+        /// <summary>
2510
+        /// 录制大小
2511
+        /// </summary>
2512
+        int gridActWidth = 1276;
2513
+        /// <summary>
2514
+        /// 录制大小
2515
+        /// </summary>
2516
+        int gridActHeight = 898;
2517
+        
2507
         #endregion
2518
         #endregion
2508
 
2519
 
2509
         #region 录屏
2520
         #region 录屏
2800
                     //blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
2811
                     //blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
2801
                     #endregion
2812
                     #endregion
2802
 
2813
 
2814
+                    #region 设置录制大小
2815
+                    //gridActWidth = (int)GridMain.ActualWidth==0?1276: (int)GridMain.ActualWidth;
2816
+                    //gridActHeight = (int)GridMain.ActualHeight==0?898: (int)GridMain.ActualHeight;
2817
+                    gridActWidth = 1276;
2818
+                    gridActHeight = 898;
2819
+                    #endregion
2820
+
2803
                     #region 录像倒计时
2821
                     #region 录像倒计时
2804
                     if (APP.W_CountdownWindow == null)
2822
                     if (APP.W_CountdownWindow == null)
2805
                     {
2823
                     {
2825
                     //};//设置执行一次(false)还是一直执行(true)
2843
                     //};//设置执行一次(false)还是一直执行(true)
2826
                     //timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
2844
                     //timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
2827
                     //timer.Enabled = true; //启动计时器
2845
                     //timer.Enabled = true; //启动计时器
2846
+
2828
                 }
2847
                 }
2829
 
2848
 
2830
                 //继续录制
2849
                 //继续录制
3072
                     FileToolsCommon.CreateDirectory(ThumbnailPath);
3091
                     FileToolsCommon.CreateDirectory(ThumbnailPath);
3073
                     //缩略图存储位置
3092
                     //缩略图存储位置
3074
                     string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileName(VideoSavePathName).Replace(".", "") + ".JPG";
3093
                     string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileName(VideoSavePathName).Replace(".", "") + ".JPG";
3075
-                    int gridActWidth = (int)GridMain.ActualWidth;
3076
-                    int gridActHeight = (int)GridMain.ActualHeight;
3077
                     APP.FFmpeg.StopFFmpeg(AudioPathName);
3094
                     APP.FFmpeg.StopFFmpeg(AudioPathName);
3078
                     new Thread(new ThreadStart(new Action(() =>
3095
                     new Thread(new ThreadStart(new Action(() =>
3079
                     {
3096
                     {
3149
                         //生成缩略图
3166
                         //生成缩略图
3150
                         bool ThuRes = APP.FFmpeg.GenerateThumbnails(VideoSynthesisPathName, ThumbnailPathName,200,130);
3167
                         bool ThuRes = APP.FFmpeg.GenerateThumbnails(VideoSynthesisPathName, ThumbnailPathName,200,130);
3151
                         Thread.Sleep(500);
3168
                         Thread.Sleep(500);
3152
-                        int imgW = (int)GridMain.ActualWidth + (((int)GridMain.ActualWidth) % 2 > 0 ? 1 : 0);
3153
-                        int imgH = (int)GridMain.ActualHeight + (((int)GridMain.ActualHeight) % 2 > 0 ? 1 : 0);
3154
                         //if (ThuRes)
3169
                         //if (ThuRes)
3155
                         //{
3170
                         //{
3156
                         //    Bitmap bmp = ImageHelper.ReadBitmapFile(ThumbnailPathName);
3171
                         //    Bitmap bmp = ImageHelper.ReadBitmapFile(ThumbnailPathName);
3161
                         //    }
3176
                         //    }
3162
                         //}
3177
                         //}
3163
 
3178
 
3164
-                        APP.FFmpeg.VideoTranscode(VideoSynthesisPathName, VideoSavePathName, imgW, imgH);
3179
+                        APP.FFmpeg.VideoTranscode(VideoSynthesisPathName, VideoSavePathName, gridActWidth, gridActHeight);
3165
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
3180
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
3166
                         VideoInfo.IsUpload = false;
3181
                         VideoInfo.IsUpload = false;
3167
                         VideoInfo.Uploaded = 0;
3182
                         VideoInfo.Uploaded = 0;

Loading…
Cancel
Save