Categories: Development

Downloading Reddit video with FFmpeg

v.redd.it is Reddits native video uploader and player, with the free Reddit API endpoint and FFmpeg you can download v.redd.it videos easily.

If you prefer a more automated web system check out the PHP class and functions i built here. Not only does it download the video it can also fetch details and information.

Find direct video link

Start by having the Reddit post url that has a v.redd.it video and then get an API response for the post by putting .json at the end of the url.

An example being for the post

https://www.reddit.com/r/funny/comments/d8qo81/baby_crocodiles_sound_like_theyre_shooting_laser/

into

https://www.reddit.com/r/funny/comments/d8qo81/baby_crocodiles_sound_like_theyre_shooting_laser/.json

This will return one seemingly big piece of data with lots of information about the post.

A method to get the source quality with audio is to find the .mpd extension. This exists at dash_url. Using the example post above the .mpd link was https://v.redd.it/enxxsuo5xko31/DASHPlaylist.mpd.

.mpd is a DASH file or simply put a directory to a video file but it directs to different qualities, audios etc.

You can see this in action by running: ffmpeg -i https://v.redd.it/enxxsuo5xko31/DASHPlaylist.mpd It will return a bunch of information and different “streams”.

Download

To download the video all you have to do now is put this into a simple FFmpeg download command

ffmpeg -i https://v.redd.it/enxxsuo5xko31/DASHPlaylist.mpd -c copy saveasvid.mp4

The Reddit video will be downloaded at source quality hence the -c copy command and saved as saveasvid.mp4.

Read more about FFmpeg here.

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago