access: live555: only use valid pcr from tracks
[vlc.git] / share / lua / intf / dumpmeta.lua
blob8bada445ccc8efe548917b222e76ad4d9caa823c
1 --[==========================================================================[
2 dumpmeta.lua: dump a file's meta data on stdout/stderr
3 --[==========================================================================[
4 Copyright (C) 2010 the VideoLAN team
5 $Id$
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 luaintf --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 -q
28 --]]
30 local item
31 repeat
32 item = vlc.input.item()
33 until (item and item:is_preparsed())
35 -- preparsing doesn't always provide all the information we want (like duration)
36 repeat
37 until item:stats()["demux_read_bytes"] > 0
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()
45 if meta then
46 for key, value in pairs(meta) do
47 vlc.msg.info(" "..key..": "..value)
48 end
49 else
50 vlc.msg.info(" no meta data available")
51 end
53 vlc.msg.info("info:")
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)
58 end
59 end
61 vlc.misc.quit()