Skip to content

Instantly share code, notes, and snippets.

@mfd
Last active April 16, 2025 22:10
Show Gist options
  • Save mfd/c990a01d626847a6d7e823dceca598e1 to your computer and use it in GitHub Desktop.
Save mfd/c990a01d626847a6d7e823dceca598e1 to your computer and use it in GitHub Desktop.
Download any video from Microsoft Teams, SharePoint and OneDrive
2teams() {
NOW=$(date +"%Y-%m-%d_%H%M")
if [ ! -z $2 ] ; then
echo $NOW"_"$2.mp4
ffmpeg -i $1 -codec copy $NOW"_"$2.mp4
else
echo $NOW"_teamsvid".mp4
ffmpeg -i $1 -codec copy $NOW"_teamsvideo".mp4
fi
}

Download any video from Microsoft Teams, SharePoint and OneDrive

Videos like

- https://{ORGID}.sharepoint.com/personal/{USERID}/_layouts/15/stream.aspx?id={VIDEOID}%2Emp4&ga=1
- https://{ORGID}.sharepoint.com/:v:/p/{USERID}/{VIDEOID}
  1. Run video from SharePoint corporate account or OneDrive,
  2. In Chrome open Web inspector and in Network filter by videomanifest
  3. Copy this url
  4. Run ffmpeg -i "%URL%" -codec copy outputvideo.mp4

chrome

@ali-han
Copy link

ali-han commented Apr 2, 2025

I created an extension (with ChatGPT) that generates an FFmpeg command for downloading videos from SharePoint. It also allows you to download the transcription file. You can try it out here: https://github.com/MexxDirkx/SharePoint-Video-Downloader-Extension.

Working perfectly bro, thanks

@Jxck-S
Copy link

Jxck-S commented Apr 16, 2025

For anyone using ffmepg by default ffmpeg automatically picks the first or lowest index, stream. SharePoint has the lowest quality streams being the first index and the highest quality streams are the higher indexes.

If you'd like higher quality streams use ffprobe then ffmpeg.

ffprobe -i "VIDEO_MANIFEST_URL" -show_streams

Identify the best video and audio stream indexes

then
ffmpeg -i "VIDEO_MANIFEST_URL_HERE" -map 0:3 -map 0:7 -c copy output.mp4
(Replace 3 and 7 with your desired video and audio stream indexes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment