# Postprocessing

Not all content on the Internet is in the format that you want. For example, some YouTube videos come in the WebM format. QuickTime Player or your iPhone, however, won’t be able to play this format. Or perhaps you want to download something as audio-only. For all these scenarios (and many more), Downie includes postprocessing, which allows you to apply post-download operations on the downloaded files.

Downie comes with the following postprocessing options:

- None - This will leave the file as-is with no further postprocessing is done.

  > Note that Downie may perform some postprocessing on its own even if this option is selected. For more information see below.

- MP4 - The downloaded file will be converted to MP4 (H.264 video format) which is playable in QuickTime Player and on most current mobile devices. Files already downloaded as MP4 will be left intact.
- Audio Only - Only audio will be extracted from the file; or in some cases, if available, an audio-only track will be downloaded. By default, the audio file is converted to MP3, which can be turned off in preferences.
- Permute - More advanced users might want to have more control over the target format that Downie converts the video to. For these users, we’ve added integration with Permute - our media conversion utility.
- Custom - for even more control over the postprocessing actions, you can create your own custom postprocessing as a shell script. This can e.g. upload the file to your cloud, perform actions based on where the file comes from, etc. Please keep in mind that the script runs inside Downie’s sandbox and you won’t be able to access some OS features, such as disk management, etc. If the task takes more time to be completed, consider reporting progress to Downie in form of standard output `downie_progress(0.75)` or `downie_progress(0.75, Uploading...)` if you want to be able to see the status string.

There are several ways to change postprocessing.

Globally:

- in `Preferences > Postprocessing`
- via the `Settings` menu in the menu bar
- via keyboard shortcuts equivalent to the commands in the afore-mentioned menu

Per-download:

- each downloads has a popup button with postprocessing options
- using the browser extensions - right-click anywhere on the webpage and select the option to send the current link to Downie with postprocessing set to the desired option

## Postprocessing even with the option None selected

There are downloads that require postprocessing the downloaded video even when the postprocessing option is set to None. In general, there are two cases where this needs to be done:

- YouTube often splits the video into separate video and audio files - the conversion is then necessary to put them together. Without it you’d end up with two files instead of one - one with just the sound, one just with the picture.
- Similarly, many sites use `M3U8` (HLS), `DASH` or `F4M` (HDS) manifests, which describe videos that are split into dozens, sometimes even hundreds of little files called fragments, each containing a few seconds of the video. These chunks need to be put together using a conversion. There is no way around it, not doing so would result in a file unreadable by most video players out there.

## Postprocessing and CPU usage

During the postprocessing, you may notice that the fans of your computer go off and the Activity Monitor may report e.g. 700% CPU usage. This is absolutely normal and there is nothing to worry about. Video conversion is a very CPU-intensive task. Just think about it - with a 720p video that’s 1 hour long, the computer needs to process about 80 billion pixels! `(1280 x 720) x 24 frames per second x 3600 seconds in one hour` Moreover, with videos, it’s not as simple as just writing one image after another - it would be highly inefficient. That’s why modern formats look for pixel movements. With 80 billion pixels, that’s a lot of detection!

Computers are, however, built to work - the CPU is built to withstand long periods of time working at full speed without any damage. Moreover, macOS monitors the CPU temperature as well and modifies the CPU speed and fan speeds accordingly. If the CPU temperature were to climb to dangerous levels in case of a fan failure or if the fan grill was full of dust or lint, the computer will shut down before any damage can be done. If you believe that your computer is overheating and you are experiencing it shutting down during the conversion, please visit your Apple Store and ask them to clean your Mac’s fans and check them for any damage.

If you experience the system being unresponsive and it prevents you from doing your work, you can pause the conversion in the main window by clicking on the pause button on the row with the download. In any case, please contact our support - we will ask you for additional information about your system.