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.
mmdtsdec writing to standard output
Re: mmdtsdec writing to standard output
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.
-
- Posts: 4075
- Joined: Wed Nov 26, 2008 2:26 am
- Contact:
Re: mmdtsdec writing to standard output
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
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.
-
- Posts: 4075
- Joined: Wed Nov 26, 2008 2:26 am
- Contact:
Re: mmdtsdec writing to standard output
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: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.
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.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.
Re: mmdtsdec writing to standard output
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.
I was planning on using this in an open source program that I am writing.
Either one of these would be appreciated.