How to Download Video Using FFmpeg From SharePoint
SharePoint is widely used for storing and sharing video content across organizations — training recordings, meeting replays, product demos, and more. If you've ever needed to capture that video locally using FFmpeg, you've probably discovered it's not as straightforward as pointing FFmpeg at a URL and hitting enter. Here's what's actually happening under the hood, and what you need to know before you try.
Why SharePoint Video Downloads Aren't Simple
SharePoint doesn't serve video files like a traditional web server. Videos hosted in SharePoint — especially those played through Microsoft Stream (integrated into SharePoint since 2023) — are typically delivered via adaptive bitrate streaming, most commonly using HLS (HTTP Live Streaming) or DASH (Dynamic Adaptive Streaming over HTTP). This means the video isn't a single .mp4 file at a clean URL. It's a collection of small segments stitched together by a manifest file.
On top of that, SharePoint access is gated behind OAuth 2.0 authentication. You can't just grab a URL from your browser and hand it to FFmpeg — the request will return an auth error or a login redirect instead of video data.
What FFmpeg Can and Can't Do Here
FFmpeg is exceptionally capable at handling HLS and DASH streams. Given the right manifest URL and valid authentication headers, it can download and remux a stream into a local file without re-encoding — which is fast and lossless in terms of quality.
What FFmpeg cannot do on its own:
- Log into SharePoint or handle browser-based authentication flows
- Extract the manifest URL from a SharePoint page automatically
- Refresh expired tokens mid-download
So your workflow has two distinct phases: getting authenticated access to the stream URL, then using FFmpeg to capture it.
Phase 1 — Getting the Stream URL and Auth Token
This is the harder part, and it varies depending on your SharePoint environment.
Method A: Browser Developer Tools
- Open the video in SharePoint in your browser and start playback
- Open DevTools (F12) → go to the Network tab
- Filter requests by Media or search for .m3u8 or .mpd
- Look for a manifest request — the URL will often contain parameters like manifest or end in .m3u8
- Copy the full URL including query string parameters (these often include temporary auth tokens)
- Also copy the request headers, especially Authorization, Cookie, and User-Agent
Method B: SharePoint/Stream API
If you have developer access or admin permissions, Microsoft Graph API can return direct stream URLs programmatically. This involves obtaining an access token via Azure AD, then calling the appropriate Graph endpoint for the video file or Stream resource. This approach is more robust for automation but requires app registration and permission scoping.
Phase 2 — Using FFmpeg to Download the Stream 🎬
Once you have the manifest URL and valid headers, FFmpeg can take it from there.
Basic command structure: