Hydrogenaudio Forums

Lossy Audio Compression => AAC => AAC - General => Topic started by: sparrow on 2018-02-02 22:59:13

Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-02 22:59:13
Hi there,

Are there some tools to extract the raw AAC from the MPEG2 TS?

Need an answer ASAP Please :)

Thank you
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Dusty on 2018-02-03 02:54:54
Hi there,

Are there some tools to extract the raw AAC from the MPEG2 TS?

Need an answer ASAP Please :)

Thank you
A tool I find very useful for extracting audio from video, or just losslessy clipping audio or video in general is Xmedia recode.
https://www.xmedia-recode.de/en/download.html
Hit open file and open the video file, under format choose "custom" and on the dropdowns do m4a, then in the audio tab hit Mode: copy, change your destination if needed, if you need it clipped at certain times go to the filters/preview tab and go to the start time to ____ thing. When you are done, hit add to queue and hit encode.
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: silverprout on 2018-02-03 07:12:33
Hi there,
Are there some tools to extract the raw AAC from the MPEG2 TS?
Need an answer ASAP Please :)
Thank you


ts muxer can separate the audio track from the video container without any encoding.
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-03 08:05:37
Hi there

Thank you so much for your help guys, Truly thank you :)

I have tried a quite a bit of programs but can't seem to be able to do it

When you right click the file and go to Details TAB it says
Bit rate 256kbps
Channels 2 stereo
Audio sample rate 48kHz

I would like to demux the original raw file 256kbps / 48kHz

Link to my file (8GB) a bit big but that's what it is
https://www.dropbox.com/s/nzhvepysom67w2e/bruno.rar?dl=0

I'm uploading the file to my Dropbox, it should be done in about 30-60mins

feel free to download and experiment

Thank you so so so much guys :)
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Case on 2018-02-03 09:50:11
Audio seems to use LATM format which isn't that well supported. One way to get the audio extracted in a working condition is to use eac3to with -demux parameter (eac3to -demux bruno.ts) and wait for it to write audio and video streams to separate files. Then use mkvtoolnix to convert the .aac file to .mka. Now you can use ffmpeg with command ffmpeg -i newfile.mka -c:a copy bruno.m4a to have a usable audio file.
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-03 11:31:58
Hi there,

Are there some tools to extract the raw AAC from the MPEG2 TS?

Need an answer ASAP Please :)

Thank you
A tool I find very useful for extracting audio from video, or just losslessy clipping audio or video in general is Xmedia recode.
https://www.xmedia-recode.de/en/download.html
Hit open file and open the video file, under format choose "custom" and on the dropdowns do m4a, then in the audio tab hit Mode: copy, change your destination if needed, if you need it clipped at certain times go to the filters/preview tab and go to the start time to ____ thing. When you are done, hit add to queue and hit encode.
there is only convert option, the copy option is not there
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Phanton_13 on 2018-02-03 14:37:32
Do you whant a gui tool or a command line, in comand line ffmpeg can do it, I don't know any gui to do it but I can think of a hack using mkvtoolnix and mkvcleaver.
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-03 22:14:56
I have tried what you've said (Phanton_13 )but ended up only with 127kbps file

Don't know what I'm doing wrong

ffmpeg I believe it needs to be MAC version to have AAC encoder
Windows one doesn't have it


HERE is the new link to the File
Sign in or create an account for OneDrive to download

https://1drv.ms/u/s!ArJ8rhoDYk4et1uGU4sA4I6I6LkK

PS: my other link for Dropbox has reached its daily download limit lol, but OneDrive doesn't have download limits I believe

Feel free to download and experiment with it

Once again I really appreciate all your kind help :)
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-03 22:23:59
Audio seems to use LATM format which isn't that well supported. One way to get the audio extracted in a working condition is to use eac3to with -demux parameter (eac3to -demux bruno.ts) and wait for it to write audio and video streams to separate files. Then use mkvtoolnix to convert the .aac file to .mka. Now you can use ffmpeg with command ffmpeg -i newfile.mka -c:a copy bruno.m4a to have a usable audio file.
Audio seems to use LATM format which isn't that well supported. One way to get the audio extracted in a working condition is to use eac3to with -demux parameter (eac3to -demux bruno.ts) and wait for it to write audio and video streams to separate files. Then use mkvtoolnix to convert the .aac file to .mka. Now you can use ffmpeg with command ffmpeg -i newfile.mka -c:a copy bruno.m4a to have a usable audio file.
that did not result in 256kbps file unfortunately

HERE is the new link to the File
Sign in or create an account for OneDrive to download

https://1drv.ms/u/s!ArJ8rhoDYk4et1uGU4sA4I6I6LkK

Feel free to download and experiment with it

I appreciate your help

Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Case on 2018-02-04 09:43:56
Only thing I see claiming the audio to be 256 kbps is Windows Explorer's details info. No tool I have shows the file to contain more than one video track and one audio track. The audio track extraction is lossless, and the extracted audio sounds the same as the original source file as played by various media players. My opinion is that if you somehow get a 256 kbps audio out of the file it is a transcode.

As an additional test I remuxed the .ts file to Matroska and the more efficient container format dropped the size to match the combined size of the video and audio streams eac3to demuxing produced. And I noticed this method allows bypassing the eac3to step as ffmpeg can now extract a proper AAC stream from the matroska (ffmpeg -i bruno.mkv -c:a copy -vn bruno.m4a).
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Phanton_13 on 2018-02-04 11:25:52
The bitrate that windows give is only a guess and sometimes that guess is really bad, basically it tends to guive the maximun bitrate not the nean one when the file uses variable bitrate or any of its incarnations.
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Maggi on 2018-02-04 12:39:24
I'd like to help out, but I refuse to create a MS account just for downloading it...
Maybe somebody could upload it it to another hoster like https://mega.nz/ for example ?
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-04 17:24:40
I'd like to help out, but I refuse to create a MS account just for downloading it...
Maybe somebody could upload it it to another hoster like https://mega.nz/ for example ?
OK I will upload it to mega.nz later today when I come back from work
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Maggi on 2018-02-04 19:15:03
Ok, but it'll be a few hours, before I can have a look at it.
It's already 8:15pm over here, so I'll have a look at it tomorrow.

In regards to:
ffmpeg I believe it needs to be MAC version to have AAC encoder
Windows one doesn't have it
ffmpeg always had a built-in AAC encoder, but until two years ago (https://trac.ffmpeg.org/wiki/Encode/AAC#NativeFFmpegAACEncoder), it was considered as experimental.
 ;)
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: jaybeee on 2018-02-05 10:33:02
you should use MediaInfo (https://mediaarea.net/en/MediaInfo) to interrogate video & audio files for their technical information; not Windows.
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Porcus on 2018-02-05 11:08:37
AAC encoder
You should not encode, you just want to demux out the audio, right?
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-05 11:13:25
AAC encoder
You should not encode, you just want to demux out the audio, right?

yes just to demux the original aac audio file without any conversion
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Porcus on 2018-02-05 11:41:51
Then Case's reply.

By the way, LATM is restricted to only a single audio stream, isn't it? So if it is LATM, there should not be any second stream in there?
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: ErnestS on 2018-02-05 12:27:20
there is only convert option, the copy option is not there
Please post a screenshot with the information I highlighted in this (https://image.ibb.co/egWtkc/XMR.png) screenshot.
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Bero1707 on 2018-02-05 13:18:31
You can use DVD Audio Extractor
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-05 21:47:06
I'd like to help out, but I refuse to create a MS account just for downloading it...
Maybe somebody could upload it it to another hoster like https://mega.nz/ for example ?
OK I've uploaded it to mega.co.nz as well, so here is the link

https://mega.nz/#!t4hwFJpb!YJhkhFW4m045ongO5lyOGeguZbIFfV3KAUwcC7nmMhQ
 
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-05 22:33:37
there is only convert option, the copy option is not there
Please post a screenshot with the information I highlighted in this (https://image.ibb.co/egWtkc/XMR.png) screenshot.
I've uploaded XMedia Recode Screenshot to mega.co.nz, here is the link

https://mega.nz/#!1goV3JCL!1Ov2ozDcqY80WowF_lJYxGVyXu2Flyx36lOTIpeHGY0
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Maggi on 2018-02-06 09:48:22
Ok then, I downloaded it and this must be the most exotic media file, I've ever encountered ... :D

MediaInfo shows these audio details:
Code: [Select]
Audio 
ID : 528 (0x210)
Menu ID : 1 (0x1)
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Format settings : NBC
Muxing mode : LATM
Codec ID : 17-5
Duration : 1 h 15 min
Bit rate mode : Variable
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz / 24.0 kHz
Frame rate : 23.438 FPS (1024 SPF)
Compression mode : Lossy

MPC-HC identifies the audio stream as
Code: [Select]
Audio
ID                             : 528 (0x210)
Menu ID                        : 1 (0x1)
Format                         : AAC
Format/Info                    : Advanced Audio Codec
Format profile                 : HE-AAC / LC
Muxing mode                    : LATM
Codec ID                       : 17
Duration                       : 1 h 15 min
Bit rate mode                  : Variable
Channel(s)                     : 2 channels
Channel positions              : Front: L R
Sampling rate                  : 48.0 kHz / 24.0 kHz
Frame rate                     : 23.438 FPS (1024 SPF)
Compression mode               : Lossy

FFMPEG says:
Code: [Select]
Stream #0:1[0x210]: Audio: aac_latm (HE-AAC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp

tsMuxeR cannot even detect the audio stream at all  :o

TS Doctor throws a bucket load of errors (+4000) when trying to fix the stream.
Code: [Select]
ES  ERROR  : Sequence Parameter Set (1) video_full_range_flag byte is 184 and should be 112 !

Smart Cutter identifies the audio stream as "AAC LATM"

...

I'll post back, when (if) I was able to extract the audio stream properly.
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-06 10:44:18
Ok then, I downloaded it and this must be the most exotic media file, I've ever encountered ... :D

MediaInfo shows these audio details:
Code: [Select]
Audio 
ID : 528 (0x210)
Menu ID : 1 (0x1)
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Format settings : NBC
Muxing mode : LATM
Codec ID : 17-5
Duration : 1 h 15 min
Bit rate mode : Variable
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz / 24.0 kHz
Frame rate : 23.438 FPS (1024 SPF)
Compression mode : Lossy

MPC-HC identifies the audio stream as
Code: [Select]
Audio
ID                             : 528 (0x210)
Menu ID                        : 1 (0x1)
Format                         : AAC
Format/Info                    : Advanced Audio Codec
Format profile                 : HE-AAC / LC
Muxing mode                    : LATM
Codec ID                       : 17
Duration                       : 1 h 15 min
Bit rate mode                  : Variable
Channel(s)                     : 2 channels
Channel positions              : Front: L R
Sampling rate                  : 48.0 kHz / 24.0 kHz
Frame rate                     : 23.438 FPS (1024 SPF)
Compression mode               : Lossy

FFMPEG says:
Code: [Select]
Stream #0:1[0x210]: Audio: aac_latm (HE-AAC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp

tsMuxeR cannot even detect the audio stream at all  :o

TS Doctor throws a bucket load of errors (+4000) when trying to fix the stream.
Code: [Select]
ES  ERROR  : Sequence Parameter Set (1) video_full_range_flag byte is 184 and should be 112 !

Smart Cutter identifies the audio stream as "AAC LATM"

...

I'll post back, when (if) I was able to extract the audio stream properly.
If the bit rate is Variable, then what original raw bit rate can we demux 128kbps or 256kbps or what?

Anyway thank you so much everyone for helping with this BS :)

Keep on working on this boys and girls we're almost there :)
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-06 10:48:51
To be honest I would just buy the original DVD and demux the audio that way but can't find the DVD

Only managed to find it sell in Brazil but they don't ship overseas
Link:
https://produto.mercadolivre.com.br/MLB-756804467-bruno-mars-ao-vivo-summer-soul-festival-brasil-2012-_JM

If you find it selling anywhere else please please please let me know
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Maggi on 2018-02-06 13:33:39
Wow ... that stubborn thing was quite a pita ... :D

However, I managed to extract the audio stream into a playable format without any re-encoding, using a combination of ffmpeg and yamb.

Step1:
Extract audio stream from the original ts file with ffmpeg and put it into m4a container
Code: [Select]
ffmpeg -i bruno.ts -map 0:a -acodec copy "bruno_audio_ffmpeg.m4a"
-> result cannot be played back in MPC-HC


Step2:
Demux the resulting file with YAMB to raw audio stream (bruno_ffmpeg_yamb.m4a)
-> result plays back fine in MPC-HC, but cannot be scrubbed


Step3: remux the yamb output with ffmpeg to Quicktime container
Code: [Select]
ffmpeg -i bruno_audio_ffmpeg.m4a -map 0:a -acodec copy -f mov "bruno_ffmpeg_yamb_QT.mov"
-> result plays back fine in MPC-HC, and can be scrubbed


Step4: repeat Step 1
Remux ffmpeg's QT output to m4a using ffmpeg
Code: [Select]
ffmpeg -i bruno_ffmpeg_yamb_QT.mov -map 0:a -acodec copy "bruno_audio_final.m4a"
-> result plays back fine in MPC-HC, and can be scrubbed


Interestingly, Step3 resulted in a change of the format tag from "LATM/AAC" to "MPEG-4/ADPCM", but it is still the original stream inside with a variable bitrate of ~128kb/s, since no transcoding was involved at any stage.

You can grab the result here (https://we.tl/CnI8l2VEdq).

:)

Let me know, if it plays back fine on your end as well or if you encounter any issues.

Cheers,
Maggi
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Porcus on 2018-02-06 14:01:31
Step2:
Demux the resulting file with YAMB to raw audio stream (bruno_ffmpeg_yamb.m4a)
Does YAMB output a "raw audio stream" and yet give it the suffix "m4a"?

It is easier to ask than to download 8 GB, so:
* What happens if ffmpeg tries to output raw aac, like:
ffmpeg -i bruno.ts -map 0:a -acodec copy "bruno_audio_ffmpeg.aac"
* Bitstream filters are only for "the other direction"?
* There is a "latm" option mentioned at https://ffmpeg.org/ffmpeg-formats.html#Format-Options ... ?
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Maggi on 2018-02-06 15:15:39
Step2:
Demux the resulting file with YAMB to raw audio stream (bruno_ffmpeg_yamb.m4a)
Does YAMB output a "raw audio stream" and yet give it the suffix "m4a"?
Damn good catch, Porcus ... ;)

No, there was no extension, but I was lazy and added m4a so that MPC-HC would open it for me.
The actual output was named "bruno_ffmpeg_track1" and when I manually drag it onto MPC-HC, I get this basic information
Code: [Select]
Audio: AAC(LATM) 48000Hz stereo [A: aac (latm) he-aac, 48000 Hz, stereo]
MediaInfo reports:
Code: [Select]
General 
Complete name : bruno_ffmpeg_track1
Format : LATM
File size : 69.5 MiB
Overall bit rate mode : Variable

Audio
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Format settings : NBC
Codec ID : 5
Bit rate mode : Variable
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz / 24.0 kHz
Frame rate : 23.438 FPS (1024 SPF)
Compression mode : Lossy
Which are both exactly the same as from the file I manually added the m4a extension to.

* What happens if ffmpeg tries to output raw aac, like:
ffmpeg -i bruno.ts -map 0:a -acodec copy "bruno_audio_ffmpeg.aac"
It results in a file that cannot be played back at all and has severly broken meta data.

MediaInfo says:
Code: [Select]
General 
Complete name : bruno_ffmpeg.aac
Format : ADTS
Format/Info : Audio Data Transport Stream
File size : 70.2 MiB
Overall bit rate mode : Variable
Comment : q¾ë•mGð­\àÙï#ÕóG£¤ôF/õœà°•sEj)ýÈÕ…d½#õˆ4.ᓸ™ñòÂОÈFàHzÿ]„`ÀŽTMۍ§ / ðý;µC‹î7¿ší—z™G• ÷i(åöJØoÁxôÚš–8wrJÕ¶+%͐t`á

Audio
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : HE-AAC / LC
Format settings : NBC
Codec ID : 2
Bit rate mode : Variable
Channel(s) : 21 channels
Channel positions : Front: 12, Side: 7, Back: C, LFE
Sampling rate : 48.0 kHz / 24.0 kHz
Frame rate : 23.438 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 70.2 MiB (100%)
 

* Bitstream filters are only for "the other direction"?
dunno and tbh, I couldn't be bothered to dig for other approaches, after I started making progress with ffmpeg & yamb
;)

* There is a "latm" option mentioned at https://ffmpeg.org/ffmpeg-formats.html#Format-Options ... ?
I've seen that option too, but as I understand it, this is only used for muxing into TS and I wanted to demux the audio stream, so I didn't pay any further attention to it.

Feel free to ask more...  8)

Cheers !
Maggi
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-07 06:07:02
Ok everyone  this is the demuxed audio AAC file I've got simply with using "mkvtoolnix"

https://mega.nz/#!llwxDBBb!s_OtpkkL2qlOPyQ8JjHoQPkS0PrEg7JJ7xN8NJsWceg

128kbps
48khz

is it the original raw file?
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Phanton_13 on 2018-02-07 13:12:13
Yo can check it out with ffmpeg using the hash multiplexer:

ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt

If both hashes are the same then the audio track is the same, this is true unless the file was decoded to lossless as then the decodec file can have the same hash. The commands are different due the need to discard the video part from the video file, and if there where various audio tracks then a selection track switch is needed.
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-07 17:21:28
Yo can check it out with ffmpeg using the hash multiplexer:

ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt

If both hashes are the same then the audio track is the same, this is true unless the file was decoded to lossless as then the decodec file can have the same hash. The commands are different due the need to discard the video part from the video file, and if there where various audio tracks then a selection track switch is needed.
Yo can check it out with ffmpeg using the hash multiplexer:

ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt

If both hashes are the same then the audio track is the same, this is true unless the file was decoded to lossless as then the decodec file can have the same hash. The commands are different due the need to discard the video part from the video file, and if there where various audio tracks then a selection track switch is needed.
can you try to do it, i'm not good at it
please
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: Porcus on 2018-02-07 17:56:38
So at least with my build:
* No "latm" in the output of "ffmpeg -demuxers".
* But "latm" is listed in the output of "ffmpeg -muxers".  And of "ffmpeg -formats".

I take that to mean that ffmpeg considers this "write-only".

* There is a "latm" option mentioned at https://ffmpeg.org/ffmpeg-formats.html#Format-Options ... ?
I've seen that option too, but as I understand it, this is only used for muxing into TS and I wanted to demux the audio stream, so I didn't pay any further attention to it.

Obviously. I only took note that it is mentioned not only in section 4 ("Muxers") but also in section 2, which claims to concern "some generic global options, which can be set on all the muxers and demuxers". But there is no demuxer for it ... at least not in my build.
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Phanton_13 on 2018-02-07 19:16:03
thry give me the same hash, then they are the same audio track.
Title: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-09 08:14:22
Ok this is the original cd in flac

https://mega.nz/#!gwhExKTB!HoFR8Sy8Up5IJvJA7DQ10vrPYmdX4Wu2N36aFqv8TW8
AND

This is the 8gb video file from a DVD that you were testing
https://mega.nz/#!t4hwFJpb!YJhkhFW4m045ongO5lyOGeguZbIFfV3KAUwcC7nmMhQ

They have the same songs from the same Bruno Mars Concert in Brazil, Sao Paulo

Can you compare the sound quality and tell me which one sounds better to you?

Please
Let me know I'm really interested
I know which one I prefer but would like your advice as well

Thank you in advance guys
Happy listening
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-09 21:56:19
Yo can check it out with ffmpeg using the hash multiplexer:

ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt

If both hashes are the same then the audio track is the same, this is true unless the file was decoded to lossless as then the decodec file can have the same hash. The commands are different due the need to discard the video part from the video file, and if there where various audio tracks then a selection track switch is needed.
I have tried that
I have used the original Bruno.ts (8GB) file to check if the audio quality is identical with hash multiplexer:
ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt
BUT the audio hash was different from the video hash, I thought at least the same source file for both commands will give me the same hash
I don't get it
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: Phanton_13 on 2018-02-10 00:10:39
Yo can check it out with ffmpeg using the hash multiplexer:

ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt

If both hashes are the same then the audio track is the same, this is true unless the file was decoded to lossless as then the decodec file can have the same hash. The commands are different due the need to discard the video part from the video file, and if there where various audio tracks then a selection track switch is needed.
I have tried that
I have used the original Bruno.ts (8GB) file to check if the audio quality is identical with hash multiplexer:
ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt
BUT the audio hash was different from the video hash, I thought at least the same source file for both commands will give me the same hash
I don't get it

That is due to how the hash multiplexer works, also how I put it is confusing as audio was intended to reference thee aac file and video to reference the ts file. Those comands where not perfect but they where fit for you case as there where only one audio and on video stream in the ts file.

This calculate the hash of the decoded data: "ffmpeg -i input -f hash -hash sha512 output" it autoselects the beast audio and video streams (and the first high quality one when various streams have hightest quality at the same time), this line give different hash if the file contains only audio or audio+video, "-vn" disables the video making that ffmpeg only calculates the data of the best audio stream. A more correct comand for calculating hash of and individual audio stream is using "-map" like in "ffmpeg -i input -map a:0 -f hash -hash sha512 out" the "-a:0" mean fist audio stream (second audio stream is "-a:1" and so on).

And for the quality of the audio is a personal matter as I think that the CD is going to be compressed to boot loudness where the one in the ts is going to have more dinamic range.
Title: Re: Re: how to extract the raw aac from MPEG2 TS?
Post by: sparrow on 2018-02-10 07:31:52
Yo can check it out with ffmpeg using the hash multiplexer:

ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt

If both hashes are the same then the audio track is the same, this is true unless the file was decoded to lossless as then the decodec file can have the same hash. The commands are different due the need to discard the video part from the video file, and if there where various audio tracks then a selection track switch is needed.
I have tried that
I have used the original Bruno.ts (8GB) file to check if the audio quality is identical with hash multiplexer:
ffmpeg -i audio -f hash -hash sha512 audio.txt
ffmpeg -i video -vn -f hash -hash sha512 video.txt
BUT the audio hash was different from the video hash, I thought at least the same source file for both commands will give me the same hash
I don't get it

That is due to how the hash multiplexer works, also how I put it is confusing as audio was intended to reference thee aac file and video to reference the ts file. Those comands where not perfect but they where fit for you case as there where only one audio and on video stream in the ts file.

This calculate the hash of the decoded data: "ffmpeg -i input -f hash -hash sha512 output" it autoselects the beast audio and video streams (and the first high quality one when various streams have hightest quality at the same time), this line give different hash if the file contains only audio or audio+video, "-vn" disables the video making that ffmpeg only calculates the data of the best audio stream. A more correct comand for calculating hash of and individual audio stream is using "-map" like in "ffmpeg -i input -map a:0 -f hash -hash sha512 out" the "-a:0" mean fist audio stream (second audio stream is "-a:1" and so on).

And for the quality of the audio is a personal matter as I think that the CD is going to be compressed to boot loudness where the one in the ts is going to have more dinamic range.
thank you my friend, that is what I have experienced
the cd to me sounds not listenable, especially in loud volume
AND
the ts file sounds more like a DSD format type of audio file where you can relax and do other stuff and you can enjoy it in the same time especially listening to it loud

The TS file has the audio separated in a very listenable way, cd gives me a headache
SimplePortal 1.0.0 RC1 © 2008-2018