PDA

View Full Version : on the FLY AAC to DD AC3 re-encode



itsmydamnation
09-09-2011, 04:48 PM
i would love an option (that could be selected on a per device basis) to enable on the fly re-encoding off just the audio if it is in AAC and re-encode it to DD AC3 5.1 . the reason, pretty much all samsung TV's will do DD AC3 5.1 over optical to an AV receiver / amp but not AAC. otherwise i will have to trans-code a lot of existing files.



personally i think that would be a pretty cool advantage over other DLNA servers.

cheers

Paul
09-09-2011, 04:56 PM
Mezzmo already does that (remuxing), if the video stream is deemed compatible with the device (as per the device profile). This is much quicker and less CPU-intensive than a full transcode.

itsmydamnation
09-09-2011, 04:58 PM
more info on it?how to enable etc? i have AAC that doesn't seem to be changed to AAC

Paul
09-09-2011, 04:59 PM
It depends on the device profile and your file. Please send in FFmpeg information on the file (in Mezzmo right-click on the file and use the "Get FFmpeg Information" command) and also the device profile that's used and we'll see how it matches up.

itsmydamnation
09-09-2011, 05:06 PM
ffmpeg version N-32348-g6dbac85, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 6 2011 16:03:56 with gcc 4.4.2
configuration: --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-mingw32- --enable-static --disable-shared --enable-zlib --disable-ffplay --prefix=/media/windows/ffmpeg --enable-libmp3lame --enable-libx264 --enable-gpl --extra-libs='-lx264 -lpthread' --enable-runtime-cpudetect --pkg-config=pkg-config
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 11. 0 / 53. 11. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[matroska,webm @ 003f8c60] max_analyze_duration 5000000 reached at 5019000
[matroska,webm @ 003f8c60] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska,webm, from 'D:\TV shows\ghost in the shell\S.A.C. 2nd GIG \ Ghost in the Shell S.A.C. 2nd GIG E01.mkv':
Duration: 00:24:32.37, start: 0.000000, bitrate: N/A
Chapter #0.0: start 0.000000, end 92.019000
Metadata:
title : Opening
Chapter #0.1: start 92.019000, end 749.092000
Metadata:
title : Part 1
Chapter #0.2: start 749.092000, end 1382.099000
Metadata:
title : Part 2
Chapter #0.3: start 1382.099000, end 1472.370000
Metadata:
title : Ending
Stream #0.0(jpn): Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
title : Episode 01 - Reembody
Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1, s16 (default)
Metadata:
title : English Dolby Digital 5.1ch AAC
Stream #0.2(jpn): Audio: aac, 48000 Hz, 5.1, s16
Metadata:
title : Japanese Dolby Digital 5.1ch AAC
Stream #0.3(eng): Subtitle: ssa (default)
Metadata:
title : English Lyrics/Signs
Stream #0.4(eng): Subtitle: ssa
Metadata:
title : English Subtitles
Stream #0.5: Attachment: ttf
Metadata:
filename : Androgyne_TB.otf
Stream #0.6: Attachment: ttf
Metadata:
filename : BellGothicStd-Black.otf
Stream #0.7: Attachment: ttf
Metadata:
filename : BellGothicStd-Bold.otf
Stream #0.8: Attachment: ttf
Metadata:
filename : Brianne_s_hand.ttf
Stream #0.9: Attachment: ttf
Metadata:
filename : ITCKabelStd-Medium.otf
Stream #0.10: Attachment: ttf
Metadata:
filename : kkberktp.ttf
Stream #0.11: Attachment: ttf
Metadata:
filename : POORICH.TTF
Stream #0.12: Attachment: ttf
Metadata:
filename : Sony_Sketch_EF.ttf
Stream #0.13: Attachment: ttf
Metadata:
filename : X-SCALE.TTF
Stream #0.14: Attachment: ttf
Metadata:
filename : YOUTHAN_.ttf
Stream #0.15: Attachment: ttf
Metadata:
filename : YOUTHANI.ttf
Stream #0.16: Attachment: ttf
Metadata:
filename : YOUTTX__.ttf
At least one output file must be specified


---> DB Level Info: 41, 100
---> Frame rate: 23.98
---> Aspect ratio: 16:9


using Samsung C on a PS50C6500 on mezzmo 2.4.3, on the TV i can only set PCM for audio out

one like this with AC3 as the encode, i can select DD


ffmpeg version N-32348-g6dbac85, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 6 2011 16:03:56 with gcc 4.4.2
configuration: --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-mingw32- --enable-static --disable-shared --enable-zlib --disable-ffplay --prefix=/media/windows/ffmpeg --enable-libmp3lame --enable-libx264 --enable-gpl --extra-libs='-lx264 -lpthread' --enable-runtime-cpudetect --pkg-config=pkg-config
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 11. 0 / 53. 11. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[matroska,webm @ 003f8c60] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska,webm, from 'D:\TV shows\stargate Universe\Stargate.Universe.S02E18.720p.HDTV.X264-DIMENSION.mkv':
Duration: 00:42:40.09, start: 0.000000, bitrate: 384 kb/s
Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 384 kb/s (default)
At least one output file must be specified


---> DB Level Info: 41, 100
---> Frame rate: 23.98
---> Aspect ratio: 16:9


cheers


edit: im about to test by re-encoding the first file as the second one is only 2.0

itsmydamnation
09-09-2011, 08:02 PM
ok, i have re-encoded as 5.1 AC3 and tested and it works fine, ie i can choose DD as the optical output


ffmpeg version N-32348-g6dbac85, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 6 2011 16:03:56 with gcc 4.4.2
configuration: --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-mingw32- --enable-static --disable-shared --enable-zlib --disable-ffplay --prefix=/media/windows/ffmpeg --enable-libmp3lame --enable-libx264 --enable-gpl --extra-libs='-lx264 -lpthread' --enable-runtime-cpudetect --pkg-config=pkg-config
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 11. 0 / 53. 11. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[matroska,webm @ 003f8c80] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) -> 23.98 (24000/1001)
Input #0, matroska,webm, from 'D:\TV shows\ghost in the shell\Ghost in the Shell S.A.C. 2nd GIG E01.mkv':
Duration: 00:24:32.22, start: 0.000000, bitrate: 384 kb/s
Stream #0.0: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0.1: Audio: ac3, 44100 Hz, 5.1(side), s16, 384 kb/s (default)
At least one output file must be specified


---> DB Level Info: 41, 100
---> Frame rate: 23.98
---> Aspect ratio: 16:9

itsmydamnation
09-11-2011, 12:11 PM
ok, i have re-encoded as 5.1 AC3 and tested and it works fine, ie i can choose DD as the optical output


ffmpeg version N-32348-g6dbac85, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 6 2011 16:03:56 with gcc 4.4.2
configuration: --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-mingw32- --enable-static --disable-shared --enable-zlib --disable-ffplay --prefix=/media/windows/ffmpeg --enable-libmp3lame --enable-libx264 --enable-gpl --extra-libs='-lx264 -lpthread' --enable-runtime-cpudetect --pkg-config=pkg-config
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 11. 0 / 53. 11. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[matroska,webm @ 003f8c80] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) -> 23.98 (24000/1001)
Input #0, matroska,webm, from 'D:\TV shows\ghost in the shell\Ghost in the Shell S.A.C. 2nd GIG E01.mkv':
Duration: 00:24:32.22, start: 0.000000, bitrate: 384 kb/s
Stream #0.0: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0.1: Audio: ac3, 44100 Hz, 5.1(side), s16, 384 kb/s (default)
At least one output file must be specified


---> DB Level Info: 41, 100
---> Frame rate: 23.98
---> Aspect ratio: 16:9



i know this is now in the wrong section and its also the weekend :P , but any word? ( if you guys work mon to fri, i'll just wait till tomorrow afternoon before bugging or anything :p)

Paul
09-12-2011, 08:50 AM
Yes, we only work Monday to Friday :)

That file will be passed through natively using the "Samsung C" device profile. That same profile will remux 5.1 AAC in an MP4 container to AC3, so perhaps if the TV cannot play 5.1 AAC (it should play stereo AAC in MKV though), then we can recode 5.1 AAC to 5.1 AC3, while leaving 2-channel AAC untouched. Do you have any MKVs with stereo AAC to test?

itsmydamnation
09-12-2011, 12:39 PM
Yes, we only work Monday to Friday :)

That file will be passed through natively using the "Samsung C" device profile. That same profile will remux 5.1 AAC in an MP4 container to AC3, so perhaps if the TV cannot play 5.1 AAC (it should play stereo AAC in MKV though), then we can recode 5.1 AAC to 5.1 AC3, while leaving 2-channel AAC untouched. Do you have any MKVs with stereo AAC to test?


i will have to check when i get home, if i dont i will just hack up a two channel AAC video by re-encoding DD5.1/DTS/AAC5.1 down to 2 channel AAC. so long as its in an mkv container its very quick to put it all back together thanks to mkvtools. i think 2 channel AAC will play fine as the audio in the 5.1 channel AAC itself plays fine on the TV but will only output in 2 channel PCM over the TOSLINK.

itsmydamnation
09-12-2011, 06:10 PM
ffmpeg version N-32348-g6dbac85, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 6 2011 16:03:56 with gcc 4.4.2
configuration: --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-mingw32- --enable-static --disable-shared --enable-zlib --disable-ffplay --prefix=/media/windows/ffmpeg --enable-libmp3lame --enable-libx264 --enable-gpl --extra-libs='-lx264 -lpthread' --enable-runtime-cpudetect --pkg-config=pkg-config
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 11. 0 / 53. 11. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[matroska,webm @ 003f8c60] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska,webm, from 'F:\videos\music\metallica-magnetic_tour_2009_live_at_arenes_de_nimes-x264-2009-pmv.mkv':
Duration: 01:34:55.28, start: 0.000000, bitrate: 384 kb/s
Stream #0.0(eng): Video: h264 (Main), yuv420p, 688x368 [SAR 203:211 DAR 8729:4853], SAR 184:191 DAR 344:191, 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 384 kb/s (default)
At least one output file must be specified


---> DB Level Info: 30, 77
---> Frame rate: 25.00
---> Aspect ratio: 344:191


this gets converted to DD???? :eek:

whoops, my mistake.....lol... left me find something thats AAC not DD/ac3...lol


edit:
i had to create this myself, it plays as PCM only out the TOSLINK



ffmpeg version N-32348-g6dbac85, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 6 2011 16:03:56 with gcc 4.4.2
configuration: --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-mingw32- --enable-static --disable-shared --enable-zlib --disable-ffplay --prefix=/media/windows/ffmpeg --enable-libmp3lame --enable-libx264 --enable-gpl --extra-libs='-lx264 -lpthread' --enable-runtime-cpudetect --pkg-config=pkg-config
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 11. 0 / 53. 11. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[matroska,webm @ 003f8c60] max_analyze_duration 5000000 reached at 5040000
[matroska,webm @ 003f8c60] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska,webm, from 'D:\TV shows\[OZC] Ghost in the Shell S.A.C. 2nd GIG E11 _Affection_ [Blu-Ray 1080p] (1).mkv':
Duration: 00:24:31.27, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
title : Episode 11 - Affection
Stream #0.1: Audio: aac, 48000 Hz, stereo, s16 (default)
Stream #0.2: Attachment: ttf
Metadata:
filename : Androgyne_TB.otf
Stream #0.3: Attachment: ttf
Metadata:
filename : BellGothicStd-Black.otf
Stream #0.4: Attachment: ttf
Metadata:
filename : BellGothicStd-Bold.otf
Stream #0.5: Attachment: ttf
Metadata:
filename : Brianne_s_hand.ttf
Stream #0.6: Attachment: ttf
Metadata:
filename : ITCKabelStd-Medium.otf
Stream #0.7: Attachment: ttf
Metadata:
filename : kkberktp.ttf
Stream #0.8: Attachment: ttf
Metadata:
filename : POORICH.TTF
Stream #0.9: Attachment: ttf
Metadata:
filename : Sony_Sketch_EF.ttf
Stream #0.10: Attachment: ttf
Metadata:
filename : X-SCALE.TTF
Stream #0.11: Attachment: ttf
Metadata:
filename : YOUTHAN_.ttf
Stream #0.12: Attachment: ttf
Metadata:
filename : YOUTHANI.ttf
Stream #0.13: Attachment: ttf
Metadata:
filename : YOUTTX__.ttf
At least one output file must be specified


---> DB Level Info: 41, 100
---> Frame rate: 23.98
---> Aspect ratio: 16:9

Paul
09-13-2011, 08:40 AM
That file plays natively though, right? So, AAC stereo doesn't need to be converted and everything works as-is, or am I missing your point (sorry, if I do!)? :)

itsmydamnation
09-13-2011, 10:29 AM
That file plays natively though, right? So, AAC stereo doesn't need to be converted and everything works as-is, or am I missing your point (sorry, if I do!)? :)

yep all files play fine natively. the "issue" is that the 5.1 aac isn't being converted to 5.1 DD/ac3, it appears the first file shown in this thread is being passed to my TV as something other then DD5.1 or DTS (i assume two channel PCM?) because of this i can only out put 2 channel PCM over my TOSLINK to my receiver not 5.1 channel DD or DTS.

worse comes to worest i can alway re-encode just the audio to ac3 or DTS (major pain, only if bitrate is needed) and then remux the ac3 audio into the mkv but if mezzmo could handle this for me it would be so much better!

cheers

Paul
09-13-2011, 01:17 PM
Ok, got it :) You mean this file: "D:\TV shows\ghost in the shell\S.A.C. 2nd GIG \ Ghost in the Shell S.A.C. 2nd GIG E01.mkv" ? We'll need to modify the device profile a bit for it to transcode 5.1 AAC to 5.1 AC3 (currently it's passing it through, so I guess your TV is downsampling it to stereo PCM). Are you comfortable editing the device profile, or would you prefer me to send you an updated one?

itsmydamnation
09-13-2011, 01:48 PM
Ok, got it :) You mean this file: "D:\TV shows\ghost in the shell\S.A.C. 2nd GIG \ Ghost in the Shell S.A.C. 2nd GIG E01.mkv" ? We'll need to modify the device profile a bit for it to transcode 5.1 AAC to 5.1 AC3 (currently it's passing it through, so I guess your TV is downsampling it to stereo PCM). Are you comfortable editing the device profile, or would you prefer me to send you an updated one?

i am more then happy to hack at stuff :P

Paul
09-13-2011, 01:52 PM
Ok, then edit the SamsungLA.prf device profile (for "Samsung C") using Notepad (device profiles are here: http://forum.conceiva.com/showthread.php/467-FAQ-Where-are-device-profiles-located) and change:



<audio>
<format id="aac" encode="0">
</format>
</audio>


in the "matroska" container to:



<audio>
<format id="aac" encode="0">
<channels>1</channels>
<channels>2</channels>
</format>
</audio>


After that restart the server and try again. Please let me know how that goes.

itsmydamnation
09-13-2011, 02:08 PM
will do but wont be able to test until i get home tonight,
is there something that explains the schema?

if i was to take a guess we are saying, pass 1 and 2 channel AAC natively to the TV, then there is some other logic else where that tells it to transconde/mux the audio to ac3? (catch all clause)

the first example tells mezzmo to pass all aac to the tv?

Paul
09-13-2011, 02:11 PM
if i was to take a guess we are saying, pass 1 and 2 channel AAC natively to the TV, then there is some other logic else where that tells it to transconde/mux the audio to ac3?
Yes, that's right. If AAC is not 1 or 2 channels, we remux to AC3, since it's the closest match in the same container.

itsmydamnation
09-13-2011, 06:38 PM
Yes, that's right. If AAC is not 1 or 2 channels, we remux to AC3, since it's the closest match in the same container.

samsung C is samsungLA right?


<avcontainer id="matroska" name="mkv" encode="1" mimetype="video/x-mkv" dlnaprofile="MKV" preferredtranscoded="1" format="matroska" supportschunked="0" level="41">
<video>
<format id="mpeg4" encode="0">
</format>
</video>
<video>
<format id="h264" encode="1" codec="libx264" preferredtranscoded="1">
<copyts>0</copyts>
<samequality>0</samequality>
</format>
</video>
<video>
<format id="mpeg2video" encode="0">
</format>
</video>
<video>
<format id="vc1" encode="0">
</format>
</video>
<audio>
<format id="ac3" encode="1" codec="ac3" preferredtranscoded="1">
<channels>1</channels>
<channels>2</channels>
<channels>6</channels>
<maxbitrate>640000</maxbitrate>
<bitrate>448000</bitrate>
<maxsamplingrate>48000</maxsamplingrate>
<minsamplingrate>11025</minsamplingrate>
<samplingrate>48000</samplingrate>
<samplingrate>44100</samplingrate>
<samplingrate>32000</samplingrate>
</format>
</audio>
<audio>
<format id="aac" encode="0">
<channels>1</channels>
<channels>2</channels>
</format>
</audio>

added this and it still isn't sending as AC3.
mezzmo log file
http://www.users.on.net/~rastus/mezzmo/2011-09-13-19-27-17-MezzmoMediaService.txt

cheers

Paul
09-14-2011, 08:42 AM
Yes, it's SamsungLA.prf. I see you've adjusted the Advanced settings in your device profile - please reset those back to default and try again. They alter the way things are delivered and generally should be left alone.

itsmydamnation
09-14-2011, 11:49 AM
Yes, it's SamsungLA.prf. I see you've adjusted the Advanced settings in your device profile - please reset those back to default and try again. They alter the way things are delivered and generally should be left alone.

tried with everything back to default (automatic delivery) and that didn't seem to make a difference.

let me know if you want a new log capture with everything back to auto


cheers

Paul
09-14-2011, 12:09 PM
Yes, please send in new logs to support.

itsmydamnation
09-17-2011, 09:01 AM
Yes, please send in new logs to support.

sry been a little busy the last few days
http://www.users.on.net/~rastus/mezzmo/2011-09-17-09-54-05-MezzmoMediaService.txt

cheers

Paul
09-19-2011, 08:45 AM
Thank you for the logs (in the future, please don't post logs here, but send them to support) - the logs show that you transcoding turned off, please turn it on and try again.