Answers.Body: <p>I found a solution to my problem:</p>
  
  <p>Ffmpeg can use a http stream as input:</p>
  
  <p><code>ffmpeg -i YoutubeVideoOnlyURLHere -i YoutubeAudioOnlyURLHere -c copy -map 0:0 -map 1:0 Path/to/outputFile.mp4</code></p>
  
  <p>You can get the needed URLs from<br>
  <code>youtube-dl -f bestvideo,bestaudio --get-url https:www.youtube.com/watch?v=XXXXXXXXXXX</code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-04T18:04:43.140Z
Answers.LastActivityDate: 2017-01-04T18:04:43.140Z
Answers.UserDisplayName: Atemu
Body: <p>if this is the wrong place to post this let me know.</p>
  
  <p>I want to download a very large video (9.1GiB) from youtube on my device and I have ~10GB free storage space for it.<br>
  Because it's youtube, I have to download video and audio separately and combine them afterwards. I'd normally do that using ffmpeg. I'd have to let it create the combined video in a new ~9.1GiB file because it can't overwrite it's input. The video only file of similar size must exist during the whole process.<br>
  Problem is: I can't store 2 9.1GiB files, only one.        </p>
  
  <p>The possible solutions would be to edit the video only file to have an audio stream or have a super intelligent buffer system that'd delete the parts of the video only file that have already been copied into the new file.</p>
  
  <p>Is there any program that is capable of doing that or do you know a different solution to this problem?<br>
  -Atemu</p>
  
  <p>(Sorry for my bad german)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-28T21:08:04.267Z
Comments.Text: There's no way to combine two files without making a third file, at least temporarily. But I don't understand why you think you need to do this -- surely you can just download one combined A/V file?
Comments.UserDisplayName: Jim Mack
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-29T16:59:55.290Z
Comments.Text: Everything above 720p 30fps h264 .mp4 and vp8 .webm is stored as DASH video and audio only files on youtube. Run `youtube-dl -F someyoutubevideolink` if you want to ccheck for yourself.
Comments.UserDisplayName: Atemu
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-29T17:17:58.793Z
Comments.Text: Using a tool like JDownloader 2 I seem to be able to d/l any video as a combined A/V file. Maybe I haven't encountered the files you're referring to: can you provide a specific link?
Comments.UserDisplayName: Jim Mack
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-30T16:29:54.973Z
Comments.Text: any youtube video that is in full HD or higher https://www.youtube.com/watch?v=iNJdPyoqt8U. I'm guessing JDownloader combines them automatically
Comments.UserDisplayName: Atemu
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-30T18:05:30.730Z
Comments.Text: Nope, works fine as is. There's a direct link to the 2160p .MP4 file. It's 667 MB in size. Try JDownloader 2, it's free.
Comments.UserDisplayName: Jim Mack
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-04T18:29:08.197Z
Comments.Text: jd comes bundled with a copy of ffmpeg and it muxes the DASH streams after download.
Comments.UserDisplayName: Gyan
Tags: <ffmpeg><youtube><storage>
Title: Combine audio and video file without creating a 3rd file
UserDisplayName: Atemu
ThreadText: # Combine audio and video file without creating a 3rd file
  
  (Asked by: username_0 on 2016-09-28)
  
  if this is the wrong place to post this let me know.
  
  I want to download a very large video (9.1GiB) from youtube on my device and I have ~10GB free storage space for it.  
  Because it's youtube, I have to download video and audio separately and combine them afterwards. I'd normally do that using ffmpeg. I'd have to let it create the combined video in a new ~9.1GiB file because it can't overwrite it's input. The video only file of similar size must exist during the whole process.  
  Problem is: I can't store 2 9.1GiB files, only one.
  
  The possible solutions would be to edit the video only file to have an audio stream or have a super intelligent buffer system that'd delete the parts of the video only file that have already been copied into the new file.
  
  Is there any program that is capable of doing that or do you know a different solution to this problem?  
  -username_0
  
  (Sorry for my bad german)
  
  **Tags:** ffmpeg, youtube, storage
  
  > **Comments:**
  > **username_1**: There's no way to combine two files without making a third file, at least temporarily. But I don't understand why you think you need to do this -- surely you can just download one combined A/V file?  
  > **username_0**: Everything above 720p 30fps h264 .mp4 and vp8 .webm is stored as DASH video and audio only files on youtube. Run `youtube-dl -F someyoutubevideolink` if you want to ccheck for yourself.  
  > **username_1**: Using a tool like JDownloader 2 I seem to be able to d/l any video as a combined A/V file. Maybe I haven't encountered the files you're referring to: can you provide a specific link?  
  > **username_0**: any youtube video that is in full HD or higher https://www.youtube.com/watch?v=iNJdPyoqt8U. I'm guessing JDownloader combines them automatically  
  > **username_1**: Nope, works fine as is. There's a direct link to the 2160p .MP4 file. It's 667 MB in size. Try JDownloader 2, it's free.  
  > **username_2**: jd comes bundled with a copy of ffmpeg and it muxes the DASH streams after download.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-01-04. Score: 1 | Accepted answer
  
  I found a solution to my problem:
  
  Ffmpeg can use a http stream as input:
  
  `ffmpeg -i YoutubeVideoOnlyURLHere -i YoutubeAudioOnlyURLHere -c copy -map 0:0 -map 1:0 Path/to/outputFile.mp4`
  
  You can get the needed URLs from  
  `youtube-dl -f bestvideo,bestaudio --get-url https:www.youtube.com/watch?v=XXXXXXXXXXX`
  
  
  ---
  
  