Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, July 8, 2013 8:07:37 AM(UTC)
Tony Chick

Groups: Registered
Posts: 6


I'm using the eval version of Leadtools MM v.18 and successfully transcoding video to H264 using ConvertCtrl from a c# .net app. I don't seem to be able to get SaveStillBitmap to create a viewable JPG image though, it will save a BMP however. If I specify JPEGnnn (any of the 3 options), it creates a file with a .jpg extension that has size but cannot be displayed by Windows or any viewer app. e.g.

public bool TranscodeVideo(String sourceFile, String targetPath) {
try {
// H264 video in ISO (mp4) format with AAC audio
Converter.VideoCompressors.H264.Selected = true;
Converter.AudioCompressors.AAC.Selected = true;
Converter.TargetFormat = TargetFormatType.ISO;

Converter.EnableStillCapture = true;
Converter.StillCaptureLimit = 1000;

Converter.SourceFile = sourceFile;
Converter.TargetFile = Path.Combine(targetPath, Path.GetFileNameWithoutExtension(sourceFile) + ".mp4");

Converter.StartConvert();

Converter.SaveStillBitmap(Path.Combine(targetPath, Path.GetFileNameWithoutExtension(sourceFile) + ".jpg"), StillFormatType.JPEG411, 0, 0, -1); // doesn't work!
Converter.SaveStillBitmap(Path.Combine(targetPath, Path.GetFileNameWithoutExtension(sourceFile) + ".bmp"), StillFormatType.BMP, 0, 0, -1); // works!
return true;
}
catch (Exception e) {
return false;
}
}

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, July 8, 2013 2:23:05 PM(UTC)
Tony Chick

Groups: Registered
Posts: 6


Never mind, I found it. The example in the help showed 0 as the quality value, but the description if you click on "compression quality factors" shows only 2-255 as valid. I changed it to 2 and it works.
 
#3 Posted : Tuesday, July 16, 2013 1:20:07 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


When you pass 0 as quality factor for JPEG images, this means that you will save it as lossless JPEG. And not all applications support Lossless JPEG. Before saving a file using Lossless JPEG, make sure your reader supports it.

And Windows photo viewer does NOT support Lossless JPEG.
You can try to open the lossless images using LEADTOOLS SDK or any viewer that supports lossless JPEG.
For example try loading the image using our Main Imaging demo that is shipped with our toolkit and see that it displays correctly.

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.135 seconds.