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

Duration of the download audio twice the one of the youtube video #1866

Closed
codeKonami opened this issue Nov 30, 2013 · 10 comments
Closed

Duration of the download audio twice the one of the youtube video #1866

codeKonami opened this issue Nov 30, 2013 · 10 comments

Comments

@codeKonami
Copy link

@codeKonami codeKonami commented Nov 30, 2013

Hey,

I'm experiencing a weird issue. I've done some tests with older version and it's happening too, so it may be because a youtube update?

I'm using this command to get the audio extract only for youtube video:

youtube-dl -o '%(title)s.%(ext)s' --restrict-filenames -x --max-quality 140 {link}

For some reason on Youtube, the extract audio will have a duration twice the one on youtube. So for example I download a 3:30 minutes video, the audio will be 7 minutes.

Does someone have the same problem?

Thanks
Tom

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 30, 2013

It seems to be same as #1022, could you post which video is failing?

@codeKonami
Copy link
Author

@codeKonami codeKonami commented Nov 30, 2013

For example :
youtube-dl -o '%(title)s.%(ext)s' --restrict-filenames -x --max-quality 140 http://www.youtube.com/watch?v=h5EofwRzit0

Gives a Daft_Punk_-_Get_Lucky_Full_Video.m4a file of 8:15 where the video is only 4:07

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 30, 2013

With the command you posted, it doesn't extract the audio because it downloads the dash audio version. According to ffprobe:

$ ffprobe 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a'
...
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6mp41
    creation_time   : 2013-11-26 04:10:04
  Duration: 00:04:07.76, start: 0.000000, bitrate: 95 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 93 kb/s
    Metadata:
      creation_time   : 2013-11-26 04:10:04
      handler_name    : SoundHandler

Has a duration of 04:07.
If I just run youtube-dl 'http://www.youtube.com/watch?v=h5EofwRzit0' -x, I also get a m4a file with the right duration:

$ ffprobe 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a'
...
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    encoder         : Lavf54.63.104
  Duration: 00:04:07.71, start: 0.000000, bitrate: 145 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 143 kb/s
    Metadata:
      handler_name    : SoundHandler

It works fine with ffmpeg, are you using libav? I'm installing it and will test it.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 30, 2013

avconv also works fine, wich ffmpeg/avconv version do you have?

@codeKonami
Copy link
Author

@codeKonami codeKonami commented Nov 30, 2013

That's odd, if I do
youtube-dl 'http://www.youtube.com/watch?v=h5EofwRzit0' -x

I get the right duration:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a':
Metadata:
major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
creation_time : 2013-11-26 04:12:30
encoder : Lavf53.21.1
Duration: 00:04:07.71, start: 0.000000, bitrate: 146 kb/s
Stream #0.0(und): Audio: aac, 44100 Hz, mono, s16, 143 kb/s
Metadata:
creation_time : 2013-11-26 04:12:30

ffmpeg --version gives me this:

ffmpeg 0.8.9-4:0.8.9-0ubuntu0.12.04.1
libavutil 51. 22. 1 / 51. 22. 1
libavcodec 53. 35. 0 / 53. 35. 0
libavformat 53. 21. 1 / 53. 21. 1
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 15. 0 / 2. 15. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 52. 0. 0 / 52. 0. 0

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 30, 2013

Could you post the full output if you run youtube-dl -x --max-quality 140 http://www.youtube.com/watch?v=h5EofwRzit0 --verbose and then ffprobe {the m4a filename}?

@codeKonami
Copy link
Author

@codeKonami codeKonami commented Nov 30, 2013

youtube-dl -x --max-quality 140 http://www.youtube.com/watch?v=h5EofwRzit0 --verbose

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-x', '--max-quality', '140', 'http://www.youtube.com/watch?v=h5EofwRzit0', '--verbose']
[debug] youtube-dl version 2013.11.26
[debug] Python version 2.7.3 - Linux-3.2.0-54-virtual-x86_64-with-Ubuntu-12.04-precise
[debug] Proxy map: {}
[youtube] Setting language
[youtube] h5EofwRzit0: Downloading video webpage
[youtube] h5EofwRzit0: Downloading video info webpage
[youtube] h5EofwRzit0: Extracting video information
[download] Destination: Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a
[download] 100% of 2.81MiB in 00:02
[youtube] Post-process file Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a exists, skipping

ffprobe {the m4a filename}

avprobe version 0.8.9-4:0.8.9-0ubuntu0.12.04.1, Copyright (c) 2007-2013 the Libav developers
built on Nov 9 2013 19:08:00 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6mp41
creation_time : 2013-11-26 04:10:04
Duration: 00:08:15.51, start: 247.756939, bitrate: 47 kb/s
Stream #0.0(und): Audio: aac, 44100 Hz, mono, s16
Metadata:
creation_time : 2013-11-26 04:10:04

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 30, 2013

Wow, that's really weird. As you can see, youtube-dl doesn't do any post-processing, so the m4a file is directly downloaded from Youtube. When you play the audio, what's the reported duration? does avprobe {the m4a filename} reports the same duration? What is the md5 checsum of the file (run md5sum {filename}? in my case it's 97cc60491aacac95ab6f75f99ae08e4d (it should be the same for you).

@codeKonami
Copy link
Author

@codeKonami codeKonami commented Nov 30, 2013

This avprobe gives me this

avprobe 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a'
avprobe version 0.8.9-4:0.8.9-0ubuntu0.12.04.1, Copyright (c) 2007-2013 the Libav developers
built on Nov 9 2013 19:08:00 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6mp41
creation_time : 2013-11-26 04:10:04
Duration: 00:08:15.51, start: 247.756939, bitrate: 47 kb/s
Stream #0.0(und): Audio: aac, 44100 Hz, mono, s16
Metadata:
creation_time : 2013-11-26 04:10:04

And yeah I do have the same md5 checksum

md5sum 'Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a'
97cc60491aacac95ab6f75f99ae08e4d Daft Punk - Get Lucky (Full Video)-h5EofwRzit0.m4a

If I play the song the player just goes at the middle of the song automatically. So for this example at 4:07 and starts playing normally.

The strange thing is I've been using this exact command for the past few months without problem.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 30, 2013

I've installed avconv 0.8.9 and it reports the wrong duration. Updating to 9.10 will solve the problem (it reports the right duration), so I'm closing the issue. The audio player may be using the old version of avconv, you should report the error to them.
Thanks for the report.

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.