Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Any Pure Audio/BlueRayAudio Plugin? (Read 29868 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Any Pure Audio/BlueRayAudio Plugin?

Hi there. Anyone has a new plugin, enabling fb2K to read .m2ts files or tranforming .m2ts into something readable?

Any Pure Audio/BlueRayAudio Plugin?

Reply #1
You already asked this in another topic, in the General subforum. Have you tried decoding your files with FFMPEG yet?

So far as I know, there is nothing like this for foobar2000 yet, but there may be hope if FFMPEG supports decoding them.

Any Pure Audio/BlueRayAudio Plugin?

Reply #2
You already asked this in another topic, in the General subforum. Have you tried decoding your files with FFMPEG yet?

So far as I know, there is nothing like this for foobar2000 yet, but there may be hope if FFMPEG supports decoding them.


Hi kode54. You're right, but had no answer in the other topic, so I tried here, that looks the specific place where the topic had to be posted.
How can I proceed with ffmpeg? I have the file, because I have made the setup to transform FLACs into ALACs, but have no idea regarding
.m2ts. And I am moreover afraid to lose something of the original quality of these files, I mean, the Audio quality of the tracks is a real cake,
played with VLC and my personal DAC. I would like to extract the Audio tracks "as they are", without scaling or doing any lossy transformation.

Any Pure Audio/BlueRayAudio Plugin?

Reply #3
Here's Gentoo's tutorial for extracting Blu-Ray Audio, which should also apply to using recent ffmpeg binaries from Windows or building it with MacPorts or Homebrew on OS X.

Point is, if that can losslessly extract your audio, then technically, the foobar2000 standard inputs array could have the necessary parts of FFMPEG compiled in to decode the files directly, if Peter doesn't think it will have some sort of legal issue.

And, incidentally, I did reply to your topic, same as I replied to this one. If Open Source can decode them, then chances are, foobar2000 should be able to some day. And if FFMPEG is the exact Open Source which can decode them, then the correct parts of FFMPEG can be enabled in the version of the libav* components bundled with foobar2000, and the relevant formats can be enabled on the component side.


Any Pure Audio/BlueRayAudio Plugin?

Reply #5
Or you could use foo_input_exe. Works just fine together with ffmpeg.exe.


Sorry CoRoNe, but I am not that much familiar. Got foo_input_exe installed and ready under fb2k, what shall I do now to extract Audio from .m2ts in your way?

Any Pure Audio/BlueRayAudio Plugin?

Reply #6
Go to Preferences -> Playback -> Input -> Command-Line Decoder Wrapper.
Under Audio file formats click Add:



Under Additional decoder folders click Add and select ffmpeg.exe's folder.
That should do it.

Any Pure Audio/BlueRayAudio Plugin?

Reply #7
Go to Preferences -> Playback -> Input -> Command-Line Decoder Wrapper.
Under Audio file formats click Add:



Under Additional decoder folders click Add and select ffmpeg.exe's folder.
That should do it.


Done, and working. Thanks a lot, CoRoNe. It's very nice to be able to do it!!! I can see that now, the bitrate (kbps) is undefined (a couple of ?? is shown instead of the real value). Furthermore, I know that there are 3 tracks that can be read, but I am NOT prompted about which of the 3. Does it depend only from the ffmpeg command line I am using?

Any Pure Audio/BlueRayAudio Plugin?

Reply #8
Done, and working. Thanks a lot, CoRoNe. It's very nice to be able to do it!!! I can see that now, the bitrate (kbps) is undefined (a couple of ?? is shown instead of the real value). Furthermore, I know that there are 3 tracks that can be read, but I am NOT prompted about which of the 3. Does it depend only from the ffmpeg command line I am using?
[/quote]


Hi CoRoNe, I have tested, and have found the reason: your command takes ONLY the WAV track and plays it. No chance to extract different Audio tracks, if we do not specify different codecs.
I have seen it is possible to modify the command and specify different codecs, to access the other tracks, but now the problem is: How to read the trhd Audio track?
I suspect the related codec is not present... That is the TrueHD Audio track I am interested in!!!

Any Pure Audio/BlueRayAudio Plugin?

Reply #9
The reason bitrate, as well as duration, are unknown is because ffmpeg sends the audio to foobar through a pipe.

Very unlikely your m2ts-file contains a wav-stream. -f wav means you're forcing ffmpeg to send the audio in wav-format to foobar. Otherwise foobar doesn't know what to do with it.
Only the Decoder command is responsible for what you hear, so with the command shown in the screenshot it will decode the first audio-track it finds. If you want ffmpeg to decode another track you first have to find out its stream number. Open a command-prompt and enter: ffmpeg.exe -i <your_m2ts-file>. Stream 0:0 would most likely be the video-stream, stream 0:1 the 1st audio-track, stream 0:2 the 2nd audio-track and stream 0:3 the 3rd.

Now open the Command-Line Decoder Setup again:
ffmpeg.exe -i %s -map 0:3 -f wav -
This will decode the 3rd audio-track.

Any Pure Audio/BlueRayAudio Plugin?

Reply #10
The reason bitrate, as well as duration, are unknown is because ffmpeg sends the audio to foobar through a pipe.

Very unlikely your m2ts-file contains a wav-stream. -f wav means you're forcing ffmpeg to send the audio in wav-format to foobar. Otherwise foobar doesn't know what to do with it.
Only the Decoder command is responsible for what you hear, so with the command shown in the screenshot it will decode the first audio-track it finds. If you want ffmpeg to decode another track you first have to find out its stream number. Open a command-prompt and enter: ffmpeg.exe -i <your_m2ts-file>. Stream 0:0 would most likely be the video-stream, stream 0:1 the 1st audio-track, stream 0:2 the 2nd audio-track and stream 0:3 the 3rd.

Now open the Command-Line Decoder Setup again:
ffmpeg.exe -i %s -map 0:3 -f wav -
This will decode the 3rd audio-track.



ok, I checked as you wrote, and the PureAudio is exactly the 3rd track, ffmpeg says it is 96.000Hz, 32 bit, stereo.
Hence, I modified the codec command line in "ffmpeg.exe -i %s -map 0:3 -f wav -" and saved the codec.
But the properties in foobar are still showing 96.000 and 16 bit. I connected my M2Tech DAC, able to go up to 384.000 Hz and 32 bit,
just to have no doubt about the HW, configured the specific ASIO drivers, checked the DAC SW, and found that even the M2Tech SW still confirms
that the rendering is running at only 16 bit per sample.

Then, I defined a new converter inside fb2k, converting m2ts to WAV without any modification on bit depth, no dither, nothing else but WAV conversion,
and the result was..... a wav file at 96.000 Hz, 16 bit!  WTH??? How can ffmpeg say it is 32 bit, and then play it at only 16?

Any Pure Audio/BlueRayAudio Plugin?

Reply #11
Dear CoRoNe, just to be sure: I defined a new converter, and forced fb2k to convert the m2ts file into a WAV file, forced at 32 bit. The result is Wav file, at 96.000 and 32 bit, that is perfectly decoded by the whole chain, so I can conclude that all the chain is compatible with the format, but for some reason ffmpeg is not doing what we expect it to do. he recognize the track and extracts it, but cuts the number of bits per sample. Maybe. Or not? I would like to have the ORIGINAL 32 bits, and not to "invent" the missing 16 bits.

Any Pure Audio/BlueRayAudio Plugin?

Reply #12
Dear CoRoNe, I used the suggestion of Kode54 and, from within a cli, just wrote the following command:
ffmpeg -i "filem2tsname.m2ts" -map 0:3 -acodec pcm_s32le New32bit_file.wav

Well, the "New32bit_file.wav" is a 96.000 hz - 32 bit file, but I am not sure whether it is the original file, or the system has been forced to "upscale" the output up to 32 bits.

Anyway, I can now play the resulting wav file under fb2k, but the command line codec we have defined is not working the way we were expecting.
Maybe this can help correct that command line?



Any Pure Audio/BlueRayAudio Plugin?

Reply #15
[a href='index.php?showtopic=97414']foo_input_exe[/a]'s author

Any Pure Audio/BlueRayAudio Plugin?

Reply #16
Maybe it would be easier to use eac3to for that. Eac3to also supports container formats like m2ts, mkv, VOB... and not just audio files.

Any Pure Audio/BlueRayAudio Plugin?

Reply #17
ffmpeg -i "filem2tsname.m2ts" -map 0:3 -acodec pcm_s32le New32bit_file.wav

You are getting 32bit integer wav file because you request ffmpeg to do so by specifying pcm_s32le codec. And if you don't do so, you will always be getting 16bit integer wav instead. There may be a way to tell ffmpeg to keep original sample format, but I don't know.

And the track you want to extract from m2ts may vary with source files, but by "-map 0:3" you are blindly extracting 4th track (ffmpeg counts track number from zero).

In other words, using ffmpeg + foo_input_exe in such a way for general blurayaudio playback doesn't seem a sensible solution to me.
Why not just convert it to flac or something, and play it instead?

 

Any Pure Audio/BlueRayAudio Plugin?

Reply #18
ffmpeg -i "filem2tsname.m2ts" -map 0:3 -acodec pcm_s32le New32bit_file.wav

You are getting 32bit integer wav file because you request ffmpeg to do so by specifying pcm_s32le codec. And if you don't do so, you will always be getting 16bit integer wav instead. There may be a way to tell ffmpeg to keep original sample format, but I don't know.

And the track you want to extract from m2ts may vary with source files, but by "-map 0:3" you are blindly extracting 4th track (ffmpeg counts track number from zero).

In other words, using ffmpeg + foo_input_exe in such a way for general blurayaudio playback doesn't seem a sensible solution to me.
Why not just convert it to flac or something, and play it instead?


I always know which track is the right one, hence I can modify the command line accordingly. But I need to understand how to extract the original bits, without forcing. Once I get the REAL ORIGINAL PCM, I will convert to FLAC or others. Where can I study this part of ffmpeg into deep?

Any Pure Audio/BlueRayAudio Plugin?

Reply #19
ffmpeg -i "filem2tsname.m2ts" -map 0:3 -acodec pcm_s32le New32bit_file.wav

You are getting 32bit integer wav file because you request ffmpeg to do so by specifying pcm_s32le codec. And if you don't do so, you will always be getting 16bit integer wav instead. There may be a way to tell ffmpeg to keep original sample format, but I don't know.

And the track you want to extract from m2ts may vary with source files, but by "-map 0:3" you are blindly extracting 4th track (ffmpeg counts track number from zero).

In other words, using ffmpeg + foo_input_exe in such a way for general blurayaudio playback doesn't seem a sensible solution to me.
Why not just convert it to flac or something, and play it instead?


I always know which track is the right one, hence I can modify the command line accordingly. But I need to understand how to extract the original bits, without forcing. Once I get the REAL ORIGINAL PCM, I will convert to FLAC or others. Where can I study this part of ffmpeg into deep?

Any Pure Audio/BlueRayAudio Plugin?

Reply #20
Then use eac3to instead of ffmpeg.


Any Pure Audio/BlueRayAudio Plugin?

Reply #22
Yes. Use eac3to.exe %s stdout.wav. In case you need some other audio track (your example) you could use %s 4: stdout.wav. Didn't test with more than one audio track but should work. stdout.wav is for piping.

Any Pure Audio/BlueRayAudio Plugin?

Reply #23
Yes. Use eac3to.exe %s stdout.wav. In case you need some other audio track (your example) you could use %s 4: stdout.wav. Didn't test with more than one audio track but should work. stdout.wav is for piping.



Just downloaded, I'll keep you posted. And... how to get NERO7???

Any Pure Audio/BlueRayAudio Plugin?

Reply #24
If you need it for DTS HD (MA) decoding your better option is to go with Total Media Theatre 5 aka TMT5 and its DTS decoder (dtsdecoderdll.dll).