Grab sungle image ==> where is the generated file ?

9 views
Skip to first unread message

OliCauss

unread,
May 4, 2011, 5:43:13 AM5/4/11
to mediasoftpro
Hi,
i've copied and used successfully the code to get info about a MP4
file.(codec, duration...)
everything works fine (so i guess the basic parameters are ok (ffmpeg
path...)

when i try my next task (grab thumbnail) using your sample code :

_mhandler.ImageName = "THUMB_MediaSoft.jpg"
_mhandler.Thumb_Start_Position = 10
_mhandler.Image_Format = "jpg"
_mhandler.VCodec="image2" ' i really dont understand this line
_mhandler.Width = 160
_mhandler.Height = 120
_mhandler.No_Of_Thumbs = 1

' start grabbing single thumb from video
Dim info2 As VideoInfo = _mhandler.Grab_Thumb()
If (info2.ErrorCode = 0 Then
' print out success
End If

The code works fine, no error is produced... but no output thumbnail
jpg is ever produced,not in outputpath which is the same then
inputpath (and thus exists), and nowhere else.

what could be the cause of the problem ? I am using the Trial version.

Thanks for your help

Olivier

shane

unread,
May 6, 2011, 2:03:09 AM5/6/11
to mediasoftpro
Hi,

Before grabbing thumbs reset all media handler pro settings if used
for other purposes e.g encoding video. Sample code for grabbing single
thumbs shown below.

_mhandler.FileName = "sample.mp4";
_mhandler.ImageName = "sample.jpg";
_mhandler.Frame_Time = "10";
////OR
_mhandler.Thumb_Start_Position = 10;
_mhandler.Image_Format = "jpg";
_mhandler.VCodec = "image2"; // optional but recommended
_mhandler.Width = 160;
_mhandler.Height = 120;
VideoInfo info = _mhandler.Grab_Thumb();
if (info.ErrorCode > 0)
{
Response.Write("Error occured while grabbing thumbs from
video");
}

Check sample and post your result.
Reply all
Reply to author
Forward
0 new messages