包含视频的Powerpoint演示文稿,不会从Windows任务调度程序转换为C#中的MP4视频 [英] Powerpoint presentation containing video not converting to MP4 video in C# from windows task scheduler

查看:96
本文介绍了包含视频的Powerpoint演示文稿,不会从Windows任务调度程序转换为C#中的MP4视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have Power Point Presentation file containing embeded video. In C#, I written logic to convert the PPT file into MP4 video.




Microsoft.Office.Interop.PowerPoint.Presentation objTempPresentation = appPpt.Presentations.Open(FileName, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse);  
objTempPresentation.CreateVideo(Mp4VideoName, false, 5, 480, 25, 75);  
while (objTempPresentation.CreateVideoStatus == PpMediaTaskStatus.ppMediaTaskStatusInProgress)  
{  
   Thread.Sleep(100);  
}  




It is working fine.
Now I want to execute that exe in windows task scheduler so that it will convert the Uploaded PPT/PPTX files to video on regular interval.

For the windows task scheduler the property is selected as "Run only when user is logged on."

It is working fine, able to convert PPT/PPTX files to MP4 video of any size.

The Issue is:-

This is done on "Azure Server", so I want this exe must be executed if user is logged on or not.

So for that I have set windows task scheduler property as "Run whether user is logged on or not"And Now the video is not generated correctly. It is creating only 5 seconds video of still image.

I am not sure why is this happening. Why video are not generating of full length when user is not logged in on Azure server.

Please let me know if any one have any idea about this. Thanks in advance.





我的尝试:



我将此调度程序运行为仅在用户登录时运行。工作正常。



我想,在其他模式下,当用户未登录时,将PPT / PPTX视频转换为Mp4视频所需的一些服务未运行。



What I have tried:

I run this scheduler as "Run only when user is logged on". Its working fine.

I guess, in other mode the some services which are required to convert PPT/PPTX video to Mp4 video are not running while user is not logged in.

推荐答案

问题是你正在使用Pointpoint Interop。除非你在安装了PowerPoint的虚拟机中运行它,否则它将不起作用。



此外,在非用户交互式会话中运行时不支持Office应用程序,如Windows Server,Web应用程序或作为登录用户以外的任何其他方式运行的预定作业。
The problem is that you're using Pointpoint Interop. Unless you have this running in a virtual machine with PowerPoint installed it's not going to work.

Also, Office applications are NOT supported when running in a non-user interactive session, like a Windows Server, web application or a scheduled job running as anything other than a logged in user.


这篇关于包含视频的Powerpoint演示文稿,不会从Windows任务调度程序转换为C#中的MP4视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆