3

I am trying to extract thumbnail from sharepoint 2013 video library. I found a link which can extract using ffmpeg. this is the link: [How can I save first frame of a video as image?

filename = "http://siteurl/" + items["FileRef"].ToString();

When i replaced the input file with sharepoint site url and video name then it does not produce any thumbnail. I also gives error on

ffmpeg.Start();
        ffmpeg.WaitForExit();
        ffmpeg.Close()

I would like to understand how make it work for http url. If it is not possible to use url in ffmpeg can anyone suggest another method to achieve thumbnail.(as i want the thumbnail to be set automatically using 1st frame from of video if it not set manually)

Community
  • 1
  • 1
user2240379
  • 71
  • 2
  • 11

1 Answers1

1

I tested below parameters they worked. to extract first frame from remote video.

ffmpeg -i "http://techslides.com/demos/sample-videos/small.mp4" -f image2 -vframes 1 "e:\images\01\image%03d.jpg"

to extract image from specific duration of the video (first frame maybe black) use the -ss parameter. -ss 00:00:02 means take image at 2th second. (more specific frame -ss 00:00:02.xxx xxx=0 to 999 milliseconds)

ffmpeg -ss 00:00:02 -i "http://techslides.com/demos/sample-videos/small.mp4" -f image2 -vframes 1 "e:\images\01\image%03d.jpg"

update the code How can I save first frame of a video as image? as your need.

Updates

Below commands failed with Invalid data found when processing input but you can find a solution to your question by trying -cookies or -headers parameters. When authentication is required -cookies or -headers arguments can be used as below. When you log in to server use Fiddler to get cookies and add them to ffmpeg -cookies or -headers parameters.

ffmpeg -cookies "path=/; domain=domainname.com; cookiesgoeshere\r\n" -i "video url goes here" -f image2 -vframes 1 "e:\image%03d.jpg"

or

ffmpeg -headers "Cookie: path=/; domain=domainname.com; cookiesgoeshere\r\n" -i "video url goes here" -f image2 -vframes 1 "e:\image%03d.jpg"

related topics

How to enable cookies in ffmpeg HLS - Stack Overflow

or Zeranoe FFmpeg - View topic - Custom http headers

another option is run ffmpeg in your web server

Community
  • 1
  • 1
khan
  • 4,479
  • 1
  • 15
  • 9
  • Hi, Thanks for the reply. I got the http running but only for anonymous sharepoint site access. If i use it with sharepoint site which needs sign in it doesn't produce the thumbnail. This is what I am doing.static string filename = "http://abc24:23478/FirstVideo%20list/Wildlife.wmv"; ffmpeg.StartInfo.Arguments = "-i " + filename + " -an -ss 00:00:01 " + output;ffmpeg.StartInfo.FileName = @"D:\Zeba\VideoThumbnail\ffmpeg.exe"; – user2240379 Jul 30 '14 at 09:46