Repository: yt-dlp
Issue: error in postprocessing when file extension missing
Labels: enhancement,core:post-processor

### Checklist

- [X] I'm reporting a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2021.11.10.1**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Description

postprocessing doesn't work when specifying an output filename which does not include a file extension. It appears ffmpeg is unable to work out what output file type to use. Could yt-dlp be modified to pass the output file type to ffmpeg for the postprocessing stage?

### Verbose log

```shell
[debug] Command-line config: ['-Uv', '--sponsorblock-remove', 'sponsor', '-f', 'worstaudio', '-o', 'blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2', 'https://www.youtube.com/watch?v=LP5z2Fkk95M']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2021.11.10.1
[debug] Lazy loading extractors is disabled
[debug] Python version 3.10.0 (CPython 64bit) - Linux-5.15.4-201.fc35.x86_64-x86_64-with-glibc2.34
[debug] exe versions: ffmpeg 4.4.1 (setts), ffprobe 4.4.1
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
yt-dlp is up to date (2021.11.10.1)
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=LP5z2Fkk95M
[youtube] LP5z2Fkk95M: Downloading webpage
[youtube] LP5z2Fkk95M: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[SponsorBlock] Fetching SponsorBlock segments
[debug] SponsorBlock query: https://sponsor.ajay.app/api/skipSegments/9ff4?service=YouTube&categories=%5B%22sponsor%22%5D
[SponsorBlock] Found 2 segments in the SponsorBlock database
[info] LP5z2Fkk95M: Downloading 1 format(s): 139
[debug] Invoking downloader on "https://r1---sn-n02xgavv250-ntqe.googlevideo.com/videoplayback?expire=1638332767&ei=_6SmYfvvKrLB1AaQm6mACg&ip=2401%3Ad002%3A4b02%3Ae00%3A%3A36b&id=o-AK-qc9cp_sJ_q2xtyETEyKuyHzKz158AamWWcip7aAu_&itag=139&source=youtube&requiressl=yes&mh=AV&mm=31%2C29&mn=sn-n02xgavv250-ntqe%2Csn-hxa7zn7s&ms=au%2Crdu&mv=m&mvi=1&pcm2cms=yes&pl=40&initcwndbps=1613750&vprv=1&mime=audio%2Fmp4&gir=yes&clen=35119145&dur=5759.245&lmt=1637800674427396&mt=1638310874&fvip=1&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&txp=6311224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgZX4Whrzjusx-uFWcH5jwjcNWZGZheA-8L1QQHnN2H5QCIQDoSa06Rz667vEQHB_mpr-6QwuZX2a2aDIIbaaDhNV19w%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgTiT81Q-PWwU5kllLlKXuXSQoleI4wTjOyiCaAQ9MI80CIAd5QLNn1Ls30ehyim-ebZzwVfwI8ztadRKs63eUPp5j"
[download] Destination: blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2
[download] 100% of 33.49MiB in 00:13                 
[FixupM4a] Correcting container of "blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2 -c copy -map 0 -dn -f mp4 file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp
[debug] ffprobe command line: ffprobe -hide_banner -show_format -show_streams -print_format json file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2
[ModifyChapters] Removing chapters from blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2
[debug] Writing concat spec to blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp.concat
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -hide_banner -nostdin -f concat -safe 0 -i file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp.concat -c copy file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp
[debug] Input #0, concat, from 'file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp.concat':
  Duration: N/A, start: 0.000000, bitrate: 48 kb/s
  Stream #0:0(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 48 kb/s
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.
      vendor_id       : [0][0][0][0]
[NULL @ 0x5631f2e52080] Unable to find a suitable output format for 'file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp'
file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp: Invalid argument
ERROR: Postprocessing: file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp: Invalid argument
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 2919, in process_info
    info_dict = self.post_process(dl_filename, info_dict, files_to_move)
  File "/usr/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 3078, in post_process
    info = self.run_pp(pp, info)
  File "/usr/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 3021, in run_pp
    files_to_delete, infodict = pp.run(infodict)
  File "/usr/lib/python3.10/site-packages/yt_dlp/postprocessor/common.py", line 22, in run
    ret = func(self, info, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/yt_dlp/postprocessor/common.py", line 112, in wrapper
    return func(self, info)
  File "/usr/lib/python3.10/site-packages/yt_dlp/postprocessor/modify_chapters.py", line 64, in run
    in_out_files = [remove_chapters(info['filepath'], False)]
  File "/usr/lib/python3.10/site-packages/yt_dlp/postprocessor/modify_chapters.py", line 62, in remove_chapters
    return file, self.remove_chapters(file, cuts, concat_opts, self._force_keyframes and not is_sub)
  File "/usr/lib/python3.10/site-packages/yt_dlp/postprocessor/modify_chapters.py", line 321, in remove_chapters
    self.concat_files([in_file] * len(concat_opts), out_file, concat_opts)
  File "/usr/lib/python3.10/site-packages/yt_dlp/postprocessor/ffmpeg.py", line 364, in concat_files
    self.real_run_ffmpeg(
  File "/usr/lib/python3.10/site-packages/yt_dlp/postprocessor/ffmpeg.py", line 307, in real_run_ffmpeg
    raise FFmpegPostProcessorError(stderr.split('\n')[-1])
yt_dlp.postprocessor.ffmpeg.FFmpegPostProcessorError: file:blah/ytdl-21d3ebf6b5cdefa815234a825abf0cf2.temp: Invalid argument
```