nReco.Video Converter ffMpeg Error - ffmpeg

I am using Nreco Video Converter for take video thumbnail on my MVC project. App is working correctly on local but it shows error on live host
Error is
Access to the path 'C:\Inetpub\vhosts********\httpdocs\bin\ffmpeg.exe' is denied.
I did search this file in my code and host bin folder but I can't found. NReco's site says
Simple and easy to use video conversion .NET library: all you need is one assembly (FFMpeg is embedded)
There is no ffmpeg.exe file in local and host bin folder or anywhere.
How can i fix this?
Thanks.

VideoConverter is a .net wrapper for ffmpeg tool (I'm an author of this library) and ffmpeg.exe is extracted into app bin folder (default location) on first use. On your live host asp.net process cannot write to app bin folder; this may be fixed by specifying another location, for example:
var ffmpeg = new FFMpegConverter();
ffmpeg.FFMpegToolPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data");

Related

Open HTML in chrome from command line using app flag

(Before downvote im aware how to do this using code thats inline to this command but not how to do it using a file that uses the --app="data:text/html,<sometags></sometags>)
How would I open a local html (mar.html) file using this command
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app=
Specifically, the issue is my lack of familiarity with the --app flag
I tried
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app="mar.html"
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app="file:///mar.html"
Both don't work.
Giving me the error
Your file was not found
It may have been moved or deleted.
ERR_FILE_NOT_FOUND
You almost got it. The file descriptor path must be absolute and encoded.
Encoding the path correctly with cli tools like "urlencode"(gridsite-clients) did not work for me.
If you have NodeJS installed and would use a linux machine, you could use this command.
chromium --app=`node -e "console.log('file://'+encodeURI(process.argv[1]))" "$(realpath "/path/of/your/file.html")"`
This works also fine with relative paths.
For windows you have to rewrite this yourself.

Packaging mp3 files into Qt app

Since I found mp3 files can't be retrieved by QMediaPlayer from resource, I figure it out to use them as local file. I use this cmd with a little modification to copy files into installation directory:
copydata.commands = $(COPY_DIR) $$PWD/resources/sound $$OUT_PWD/HomeControl.app/Contents/MacOS
first.depends = $(first) copydata
export(first.depends)
export(copydata.commands)
QMAKE_EXTRA_TARGETS += first copydata
So those files existed in the /HomeControl.app/Contents/MacOS/sound. From Qt Creator the app plays the mp3 perfectly, but if executed from the build directory it doesn't play the mp3 at all! Really don't know why.
arm away btn clicked
current media: "file:///Dev/Qt_Sample/build-test_widgets-Desktop_Qt_5_3_0_clang_64bit-Debug/HomeControl.app/Contents/MacOS/sound/System_Arm_Away.mp3"
disarm stay btn clicked
current media: "file:///Dev/Qt_Sample/build-test_widgets-Desktop_Qt_5_3_0_clang_64bit-Debug/HomeControl.app/Contents/MacOS/sound/System_Disarmed.mp3"
Is there any difference from executing in the Qt creator & directly from the App? Like debug mode or what?
Or is there other ways to correctly deploy mp3 files into the bundle?
This is how I build in resources for OS X bundles:
mac {
Resources.files = dirInTheProjectDirectory
Resources.path = Contents/MacOS
QMAKE_BUNDLE_DATA += Resources
}
You can call Resources whatever you fancy.
That copies them to Contents/MacOS/dirInTheProjectDirectory. You can then access them with QDir(QCoreApplication::applicationDirPath()+"/dirInTheProjectDirectory/");
The likely problem is when you're accessing them in your code you're pointing to the path in the build directory, and not the path that's within your bundle.
Here's my final solution. Thank you #nicholas-smith.
In the .pro file:
# deploy with mp3 folder
mac {
Resources.files = ./resources/sound
Resources.path = Contents/MacOS
QMAKE_BUNDLE_DATA += Resources
}
Then accessing those file with:
// pass the path of mp3 to the QMediaPlayer
playAudio(QCoreApplication::applicationDirPath()
+ "/sound/System_Disarmed.mp3");
From log it shows:
arm away btn clicked
current media: "file:///Dev/Qt_Sample/build-test_widgets-Desktop_Qt_5_3_0_clang_64bit-Debug/HomeControl.app/Contents/MacOS/sound/System_Arm_Away.mp3"

Deploying custom resource through DSC PullServer fails to extract the module

I've set up a DSC PullServer on Server 2008 R2 and I've run into an issue deploying a custom module. The module on the PullServer is in C:\Program Files\WindowsPowerShell\Modules\NTFSPermission, I've zipped everything using Windows Explorer (and 7-zip) and placed the zip in C:\Program Files\WindowsPowerShell\DscService\Modules\NTFSPermission_1.0.zip, I create a checksum using NEW-DSCChecksum for the zip file and I've got Import-DSCResource NTFSPermission in my node configuration. When I run the Invoke-CimMethod to push the config to a node it errors out with:
Invoke-CimMethod : Failed to extract the module from zip file
C:\Windows\TEMP\\635291179507191263\NTFSPermission_1.0.zip downloaded by Download
Manager WebDownloadManager.
The node logs a 4104 error in the event viewer reading:
This event indicates that failure happens when LCM is trying to get the configuration from pull server using download manager WebDownloadManager. ErrorId is 0x1. ErrorDetail is Failed to extract the module from zip file C:\Windows\TEMP\\635291179507191263\NTFSPermission_1.0.zip downloaded by Download Manager WebDownloadManager.
Has anyone else run into this? I'm not sure if there's a config file somewhere that is literally piping in an extra backslash and causing an invalid download/extraction path or if there is something wrong with the zipped module. If I move the module over manually the config will be pushed and apply successfully, which leads me to believe it's not the module.
There is a known issue with extracting zip files created using .NET compression class in 4.5. The workaround is to use the shell method of compressing files. That is, send to compressed archive option in right-click context menu or using Shell COM object.
I tested one of the modules from the DSC Resource Kit and it extracted with no problems on the desired node. I tracked the problem down to the psd file that the author created for their DSC-Resource. I updated the CLRVersion to require 4.0 and removed RequiredModules, RequiredAssemblies, ScriptsToProcess, TypesToProcess,FormatsToProcess and NestedModules (all were empty values anyway), pushed the config without the workaround and it downloaded and extracted the resource.

How to stream MP4 files from subdirectories with Flowplayer?

I am using Wowza Media Server to enable streaming of MP4 files and as video player I use Flowplayer.
To get some structure for my content I use sub directories within the configured StorageDir for my Wowza application.
The problem I have is that no matter what URL-format I use, Wowza keep looking for the file in the root storage directory.
I've tried using the URL format specified by Wowza here, but with no luck:
rtmp://[wowza-ip-address]/myapp/_definst_/mp4:mysubdirectory/sample.mp4
I also tried everything suggested in posts on the Wowza forum:
https://www.wowza.com/community/questions/327/mp4-streaming-from-application-sub-directory.html
https://www.wowza.com/community/questions/215/subfolders-in-application-content-folder.html
But Wowza keeps looking in the root storage directory, throwing exceptions like these:
404 b0c9be70-a33c-41ce-9692-199e3a1caccf.mp4
open: java.io.FileNotFoundException:
C:\Program Files (x86)\Wowza Media Systems\Wowza Media Server 3.6.2\content\b0c9be70-a33c-41ce-9692-199e3a1caccf.mp4.flv
(The system cannot find the file specified)
Somehow Wowza thinks it should look for an FLV file in the root storage directory, even though the URL specify that it is an MP4 file in a subdirectory. Why is that?
After spending hours looking into this, I finally found this post on the Wowza forum.
The problem:
Apparently there is an issue with some flash-based video players (like Flowplayer that I use), that accept a single string for the RTMP connection and stream name. Some of these players do not separate the RTMP connection and stream name properly when using sub directories.
When breaking this URL apart:
rtmp://[wowza-address]:1935/vod/_definst_/mp4:subfolder/sample.mp4
The player will use this as the RTMP connection:
rtmp://[wowza-address]:1935/vod/_definst_/mp4:subfolder
The player will then try to play sample.mp4 instead of subfolder/sample.mp4 which will fail.
The solution:
To remedy this problem, there is a plugin for Wowza that fixes the URL, available for download here:
http://www.wowzamedia.com/downloads/forums/collection/WowzaServerAddOnCollection.zip
Unzip the package and copy the JAR file into your Wowza /libs directory, then add this to your /conf/[app-name]/Application.xml configuration file:
<Module>
<Name>ModuleFixStreamPath</Name>
<Description>ModuleFixStreamPath</Description>
<Class>com.wowza.wms.plugin.collection.module.ModuleFixStreamPath</Class>
</Module>
Doing so got it all working for me!
I fix this problem by creating symlinks using PHP code before output video component template
$relativeVideoLink = str_replace("/", "__", $videoFileRelativePath);
if (!file_exists($wowzaDir . $relativeVideoLink)) {
symlink($wowzaDir . $videoFileRelativePath, $wowzaDir . $relativeVideoLink);
}
After creating symlink i put it to tag
<video src="http://00.00.00.00:1935/vod/mp4:<?=$relativeVideoLink?>/manifest.mpd"></video>

Copy file from current folder to folder where .exe installing by Installscript project

I am using InstallShield 2011 for creating installscript project,Now the problem is i want to copy some ini file from the folder to the path where my .exe will installed.
Here is the scenario--
I will give our client to a Folder which contain 2 things
Setup.exe
ini folder which contain .ini files.
Now I want that when I execute the setup.exe all the .ini file will copy on the location where the setup is install.
I am using now--
CopyFile (PACKAGE_LOCATION ^ "ini\\*.ini" , szSDKDirectory );
But when I debug PACKAGE_LOCATION contain null string.
If your media type is CD-ROM, you can use SRCDIR.
PACKAGE_LOCATION just for Network Image media type.
If your media type is EXE you could have also used SETUPEXEDIR

Resources