H
H
Homakov2011-02-09 11:53:02
MP3
Homakov, 2011-02-09 11:53:02

How to find out bitrate without downloading mp3?

You need to download only 320kbs mp3 from VKontakte - how to determine the bitrate without downloading the track itself? And in general, there are developments on VKontakte audio?

image

Answer the question

In order to leave comments, you need to log in

7 answer(s)
R
Rafael Osipov, 2011-02-09
@Rafael

You only read a few bytes of the track header . Based on this data, you determine the bitrate.

W
whitequark, 2011-02-09
@whitequark

On something Unix-like, you can do this if you know the list of addresses:
The command curl --range 0-2048 $url | file -will display information about the file header, incl. bitrate, for example:
/dev/stdin: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v2, 80 kbps, 22.05 kHz, JntStereo
If there is a file with a list of addresses (which can certainly be obtained with a greasemonkey script), then you can download only those files in which the bitrate is 320 kilobits, you can do this:

for url in $(cat list_of_the_music); do
  if curl --range 0-2048 $url | file - | grep 320 >/dev/null; then
    wget $url
  fi
done

A
arty87, 2011-02-09
@arty87

The MusicSig Chrome extension adds this functionality.

[
[email protected]><e, 2011-02-09
@barmaley_exe

Vkontakte extensions do this: they find out the duration of the track (Vkontakte writes how long the track lasts), send a HEAD request to the file (only headers are given), from the response to which they find out the weight of the file in bytes. Well, the further business of arithmetic is to divide the length of the file by the duration.

S
S1ashka, 2012-07-23
@S1ashka

EMNIP, when adding a song to your page, the code is as follows:
<input type="hidden" id="audio_info420508_90476677_46809501_2795" value="http://cs4704.userapi.com/u66844845/audio/65a9e87b88b8.mp3,219">
in the search, it seems
that the last parameter does not work - the time in seconds,
we take the size in kilobytes, divide by 128 and divide by the time
with the file in the example - about 187 kilobit / s

S
S1ashka, 2012-07-23
@S1ashka

and one more thing... don't forget
to google one position higher than your question on habré =)
www.designaeon.com/read-mp3-tags-without-downloading-it/

A
Andrew, 2012-07-23
@xaoc80

In Linux, you can do this: ffprobe [file link]
Shows all meta information

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question