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

Add warning to documentation that merging DASH video requires newer avconv #1809

Closed
maxb opened this issue Nov 23, 2013 · 15 comments
Closed

Add warning to documentation that merging DASH video requires newer avconv #1809

maxb opened this issue Nov 23, 2013 · 15 comments
Labels

Comments

@maxb
Copy link

@maxb maxb commented Nov 23, 2013

Hi,

I just downloaded my first DASH Video+Audio, and had some difficulty figuring out how to stitch them together. avconv seemed to not be able to properly read the DASH video in copy mode.

Eventually, I tried upgrading my installation of libav from 0.8.9 (available in the current Ubuntu release) to 9.10 (I got it from the Ubuntu development version), and this fixed the issue.

It would be nice if youtube-dl's documentation contained a warning that avconv 0.8.x has problems handling DASH video, and suggested upgrading to avconv 9.x.

The specific video I was downloading was http://www.youtube.com/watch?v=hpNp8WdQOoo format 137, though I also tested a number of the lower quality DASH video formats with the same results.

@rbrito
Copy link
Contributor

@rbrito rbrito commented Nov 26, 2013

@maxb, can you please let me know what you tried? The 0.8 version of libav should be good enough for muxing audio and video. See my post here:

http://cynic.cc/blog/posts/2013-10-23-assorted_news/

The relevant excerpt is also what I included in Debian's packaging of youtube-dl:

https://github.com/rbrito/pkg-youtube-dl/blob/master/debian/NEWS

@wyatt8740
Copy link

@wyatt8740 wyatt8740 commented Nov 27, 2013

... or ffmpeg, which most of the world still uses.
(I compiled it myself to avoid the weird syntax of libav in ubuntu.)

In ffmpeg 2.1/2.0/1.2.1/1.2:
ffmpeg -i DASH_VIDEO.mp4 -i DASH_AUDIO.mp4 -vcodec copy -acodec copy DASH_AVMUX.mp4

@MDCore
Copy link

@MDCore MDCore commented Nov 30, 2013

@rbrito I'm on Ubuntu 13.10. If I do:
avconv -i video.mp4 -i audio.m4a -codec copy output.mp4
I get a muxed output with only audio. the results say the video portion is 0kb

any ideas?

More info:
Using avconv version 0.8.9-6:0.8.9-0ubuntu0.13.10.1

Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press ctrl-c to stop encoding
frame=    0 fps=  0 q=-1.0 Lsize=   29090kB time=1856.71 bitrate= 128.3kbits/s    
video:0kB audio:28465kB global headers:0kB muxing overhead 2.197169%

any ideas?

@maxb
Copy link
Author

@maxb maxb commented Dec 2, 2013

@rbrito Sorry I've taken so long to respond here, I had a fairly crazy week at work. MDCore's description is in agreement with what I saw.

Here are the exact commands I ran:

youtube-dl -f 139 -o 139.m4a hpNp8WdQOoo
youtube-dl -f 134 -o 134.mp4 hpNp8WdQOoo
avconv -i 139.m4a -i 134.mp4 -c copy out.mp4

(I've chosen lower quality format codes in the above example to be kinder on the time and bandwidth of people just wanting to verify the bug.)

The out.mp4 produced by libav-tools 0.8.9-0ubuntu0.13.10.1 is far too small to contain any video data, and avprobe reports that it contains only an audio stream.

Switching to 9.10-1ubuntu1 with no other changes instead produces a successful combined file.

@MDCore
Copy link

@MDCore MDCore commented Dec 2, 2013

@maxb I've searched high and low but I can't find out how to switch to 9.10-1ubuntu1 in Saucy. Do I need to compile from source?

@maxb
Copy link
Author

@maxb maxb commented Dec 2, 2013

@MDCore I did it the "advanced APT shenanigans" or possibly just "evil" way - I reconfigured APT to include Trusty Tahr sources, and applied the relevant black magic in /etc/apt/preferences to ensure I only got what I wanted from Trusty.

For the record, the process goes like this:

  1. Add "deb SOME-MIRROR-URL trusty main universe" to /etc/apt/sources.list

  2. Add exactly the below to /etc/apt/preferences (it probably doesn't exist - create it):

Package: *
Pin: release n=trusty
Pin-Priority: 400
  1. apt-get update

  2. apt-get install -t trusty libav-tools

Bear in mind that if you go through with the above, it's firmly into the area of unsupported black magic, and it is CRITICAL you undo the changes to /etc/apt/sources.list and /etc/apt/preferences before attempting to upgrade fully to Trusty in the future, or bad stuff will happen to the upgrade.

@MDCore
Copy link

@MDCore MDCore commented Dec 2, 2013

Thanks for documenting the process @maxb, even though I don't think I'm going to risk it! Hopefully someone will make a PPA.

@maxb
Copy link
Author

@maxb maxb commented Dec 3, 2013

@MDCore Well, since you asked :-) - deb http://ppa.launchpad.net/maxb/trusty-libav-for-saucy/ubuntu saucy main

It's the exact same packages you'd end up with from the previous method (i.e. the ones currently in the Trusty repository), but making use of Launchpad's ability to copy selected packages into a new PPA to avoid the complexity of needing to configure filters on the client side to affect what packages you get.

@MDCore
Copy link

@MDCore MDCore commented Dec 3, 2013

@maxb Wow! I added the ppa, updated libav and ran the same test as before. It worked perfectly!

How can I thank you?

@Vdragon
Copy link

@Vdragon Vdragon commented Mar 1, 2014

I got the same result as @MDCore and @maxb in Ubuntu 13.10, please make it verify ffmpeg/libav 's version to make sure it will convert correctly 👍

sample: http://www.youtube.com/watch?v=bDeG_YFl-b0

@mrvanes
Copy link

@mrvanes mrvanes commented Mar 19, 2014

@maxb You saved my day! Thx for the repo and fix!

@healthyfood
Copy link

@healthyfood healthyfood commented Apr 27, 2014

'stiching' m4a/mp4 dash videos works fine. stitching webm video and audio together fails with a "ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument". Not much love for webm.

@s-gv
Copy link

@s-gv s-gv commented Dec 23, 2014

I had the same problem of no video output when muxing 1080p DASH video and audio got from youtube using avconv on Ubuntu 12.04. This worked for me:

MP4Box -add video_only.mp4 -add audio_only.m4a -new combined.mp4

@phihag
Copy link
Contributor

@phihag phihag commented Jan 23, 2015

youtube-dl will now warn automatically if it finds an overly old ffmpeg or avconv version. Thanks for the report!

@phihag phihag closed this Jan 23, 2015
@wyatt8740
Copy link

@wyatt8740 wyatt8740 commented Jan 29, 2015

It's good that this is fixed. But I'd like to say again that if you have this problem with a recent avconv build, you should really give ffmpeg a try. Sometimes things work in ffmpeg that don't in avconv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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