Page 1 of 1

mmdtsdec writing to standard output

Posted: Sat May 03, 2014 1:58 pm
by MI3Guy
Would it be possible to allow mmdtsdec to write to standard output instead of a file?

Using the following command I was able to pipe the audio directly into flac. (Channel map is due to the input being a 7.1 file.)

mmdtsdec -d dtsdecoderdll.dll dts_logo.dtshd /dev/stdout | flac --channel-map=none -8 - --ignore-chunk-sizes -o test-out2.flac

However, this causes mmdtsdec to fail with an error code due to being unable to seek to update the wav header. I also created a wav file normally using mmdtsdec and encoded it with flac. I decoded the two flac files and the results were identical.

Using /dev/stdin for the input file appears to work properly.

Is there any chance this could be implemented in such a way that mmdtsdec would not fail? It would also be nice if it was possible to use "-" to refer to stdin and stdout.

Re: mmdtsdec writing to standard output

Posted: Sun May 04, 2014 7:20 am
by kevmitch
Interesting trick. I hadn't thought of that. mikeadmin mentioned that mmdtsdec can talk to a tcp port (that's in fact how the on the fly flac conversion works from makemkv), but he hasn't said how it's used and it's defintiely not documented.

Re: mmdtsdec writing to standard output

Posted: Mon May 26, 2014 8:49 am
by mike admin
WAV file is not streamable, as it requires file size to be present in header. mmdtsdec can write into its own streamable "wav-like" format, either to stdout/file or a tcp socket, but you would need to write an application to parse the data. If you know a good streamable PCM format, its supoort can be added to mmdtsdec.

Re: mmdtsdec writing to standard output

Posted: Tue May 27, 2014 10:46 pm
by MI3Guy
While that's true, it is possible to break the standard a bit and write a zero for the size and use programs that will ignore it. If you are not interested in implementing this, I would appreciate it if you could give more details about the tcp-based protocol.

Re: mmdtsdec writing to standard output

Posted: Thu May 29, 2014 8:16 am
by mike admin
MI3Guy wrote:While that's true, it is possible to break the standard a bit and write a zero for the size and use programs that will ignore it.
That's exactly what mmdstdec does. It writes incomplete wav header and all frames sequentially, and then tries to update header. When it fails, it quits with error, but all data are written correctly at that point, only header is incorrect.
MI3Guy wrote:If you are not interested in implementing this, I would appreciate it if you could give more details about the tcp-based protocol.
Are you planning to use it in your application? mmdtsdec is free, the only restriction is that you have to use it in a freeware (open or closed source) project.

Re: mmdtsdec writing to standard output

Posted: Sat Jun 07, 2014 1:54 pm
by MI3Guy
Right. My idea was to add a switch to suppress the error.

I was planning on using this in an open source program that I am writing.

Either one of these would be appreciated.