Re: [vdr] vdr-checkts + vdrnfofs
--- On Sun, 2/10/11, Tobi wrote: > From: Tobi > Subject: [vdr] vdr-checkts + vdrnfofs > To: "VDR Mailing List" > Date: Sunday, 2 October, 2011, 22:21 > Hi, > > Just in case someone finds them useful, I've just put two > tiny tools online: > > vdr-checkts: checks VDR recordings for continuity errors > > http://projects.vdr-developer.org/git/vdr-checkts.git > http://projects.vdr-developer.org/git/vdr-checkts.git/tree/README > http://projects.vdr-developer.org/git/vdr-checkts.git/snapshot/vdr-checkts-0.1.tar.gz > > > > vdr-nfofs: A Fuse file system for VDR recordings, mapping > them to > *.mpg/*.nfo files > > http://projects.vdr-developer.org/git/vdrnfofs.git/ > http://projects.vdr-developer.org/git/vdrnfofs.git/tree/README > http://projects.vdr-developer.org/git/vdrnfofs.git/snapshot/vdrnfofs-0.7.tar.gz > > Have fun, > > Tobias vdr-nfofs looks interesting. Can it be used in conjunction with a DLNA server like MiniDLNA? The problem with DLNA servers I have tried is they present vdr recordings as a list of 1.ts files which is not user friendly. Does it support H264 vdr recordings? I'm looking for a solution to view HD recordings on a TV using a thin client, like a DLNA client for example. Stuart ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr-checkts + vdrnfofs
On 03.10.2011 11:39, Stuart Morris wrote: > vdr-nfofs looks interesting. Can it be used in conjunction with a DLNA server > like MiniDLNA? Should work. Just make MiniDLNA's config point to the vdrnfofs file system. But I have no idea, if the *.nfo files are of any use to DLNA devices. And it might be a little bit slow if you have a lot of VDR recordings. > Does it support H264 vdr recordings? It supports VDR 1.6 (001.vdr) and VDR 1.7.x (0001.ts). It doesn't care about the encoding. The VDR files are just virtually concatenated and presented as a single *.mpg file. Tobias ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr-checkts + vdrnfofs
I tried to set up a dlna server with an earlier version of vdr-nfofs a few months ago. It kinda worked but there were some performance problems in regard to file system operations. I hacked a file descriptor cache into the python code which helped a bit. Tobi might have included this in the new version. Cya, Ed -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. Tobi schrieb: On 03.10.2011 11:39, Stuart Morris wrote: > vdr-nfofs looks interesting. Can it be used in conjunction with a DLNA server > like MiniDLNA? Should work. Just make MiniDLNA's config point to the vdrnfofs file system. But I have no idea, if the *.nfo files are of any use to DLNA devices. And it might be a little bit slow if you have a lot of VDR recordings. > Does it support H264 vdr recordings? It supports VDR 1.6 (001.vdr) and VDR 1.7.x (0001.ts). It doesn't care about the encoding. The VDR files are just virtually concatenated and presented as a single *.mpg file. Tobias _ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr-checkts + vdrnfofs
Hi, > I tried to set up a dlna server with an earlier version of vdr-nfofs a few > months ago. It kinda worked but there were some performance problems in > regard to file system operations. I hacked a file descriptor cache into the > python code which helped a bit. Tobi might have included this in the new > version. Looks like my patches haven't been accepted for 0.7. You can try my patchset but I haven't worked on that for some months now. Patch is not minimal and not cleanly separated, so you should pick the tidbits you like. Cya, Ed diff -ur vdrnfofs-0.6/vdrnfofs/concatenated_file_reader.py vdrnfofs-0.6.tyger1//vdrnfofs/concatenated_file_reader.py --- vdrnfofs-0.6/vdrnfofs/concatenated_file_reader.py 2011-04-14 23:59:21.0 +0200 +++ vdrnfofs-0.6.tyger1//vdrnfofs/concatenated_file_reader.py 2011-04-18 22:35:43.776907385 +0200 @@ -20,32 +20,37 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import os +from threading import Lock +from cStringIO import StringIO class ConcatenatedFileReader: def __init__(self, filenames): self.files = [(f, os.path.getsize(f)) for f in filenames] self.current_filename = None self.current_file = None +self.rwlock = Lock() def read(self, offset, size): -buffer = "" +buffer = StringIO() ptr = offset -while (len(buffer) < size): -(filename, file_offset) = self.filename_from_offset(ptr) -if filename: -if (self.current_filename != filename): -if self.current_file: -self.current_file.close() -self.current_filename = filename -self.current_file = open(filename, 'r') -self.current_file.seek(file_offset) -buffer += self.current_file.read(size - len(buffer)) -ptr = offset + len(buffer) -else: -break -return buffer +with self.rwlock: +while (buffer.tell() < size): +(filename, file_offset) = self.filename_from_offset(ptr) +if filename: +if (self.current_filename != filename): +if self.current_file: +self.current_file.close() +self.current_filename = filename +self.current_file = open(filename, 'r') +self.current_file.seek(file_offset) +buffer.write(self.current_file.read(size - buffer.tell())) +ptr = offset + buffer.tell() +else: +break +return buffer.getvalue() -def release(self): +def __del__(self): +# print "CFR::DEL" if self.current_file: self.current_file.close() Only in vdrnfofs-0.6.tyger1//vdrnfofs: concatenated_file_reader.py~ diff -ur vdrnfofs-0.6/vdrnfofs/filesystemnodes.py vdrnfofs-0.6.tyger1//vdrnfofs/filesystemnodes.py --- vdrnfofs-0.6/vdrnfofs/filesystemnodes.py 2011-04-14 23:27:02.0 +0200 +++ vdrnfofs-0.6.tyger1//vdrnfofs/filesystemnodes.py 2011-04-18 22:39:19.540905997 +0200 @@ -26,6 +26,7 @@ from concatenated_file_reader import * from vdr import * +from threading import Lock class NodeAttributes(fuse.Stat): def __init__(self): @@ -40,40 +41,90 @@ self.st_mtime = 0 self.st_ctime = 0 + class MpgNode: +cachesize = 20 +cachelock = Lock() +cache = [] + +@classmethod +def create(cls, path, cache): +if not cache: +return cls(path) +with cls.cachelock: +index = next((i for i in xrange(len(cls.cache)-1, -1, -1) if cls.cache[i].key == path), None) +if index is not None: +# print "%s HIT" % cls.__name__ +node = cls.cache.pop(index) +else: +# print "%s MISS" % cls.__name__ +node = cls(path) +if len(cls.cache) > cls.cachesize: +del cls.cache[0] +cls.cache.append(node) +# print "%s cache size: %d" %(cls.__name__, len(cls.cache)) +return node + def __init__(self, path): +# print "MpgNode::init %s" % path +self.key = path self.path = os.path.normpath(path) self.mpeg_files = glob.glob(path + '/[0-9]*.vdr') if not self.mpeg_files: self.mpeg_files = glob.glob(path + '/[0-9]*.ts') self.mpeg_files.sort() -self.file_system_name = os.path.basename(os.path.abspath(path + '/..')) + '_' + os.path.basename(path) + '.mpg' +self.file_system_name ="%s_%s.mpg" % (os.path.basename(os.path.abspath(path + '/..')), os.path.basename(path)) self.reader = ConcatenatedFileReader(self.mpeg_files) - -def size(self): size = 0 for file in self.mpeg_files: size += os.path.getsize(file) -retur
Re: [vdr] vdr-checkts + vdrnfofs
On 03.10.2011 18:08, Ed Hein wrote: > Looks like my patches haven't been accepted for 0.7. No they haven't. Sorry! But it's on the todo list. Just need to fix the merge conflicts first, because the patch doesn't apply to 0.7. Tobias ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr-checkts + vdrnfofs
Am 02.10.2011 23:21, schrieb Tobi: Hi, Just in case someone finds them useful, I've just put two tiny tools online: vdr-checkts: checks VDR recordings for continuity errors http://projects.vdr-developer.org/git/vdr-checkts.git http://projects.vdr-developer.org/git/vdr-checkts.git/tree/README http://projects.vdr-developer.org/git/vdr-checkts.git/snapshot/vdr-checkts-0.1.tar.gz vdr-nfofs: A Fuse file system for VDR recordings, mapping them to *.mpg/*.nfo files http://projects.vdr-developer.org/git/vdrnfofs.git/ http://projects.vdr-developer.org/git/vdrnfofs.git/tree/README http://projects.vdr-developer.org/git/vdrnfofs.git/snapshot/vdrnfofs-0.7.tar.gz Have fun, Tobias ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr Hi Tobi, I like this vdrnfofs. But I miss one thing. When you create the filename you include the Recording-Timestamp at the end of the filename. So you can only sort these files in the browser alphabetically. But it would be nice to have these timestamps as the creation time of the mpeg-file and not only "1.1.1970 1:00". Then you it would be possible to sort also based on the date column. I would prefer this because I normaly look the oldest unseen recordings first. Is it possible to include this in one of the next versions? Kind regards Manfred -- --- Manfred Schmidt-Voigt --- -www.mannitec.de - --- mailto:manfred.schmidt-vo...@mannitec.de--- ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr-checkts + vdrnfofs
On 03.10.2011 20:12, Manfred Schmidt-Voigt wrote: > Is it possible to include this in one of the next versions? Good suggestion! Added to the todo list. Tobias ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr