Forum Discussion
- Hi Deva,
You can find all the specified attributes of a video file in its Windows Explorer's Properties dialog. I wrote a sample script that gets this data from the file. I use the GetDetailsOf method for this.
Here is the script:
//JScript
function getMediaInfo()
{
var objShell = new ActiveXObject("shell.application");
var objFolder = objShell.NameSpace("<FolderName>");
if (objFolder != null)
{
var objFolderItem = objFolder.ParseName("<FileName>");
if (objFolderItem != null)
{
var objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 2));
Log.Message("Item Type: " + objInfo);
objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 1));
Log.Message("Size: " + objInfo);
objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 27));
Log.Message("Length: " + objInfo);
objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 300));
Log.Message("Frame Width: " + objInfo);
objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 298));
Log.Message("Frame Height: " + objInfo);
objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 299));
Log.Message("Frame Rate: " + objInfo);
objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 297));
Log.Message("Data Rate: " + objInfo);
objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 302));
Log.Message("Total Bitrate: " + objInfo);
objInfo = aqString.Trim(objFolder.GetDetailsOf(objFolderItem, 28));
Log.Message("Bit Rate: " + objInfo);
}
}
}
- Hi Deva,
See my comments:
>>- Download the video
You can use the sample from our How To tutorial to download the media file: "Download a file from the Internet"
>>- Check that video plays as source video without any noise or any
Sounds like it should be an intelligence comparison that should be done by a human. I don't think that any third-party video comparison tool will give 100% results.
>>- Check for all other parmeters like quality, pixel, etc.. is same as source video.
It looks like this is what the sample above does.
- kirk_bottomleyContributor
Sounds like it should be an intelligence comparison that should be done by a human.
It would be nice to have metrics that could measure "smoothness" and the like, but you're right. That won't likely be automatable until true AI is on tap.
That being said, is there any way to log or capture video for the person who is reviewing the test log to evaluate?
- AlexKaras
Champion Level 3
Hi,
Not been actively involved in this type of testing, so just a quick idea that came:
It might be acceptable for the quick smoke verification to get several frames at the known moments of time (say, every minute from the video start) and compare then the captured frames with the expected ones.
Obviously, the result depends on at least the used video codec.
Several links found by quick googling that might appear to be relevant:
http://www.codeproject.com/Articles/13237/Extract-Frames-from-Video-Files
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_22624463.html
- karkadilValued ContributorIn general, I wouldn't recommend automating testing of videos. It will take so much effort and will be so unstable that you'll get tired maintaining your scripts. It doesn't worth it.
- DevaVContributorThanks for your suggestion.
But my requirement is to test videos through automation scripts, so could you please suggest if test complete tool supports it. - DevaVContributorHi Tanya,
Thanks for your code details to read the video file details.
The requirement is little tweaky like.
- Download the video
- Check that video plays as source video without any noise or any
- Check for all other parmeters like quality, pixel, etc.. is same as source video.