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

Stream audio duration twice as long #11035

Closed
IdoBn opened this issue Oct 26, 2016 · 3 comments
Closed

Stream audio duration twice as long #11035

IdoBn opened this issue Oct 26, 2016 · 3 comments

Comments

@IdoBn
Copy link

@IdoBn IdoBn commented Oct 26, 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.10.25. 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.10.25

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 ```):

➜  Desktop youtube-dl -v -f 140 https://www.youtube.com/watch\?v\=OxPv8mSTv9U -g
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'-f', u'140', u'https://www.youtube.com/watch?v=OxPv8mSTv9U', u'-g']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.10.25
[debug] Python version 2.7.12 - Darwin-15.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.1.1, ffprobe 3.1.1, rtmpdump 2.4
[debug] Proxy map: {}
https://r4---sn-oxu8pnpvo-i45l.googlevideo.com/videoplayback?keepalive=yes&id=o-AGh8pzPQ-kW7qnJn8yQ7qG0PBuDiZIAeYLbZ5IgsofLm&mime=audio%2Fmp4&gir=yes&sparams=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&ip=46.117.130.68&lmt=1476436347217383&key=yt6&dur=213.600&expire=1477490844&gcr=il&ipbits=0&initcwndbps=1693750&clen=3393184&requiressl=yes&source=youtube&upn=7mdNHQ_0MBI&mt=1477469019&itag=140&pl=16&ei=PGQQWOTNJ5etWKLFqcAL&ms=au&mm=31&mn=sn-oxu8pnpvo-i45l&mv=m&signature=322E6C00C62D3C53C1BA745C4D127C165DB3E8B1.CDF2E2C69ECA99897D896E6FF4E6EAB9292C02FF&ratebypass=yes



➜  Desktop ffprobe https://r4---sn-oxu8pnpvo-i45l.googlevideo.com/videoplayback\?keepalive\=yes\&id\=o-AGh8pzPQ-kW7qnJn8yQ7qG0PBuDiZIAeYLbZ5IgsofLm\&mime\=audio%2Fmp4\&gir\=yes\&sparams\=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire\&ip\=46.117.130.68\&lmt\=1476436347217383\&key\=yt6\&dur\=213.600\&expire\=1477490844\&gcr\=il\&ipbits\=0\&initcwndbps\=1693750\&clen\=3393184\&requiressl\=yes\&source\=youtube\&upn\=7mdNHQ_0MBI\&mt\=1477469019\&itag\=140\&pl\=16\&ei\=PGQQWOTNJ5etWKLFqcAL\&ms\=au\&mm\=31\&mn\=sn-oxu8pnpvo-i45l\&mv\=m\&signature\=322E6C00C62D3C53C1BA745C4D127C165DB3E8B1.CDF2E2C69ECA99897D896E6FF4E6EAB9292C02FF\&ratebypass\=yes
ffprobe version 3.1.1 Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.3.0 (clang-703.0.31)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://r4---sn-oxu8pnpvo-i45l.googlevideo.com/videoplayback?keepalive=yes&id=o-AGh8pzPQ-kW7qnJn8yQ7qG0PBuDiZIAeYLbZ5IgsofLm&mime=audio%2Fmp4&gir=yes&sparams=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&ip=46.117.130.68&lmt=1476436347217383&key=yt6&dur=213.600&expire=1477490844&gcr=il&ipbits=0&initcwndbps=1693750&clen=3393184&requiressl=yes&source=youtube&upn=7mdNHQ_0MBI&mt=1477469019&itag=140&pl=16&ei=PGQQWOTNJ5etWKLFqcAL&ms=au&mm=31&mn=sn-oxu8pnpvo-i45l&mv=m&signature=322E6C00C62D3C53C1BA745C4D127C165DB3E8B1.CDF2E2C69ECA99897D896E6FF4E6EAB9292C02FF&ratebypass=yes':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6mp41
    creation_time   : 2016-10-14 09:12:27
  Duration: 00:03:33.60, start: 0.000000, bitrate: 127 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 5 kb/s (default)
    Metadata:
      creation_time   : 2016-10-14 09:12:27
      handler_name    : SoundHandler



Description of your issue, suggested solution and other information

When attempting to play the url (generated in the first output on a device running iOS the audio is twice as long (see image) compared to the actual audio duration (see output 2)

426137976_11930252674566259473

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 26, 2016

This file uses m4a_dash container, which confuses some players. In my case mpv works fine while VLC reports the wrong duration. To fix it, install ffmpeg and let youtube-dl fix it:

$ youtube-dl -v -f 140 "https://www.youtube.com/watch?v=OxPv8mSTv9U"              
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-f', '140', 'https://www.youtube.com/watch?v=OxPv8mSTv9U']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.10.21.1
[debug] Git HEAD: 5ace137
[debug] Python version 3.5.2 - Linux-4.8.4-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.1.5, ffprobe 3.1.5, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] OxPv8mSTv9U: Downloading webpage
[youtube] OxPv8mSTv9U: Downloading video info webpage
[youtube] OxPv8mSTv9U: Extracting video information
[youtube] {22} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {43} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {18} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {36} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {17} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {137} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {248} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {136} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {247} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {135} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {244} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {134} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {243} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {133} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {242} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {160} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {278} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {140} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {171} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {249} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {250} signature length 42.42, html5 player en_US-vflTBNOIW
[youtube] {251} signature length 42.42, html5 player en_US-vflTBNOIW
[debug] Invoking downloader on 'https://r8---sn-5njj-u2xl.googlevideo.com/videoplayback?source=youtube&gcr=tw&upn=QmBRZss0u3U&clen=3393184&ipbits=0&lmt=1476436347217383&expire=1477492572&keepalive=yes&requiressl=yes&mime=audio%2Fmp4&gir=yes&mt=1477470855&dur=213.600&mv=m&initcwndbps=6853750&ms=au&itag=140&sparams=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&id=o-AHmFBTs1VgQPNQaJjBk8iz9e9Im732G8Ta_UIRIKJIe2&mm=31&ip=140.112.230.216&mn=sn-5njj-u2xl&pl=17&ei=_GoQWPzLMoz84AKuwIz4Ag&key=yt6&signature=284EA1BED4B6F9C95B77D0D839F0E57D14946105.70E84D445FC2D8BE2B8E456404E6ADFF8A7A00DA&ratebypass=yes'
[download] Destination: Maroon 5 - Don't Wanna Know (Audio) ft. Kendrick Lamar-OxPv8mSTv9U.m4a
[download] 100% of 3.24MiB in 00:00
[ffmpeg] Correcting container in "Maroon 5 - Don't Wanna Know (Audio) ft. Kendrick Lamar-OxPv8mSTv9U.m4a"
[debug] ffmpeg command line: ffmpeg -y -i 'file:Maroon 5 - Don'"'"'t Wanna Know (Audio) ft. Kendrick Lamar-OxPv8mSTv9U.m4a' -c copy -f mp4 'file:Maroon 5 - Don'"'"'t Wanna Know (Audio) ft. Kendrick Lamar-OxPv8mSTv9U.temp.m4a'

Note these lines:

[ffmpeg] Correcting container in "Maroon 5 - Don't Wanna Know (Audio) ft. Kendrick Lamar-OxPv8mSTv9U.m4a"
[debug] ffmpeg command line: ffmpeg -y -i 'file:Maroon 5 - Don'"'"'t Wanna Know (Audio) ft. Kendrick Lamar-OxPv8mSTv9U.m4a' -c copy -f mp4 'file:Maroon 5 - Don'"'"'t Wanna Know (Audio) ft. Kendrick Lamar-OxPv8mSTv9U.temp.m4a'

You can also download the file and fix it with ffmpeg manually.

@yan12125 yan12125 closed this Oct 26, 2016
@IdoBn
Copy link
Author

@IdoBn IdoBn commented Oct 26, 2016

I understand your solution for downloading a file. However I want the url (-g option), does ffmpeg have a streaming extension?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 26, 2016

does ffmpeg have a streaming extension?

Hmm what's a "streaming extension"?

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
2 participants
You can’t perform that action at this time.