I used youtube-dl to download and convert youtube video into mp3.
youtube-dl http://www.youtube.com/watch?v=4f51DhJR0zo
-o "Alesso - Think It's Time.flv" -x -f 43 --audio-format mp3
Now it looks like all the mp3 files have an unusual long duration, using amarok, or something similar it will produce very long time interval with no sound. I looked at the flv file, and it seems that the time/duration is right there, but avconv converts and changes the time. So original song.flv duration is 04:42 and output.mp3 duration is 17:20. If i write
$ avconv -i Rihanna\ -\ Diamonds.mp3
output:
Input #0, mp3, from 'Rihanna - Diamonds.mp3':
Metadata:
encoder : Lavf53.21.1
Duration: 00:04:42.98, start: 0.000000, bitrate: 117 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 32 kb/s
At least one output file must be specified
so duration output is right, but it will not show in amarok. Vlc on the other hand calculates the duration itself, but the time is continuously changing until the song reaches the end.
Is there someway to change global id3_v2 time/duration tags, so I might run a script on all my files after downloading from youtube-dl. Or maybe there is a fix in this bug?
I've encountered the same issue.
CBR: avconv output bad CBR mp3 headers when using the -ab (or -b:a) option. Outputing to pipe solve this issue:
avconv -i file.flv -b:a 128k --audio-format mp3 - > file.mp3
Note: this fix work only for CBR mp3, it breaks VBR mp3 that needs direct output to file.
VBR: If you use avconv -q:a option (with a 0 to 9 quality indicator), you'll have a VBR mp3 audio stream output:
youtube-dl http://www.youtube.com/watch?v=4f51DhJR0zo
-o "Alesso - Think It's Time.flv" -x -f 43 -q:a 4 --audio-format mp3
With this VBR mp3 output, you can use vbrfix to fix the vbrheader and have a correct duration:
command vbrfix "Rihanna - Diamonds.mp3" "Rihanna - Diamonds - vbrfixed.mp3"
The duration of "Rihanna - Diamonds - vbrfixed.mp3" file should be OK.
Source: http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=7&t=377
Please note that using -ab option with avconv output a CBR mp3 that can't be fixed with vbrfix. Avconv seems to output bad headers for CBR mp3 files.