Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I merge 4 videos into one? #10054

Closed
hdubb opened this issue Jul 9, 2016 · 5 comments
Closed

How do I merge 4 videos into one? #10054

hdubb opened this issue Jul 9, 2016 · 5 comments

Comments

@hdubb
Copy link

@hdubb hdubb commented Jul 9, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.07.09.2. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.07.09.2

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

youtube-dl>youtube-dl -v http://www.nickjr.com/paw-patrol/videos/pups-save-a-goldrush-s3-ep302-full-episode/
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.nickjr.com/paw-patrol/videos/pups-save-a-goldrush-s3-ep302-full-episode/']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2016.07.09.2
[debug] Python version 3.4.4 - Windows-10-10.0.10586
[debug] exe versions: ffmpeg N-80923-g50747d6, ffprobe N-80923-g50747d6
[debug] Proxy map: {}
[nick.com] pups-save-a-goldrush-s3-ep302-full-episode: Downloading webpage
[nick.com] a2223516-9d75-11e5-8ff7-0026b9414f30: Downloading info
[nick.com] 1f23f10c-067c-11e6-8a89-0026b9414f30: Extracting information
[nick.com] 1f23f10c-067c-11e6-8a89-0026b9414f30: Downloading video urls
[nick.com] 201571da-067c-11e6-8a89-0026b9414f30: Extracting information
[nick.com] 201571da-067c-11e6-8a89-0026b9414f30: Downloading video urls
[nick.com] 200f0944-067c-11e6-8a89-0026b9414f30: Extracting information
[nick.com] 200f0944-067c-11e6-8a89-0026b9414f30: Downloading video urls
[nick.com] 1fe03074-067c-11e6-8a89-0026b9414f30: Extracting information
[nick.com] 1fe03074-067c-11e6-8a89-0026b9414f30: Downloading video urls
[download] Downloading playlist: None
[nick.com] playlist None: Collected 4 video ids (downloading 4 of them)
[download] Downloading video 1 of 4
[debug] Invoking downloader on 'http://viacommtvstrmfs.fplive.net/gsp.alias/mediabus/kids/.com/2016/04/25/04/48/54/23078a3e674642be952c011667d04970/1151243/kEmxhGDpxZ_HDPAW302A1_1151243_6106051_1920x1080_5128.mp4'
[download] PAW Patrol - 'Pups Save a Goldrush_Pups Save the Paw Patroller' S1-1f23f10c-067c-11e6-8a89-0026b9414f30.mp4 has already been downloaded
[download] 100% of 152.47MiB
[download] Downloading video 2 of 4
[debug] Invoking downloader on 'http://viacommtvstrmfs.fplive.net/gsp.alias/mediabus/kids/.com/2016/04/25/04/49/05/2e74e7f82a4c459f8f2e854f7ff7b868/1151244/GQNG2u6Sqo_HDPAW302A2_1151244_6106051_1920x1080_5128.mp4'
[download] PAW Patrol - 'Pups Save a Goldrush_Pups Save the Paw Patroller' S2-201571da-067c-11e6-8a89-0026b9414f30.mp4 has already been downloaded
[download] 100% of 342.16MiB
[download] Downloading video 3 of 4
[debug] Invoking downloader on 'http://viacommtvstrmfs.fplive.net/gsp.alias/mediabus/kids/.com/2016/04/25/04/49/02/1ab39486dde94154a7eec2ba41fe1a40/1151245/v1xeC7lIrz_HDPAW302A3_1151245_6106051_1920x1080_5128.mp4'
[download] PAW Patrol - 'Pups Save a Goldrush_Pups Save the Paw Patroller' S3-200f0944-067c-11e6-8a89-0026b9414f30.mp4 has already been downloaded
[download] 100% of 142.71MiB
[download] Downloading video 4 of 4
[debug] Invoking downloader on 'http://viacommtvstrmfs.fplive.net/gsp.alias/mediabus/kids/.com/2016/04/25/04/49/00/7b1ed57260174dd09533a61fac9b63d2/1151246/qf5EdTiiUt_HDPAW302A4_1151246_6106051_1920x1080_5128.mp4'
[download] PAW Patrol - 'Pups Save a Goldrush_Pups Save the Paw Patroller' S4-1fe03074-067c-11e6-8a89-0026b9414f30.mp4 has already been downloaded
[download] 100% of 6.54MiB
[download] Finished downloading playlist: None

Description of your issue, suggested solution and other information

When I am downloading the video above, it brings out 4 different files, I just want 1 file. I guess it is doing that because there are ad breaks in between but I don't want ads either.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jul 10, 2016

Use ffmpeg/avconv.
No that's not because of ad breaks but because it's served as 4 separate files.
Duplicate of #2844.

@dstftw dstftw closed this Jul 10, 2016
@hdubb
Copy link
Author

@hdubb hdubb commented Jul 10, 2016

@dstftw thanks. but what do I type in to merge them using ffmpeg?

@hdubb
Copy link
Author

@hdubb hdubb commented Jul 10, 2016

@dstftw Thanks for those instructions.
I have 3 .mp4 files named 1.mp4, 2.mp4, and 3.mp4

This is what I am supposed to do right? It seems to work now that I updated the last line but it is converting mp4 to ts, then ts back to mp4, is that necessary?

ffmpeg -i 1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i 2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i 3.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts" -c copy -bsf:a aac_adtstoasc output.mp4

@Reino17
Copy link

@Reino17 Reino17 commented Jul 10, 2016

You have 3 mp4-files, or rather mp4-containers, each with a H264-videostream and an AAC-audiostream inside: [h264+aac] [h264+aac] [h264+aac].
In order to create 1 mp4-file with all the other 3 concatenated, you first have to extract the streams from it's container: h264+aac h264+aac h264+aac.
Then you can concat them together and put the newly formed audio- and videostream in a new mp4-container: [h264+aac|h264+aac|h264+aac].
So yes, the intermediate step is necessary. Unless you have a system that supports names pipes. Then you can do it in one go.

Btw, if you clearly specify .ts in the filename, then -f mpegts is not really necessary. Just like -f mp4 isn't necessary in the final step.

@ytdl-org ytdl-org deleted a comment from TGotwig Jun 20, 2020
@ytdl-org ytdl-org locked and limited conversation to collaborators Jun 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.