1 --[==========================================================================[
2 dumpmeta
.lua
: dump a file
's meta data on stdout/stderr
3 --[==========================================================================[
4 Copyright (C) 2010 the VideoLAN team
7 Authors: Antoine Cellerier <dionoea at videolan dot org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 --]==========================================================================]
24 --[[ to dump meta data information in the debug output, run:
25 vlc -I lua --lua-intf dumpmeta coolmusic.mp3
26 Additional options can improve performance and output readability:
27 -V dummy -A dummy --no-video-title --no-media-library --verbose-objects +lua,-all -v=0
32 item = vlc.input.item()
33 until (item and item:is_preparsed()) or vlc.misc.should_die()
35 -- preparsing doesn't always provide all the information we
want (like duration
)
37 until item
:stats()["demux_read_bytes"] > 0 or vlc
.misc
.should_die()
39 vlc
.msg
.info("name: "..item
:name())
40 vlc
.msg
.info("uri: "..vlc
.strings
.decode_uri(item
:uri()))
41 vlc
.msg
.info("duration: "..tostring(item
:duration()))
43 vlc
.msg
.info("meta data:")
44 local meta
= item
:metas()
46 for key
, value
in pairs(meta
) do
47 vlc
.msg
.info(" "..key
..": "..value
)
50 vlc
.msg
.info(" no meta data available")
54 for cat
, data
in pairs(item
:info()) do
55 vlc
.msg
.info(" "..cat
)
56 for key
, value
in pairs(data
) do
57 vlc
.msg
.info(" "..key
..": "..value
)