Repository: youtube-dl
Issue: FileNotFound after using FFmpegMerger
Labels: question

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions
- Search the bugtracker for similar questions: http://yt-dl.org/search-issues
- Finally, put x into all relevant boxes (like this [x])
-->

- [ x] I'm asking a question
- [ x] I've looked through the README and FAQ for similar questions
- [ x] I've searched the bugtracker for similar questions including closed ones


## Question

<!--
Ask your question in an arbitrary form. Please make sure it's worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient.
-->

I'm using youtube-dl for a python script to download video and audio, then merge them as a post process. The issue I'm encountering is a FileNotFoundError that occurs after a successful merge. Can someone help me troubleshoot the issue? It appears to merge the files as expected, then delete the two files that were merged, then attempt a merge on a file that was deleted.

Here's the full output of the error:
```[Reddit] llp4n1j69ir51: Downloading m3u8 information
[Reddit] llp4n1j69ir51: Downloading MPD manifest
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 24
[download] Destination: llp4n1j69ir51-llp4n1j69ir51.fhls-438.mp4
[download] 100% of 4.34MiB in 00:03
[download] Destination: llp4n1j69ir51-llp4n1j69ir51.fdash-audio_0_131726.m4a
[download] 100% of 2.41MiB in 00:00
[ffmpeg] Merging formats into "llp4n1j69ir51-llp4n1j69ir51.mp4"
Deleting original file llp4n1j69ir51-llp4n1j69ir51.fhls-438.mp4 (pass -k to keep)
Deleting original file llp4n1j69ir51-llp4n1j69ir51.fdash-audio_0_131726.m4a (pass -k to keep)
[ffmpeg] Merging formats into "llp4n1j69ir51-llp4n1j69ir51.mp4"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/code/download_videos/download_videos.py", line 60, in download_with_youtube_dl
    ydl.download([video[0]])
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2018, in download
    res = self.extract_info(
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 808, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 863, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 1644, in process_video_result
    self.process_info(new_info)
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2000, in process_info
    self.post_process(filename, info_dict)
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2065, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 523, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 209, in run_ffmpeg_multiple_files
    oldest_mtime = min(
  File "/usr/local/lib/python3.8/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 210, in <genexpr>
    os.stat(encodeFilename(path)).st_mtime for path in input_paths)
FileNotFoundError: [Errno 2] No such file or directory: 'llp4n1j69ir51-llp4n1j69ir51.fhls-438.mp4'
```

For reference, this is my code:

```
    def download_with_youtube_dl(self, video_data: list):

        os.chdir(self.video_directory)

        yt_dl_opts = {
            'format': 'bestvideo+bestaudio',
            'postprocessors': [{
                'key': 'FFmpegMerger',
            }]
        }

        for video in video_data:
            with YoutubeDL(yt_dl_opts) as ydl:
                ydl.download([video[0]])
```