Hi,
Hi Sudhir,
Thanks for your interest in Aspose.Slides.
I have observed the requirements shared by you and like to share that Aspose.Slides fulfill all the requirements shared by you except support of creating video for animated slide. Please try using the following sample code on your end to extract the audio and video data from presentation slides.
public static void ExtractVideo()
{
String path = @"D:\Aspose Data";
Presentation template = new Presentation(path + “VideoSample.pptx”);
foreach (ISlide slide in template.Slides)
{
foreach (IShape shape in template.Slides[0].Shapes)
{
if (shape is VideoFrame)
{
IVideoFrame vf = shape as IVideoFrame;
String type = vf.EmbeddedVideo.ContentType;
int ss = type.LastIndexOf(‘-’);
type = type.Remove(0, type.LastIndexOf(‘-’) + 1);
Byte[] buffer = vf.EmbeddedVideo.BinaryData;
using (FileStream stream = new FileStream(path + “NewVideo.” + type, FileMode.Create, FileAccess.Write, FileShare.Read))
{ stream.Write(buffer, 0, buffer.Length); }
}
}
}
}
public static void ExtractAudio()
{
String path = @"D:\Aspose Data";
Presentation template = new Presentation(path + “AudioSample.pptx”);
foreach (ISlide slide in template.Slides)
{
foreach (IShape shape in template.Slides[0].Shapes)
{
if (shape is VideoFrame)
{
IAudioFrame af = shape as IAudioFrame;
String type = af.EmbeddedAudio.ContentType;
int ss = type.LastIndexOf(‘-’);
type = type.Remove(0, type.LastIndexOf(‘-’) + 1);
Byte[] buffer = af.EmbeddedAudio.BinaryData;
using (FileStream stream = new FileStream(path + “NewAudio.” + type, FileMode.Create, FileAccess.Write, FileShare.Read))
{ stream.Write(buffer, 0, buffer.Length); }
}
}
}
}
You can also generate the slide thumbnail by using the sample code given over this documentation link. I regret to share that the support for generating the video for animated slide is unavailable in Aspose.Slides. An issue with ID SLIDESNET-36753 has been created in our issue tracking system to further investigate the possibility of implementing the requested support. This thread has been linked with the issue so that you may be automatically notified once the support will be available.
Many Thanks,
Thank you very much for the sample code.
The issues you have found earlier (filed as SLIDESNET-36753) have been fixed in Aspose.Slides for .NET 22.11 (ZIP, MSI).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.