я был в состоянии сделать эту работу, следуя инструкции here. VLC поддерживает lua-скриптинг. Ниже приведен сценарий, который я придумал, он принимает файл, заканчивающийся расширением .fixedseek. Файл плейлиста представляет собой файл csv с тремя столбцами, содержащими file_path_url
, start_time
, stop_time
, например.
file:///path/to/dvds/dvd1/VIDEO_TS/VTS_01_3.VOB,348,355
file:///path/to/dvds/dvd2/VIDEO_TS/VTS_01_3.VOB,548,855
... and so on ...
Скрипт анализирует файл и воспроизводит каждую строку из start_time
в stop_time
-- fixedseek.lua
-- A compiled version of this file (.luac) should be put into the proper VLC playlist parsers directory.
-- In my ubuntu 14.04 vlc installation, it was: /usr/lib/vlc/lua/playlist/
-- For details, refer to:
-- http://wiki.videolan.org/Documentation:Play_HowTo/Building_Lua_Playlist_Scripts
--
-- The play list file format consists of three comma separated parts:
-- (file_path_url, start_time, stop_time)
-- e.g.
-- file:///path/to/dvds/dvd1/VIDEO_TS/VTS_01_3.VOB,348,355
-- The script below opens the file, seeks to start_time and plays until stop_time
-- and then moves on to next file in the playlist
function probe()
-- tell VLC we will handle anything ending in ".fixedseek"
return string.match(vlc.path, "%.fixedseek$")
end
function parse()
-- VLC expects us to return a list of items, each item itself a list
-- of properties
playlist = {}
while true do
playlist_item = {}
line = vlc.readline()
if line == nil then
break
else vlc.msg.info(" Read line: '"..line.."'")
end
-- parse playlist line into three tokens splitting on comma
values = {}
i=0
for word in string.gmatch(line, '([^,]+)') do
values[i]=word
i=i+1
end
vlc.msg.info(values[0])
vlc.msg.info(values[1])
vlc.msg.info(values[2])
playlist_item.path = values[0]
start_time = values[1]
stop_time = values[2]
vlc.msg.info(" Start is '"..tostring(start_time).."'")
vlc.msg.info(" Stop is '"..tostring(stop_time).."'")
-- a playlist item has another list inside of it of options
playlist_item.options = {}
table.insert(playlist_item.options, "start-time="..tostring(start_time))
table.insert(playlist_item.options, "stop-time="..tostring(stop_time))
table.insert(playlist_item.options, "fullscreen")
-- add the item to the playlist
table.insert(playlist, playlist_item)
end
return playlist
end
Почему там нет Баш тега но есть тег Lua? – ryanpattison
Поскольку vlc позволяет писать сценарии воспроизведения в lua, см. [This] (https://wiki.videolan.org/Documentation:Building_Lua_Playlist_Scripts). Я смог построить рабочее решение, скоро опубликует – vsnyc