本文介绍了读取ID3标签而不下载整个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以读取MP3文件的ID3标签(持续时间,艺术家,标题...),而不必下载整个文件?
Is it possible to read ID3 tags (Duration, Artist, title...) of an MP3 file without having to download the whole file?
我做了一些测试,仅下载了几个字节的MP3文件,就能够获得Artist和title标签..但是我不确定Duration和其他标签是否可能.
I did a few tests and I was able to get the Artist and title tags with only downloading a few bytes of the MP3 file.. but I'm not sure if it's possible for Duration and other tags..
谢谢.
推荐答案
我只是发现ffmpeg可以读取远程文件的ID3标签,而不必下载整个文件:
I just find out that ffmpeg can read ID3 tags of a remote file without having to download the whole file:
root@local1:/# ffmpeg -i http://physics.ujep.cz/~mmaly/mp3/Mozart/Mass_in_C_Minor_New_by_Levin/sbory_vyssi_kvalita/01_Kyrie.mp3
FFmpeg version 0.6-4:0.6-2ubuntu6, Copyright (c) 2000-2010 the FFmpeg developers
built on Oct 5 2010 22:36:53 with gcc 4.4.5
configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mp3 @ 0x7ae420]max_analyze_duration reached
[mp3 @ 0x7ae420]Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'http://physics.ujep.cz/~mmaly/mp3/Mozart/Mass_in_C_Minor_New_by_Levin/sbory_vyssi_kvalita/01_Kyrie.mp3':
Metadata:
TLEN : 431046
TIT2 : Kyrie
TRCK : 1
TPE1 : Mozart
TCON : Classical
TALB : Mass in C Minor New by Levin
Duration: 00:07:11.18, start: 0.000000, bitrate: 128 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, 2 channels, s16, 128 kb/s
At least one output file must be specified
这篇关于读取ID3标签而不下载整个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!