Hi!

Ralph Glasstetter wrote:

> I recently had a bunch of recordings which I wanted to copy & index at the 
> same time with a cool command line like:
> 
> tsfilter <INPUT.tts | tee OUTPUT.ts | dvbcut -generateidx -idx OUTPUT.ts.idx -
> 
> when I noticed that this isn't no more possible! :-(

Not this way, at least. If you're using bash or ksh, you may try this one:

        dvbcut -generateidx -idx OUTPUT.ts.idx \
          <(tsfilter <INPUT.tts | tee OUTPUT.ts)


> Doing some 'archeological excavations' I found out that this feature was 
> already lost in the pre-svn aera (official 0.5.3 was able to do this kind of 
> stuff) and the introduction of multifile input probabely wiped finally away 
> the last code remnants... code for writing the index to STDOUT (without the 
> -idx option) survived, but couldn't be used since the '-' was not allowed 
> anymore as filename)... ;-)

Sorry for that. On the other hand, why would anybody want to write the
index to stdout? The only program that can process it is dvbcut, and I'm
pretty sure it never was able to *read* the index from stdin.

> The appendet patch now re-invents the 'wheel'... :)

That's not a good idea at all. Reading from stdin interferes with the
multi-file capability, therefore you can't just use "-" as the filename,
read from stdin and expect everything to work.

> Actually there was just a small change necessay to inbuffer::open
> and makeing 'needseek' (used in inbuffer::providedata) globally visible.

Ugh. Did you try multi-file mode after patching? And, in particular,
navigating back and forth between multiple input files? "needseek" was
local (and initialized to "true") for a reason.

> The rest is just cosmetics...
> 
> Although, I'm not sure about the mmap-stuff in providedata (the part which is 
> not used under windows... maybe we can skip that also for STDIN reading?).

In general, neither mmap() nor lseek() works with standard input (unless
stdin is a regular file - but then you could use it directly). But
lseek() is required for both GUI mode (navigation) and multi-file
support. Therefore, neither of them will work with stdin as the input.

Supporting stdin with -generateidx ain't easy either, and in my opinion
it isn't worth the trouble it causes. In particular since its advantages
are close to non-existent. First of all, you still need exactly the same
input file for cutting - that is, you have to write it to disk anyway.
Therefore the piped version doesn't save you any disk space compared to

        tsfilter <INPUT.tts >OUTPUT.ts
        dvbcut -generateidx OUTPUT.ts

Besides that, dvbcut uses mmap() and a large read-ahead buffer when it
processes a disk file (on Linux), making reads a lot faster than from a
pipe that can transfer at most 64KB at a time. Not to mention all the
time consuming context switches between the concurrent processes:
tsfilter, tee and dvbcut. Pipes really are great as a concept, but their
performance sucks if you have to transport some gazillion bytes.

> I also forbbitted the usage of '-' as filename not only when in gui mode 
> (which don't makes sense), but also when in batch-mode because it simply
> don't works at the moment! Don't know why... actually it should,... at least 
> I've no idea why not... maybe you have?

"-" does not automatically mean "stdin" - it usually needs special handling.

[...]
> PS: Ahhh... forgot to mention that with this patch it's also possible to give 
> -g/-i/-b as CLI switches..  or -gen/-ind/-bat... or whatever you want... ;-)

That has been possible before - I've been using it all the time.

-- 
Michael "Tired" Riepe <[EMAIL PROTECTED]>
X-Tired: Each morning I get up I die a little

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
DVBCUT-devel mailing list
DVBCUT-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dvbcut-devel

Reply via email to