AC-4 Audio?

ATSC 3.0 Forum
Post Reply
mooninite
Posts: 22
Joined: Wed Dec 19, 2018 9:13 pm
x 4

Re: AC-4 Audio?

Post by mooninite »

Lost Dog wrote: Fri Jan 15, 2021 5:16 pm
mooninite wrote: Wed Dec 30, 2020 9:43 pm
That branch is against the main trunk. I compiled a 4.3.x version and Kodi now plays audio for ATSC 3.0 Dallas, TX stations (H.265 + AC-4).

I expect it will take a few months for slower distributions to get ffmpeg 4.4 / 5.0 that will carry this support, but we'll be there much sooner than I guessed.
I compiled the AC-4 branch of ffmpeg and using ffplay I got audio from a ATSC 3.0 stream!!! Woo hoo! This is a start!

How did you get Kodi playing the AC-4? Did you have to compile Kodi against the ffmpeg branch?
Fedora compiles Kodi with external ffmpeg support so updating ffmpeg is all I need to do. The distro you are using most likely uses the internal Kodi copy of ffmpeg and yes you will need to recompile Kodi.

Christian
Posts: 4
Joined: Wed Jan 20, 2021 1:29 pm

Re: AC-4 Audio?

Post by Christian »

ferrellsl wrote: Thu Jan 14, 2021 5:44 pm I completed a successful MSYS2 x64 build of ffmpeg that supports AC-4 audio streams and everything is working great for ATSC3.0/AC4 streams in the greater Phoenix area. For those who want to run the binaries outside of the MSYS2 shell, you will need to copy the following DLL files to the folder where your ffmpeg binaries ultimately reside.

They are:
libbz2-1.dll
libiconv-2.dll
libintl-8.dll
liblzma-5.dll
libstdc++-6.dll
libwinpthread-1.dll
libzstd.dll
SDL2.dll
zlib1.dll

On my system these DLL's are located in: C:\msys64\mingw64\bin

For those who want to conduct their own build, you can get the source for the AC-4/WIP here: https://github.com/richardpl/FFmpeg/tree/ac4

For those who don't want to build from source, you can download the Windows binaries from my DropBox account here: https://www.dropbox.com/s/eene7ecard5xk ... 4.zip?dl=1

An example command to play channel 161.1 here in Phoenix follows: C:\ffmpeg\bin>ffplay -i "http://192.168.2.142:5004/auto/v161.1?transcode=native" -ac 4
Substitute the IP address above with the correct IP address for your HD Homerun Tuner.


Enjoy!
Is it eventually possible that you could compile the shared libraries (avcodec-57.dll etc.) for win32 too? I try to create a basic player using ffmpeg libs with ac4, but I horribly failed under windows and on linux the build script for windows I am using is also not working.

Cheers
Christian

ferrellsl
Posts: 39
Joined: Sat Oct 17, 2020 11:57 pm
Location: Mesa, AZ
x 14
Contact:

Re: AC-4 Audio?

Post by ferrellsl »

(;-)
Last edited by ferrellsl on Fri May 07, 2021 4:39 pm, edited 1 time in total.

ferrellsl
Posts: 39
Joined: Sat Oct 17, 2020 11:57 pm
Location: Mesa, AZ
x 14
Contact:

Re: AC-4 Audio?

Post by ferrellsl »

(;-)
Last edited by ferrellsl on Fri May 07, 2021 4:39 pm, edited 1 time in total.

Lost Dog
Posts: 140
Joined: Tue Jul 03, 2007 11:46 pm
x 4

Re: AC-4 Audio?

Post by Lost Dog »

ferrellsl wrote: Thu Jan 21, 2021 12:03 pm VLC is a dumpster fire in terms of building. Problems range from regression errors to broken scripts. I spent a day and a half trying to build it against the AC-4 branch and whenever I fixed one problem it would expose 3 more so I'm giving up for now.
:lol:

I've been trying as well but I can't figure out how to get it to build off the ffmpeg-ac4 branch. At one point I thought I had tricked it by using the "contrib method" but got no ac-4 audio once it compiled.

Make sure you are using the latest release version of the source and not the main trunk. When I was using main it was nothing but compile errors. The vlc-3.0.12 source worked great (but without the ac-4 integration).

ferrellsl
Posts: 39
Joined: Sat Oct 17, 2020 11:57 pm
Location: Mesa, AZ
x 14
Contact:

Re: AC-4 Audio?

Post by ferrellsl »

(;-)
Last edited by ferrellsl on Fri May 07, 2021 4:39 pm, edited 1 time in total.

ferrellsl
Posts: 39
Joined: Sat Oct 17, 2020 11:57 pm
Location: Mesa, AZ
x 14
Contact:

Re: AC-4 Audio?

Post by ferrellsl »

Well, I made significant progress and was able to successfully build VLC against the AC-4 branch (64-bit Windows). I don't get any AC-4 audio playback though and the binary crashes on my Windows 10 machine but it runs just fine under Windows 7 and 8.

Here's my initial bootstrap:

../bootstrap --disable-chromaprint --host=i686-w64-mingw32 --disable-fluid --disable-fluidlite --disable-protobuf --disable-soxr

I had to disable chromaprint, protobuf, soxr and fluid due to errors and the make script also failed because it couldn't find libavcodec.a or nettle.a even though they were being built in the /vlc/contrib/i686-w64-ming32/lib folder. To get around this I just copied them to /usr/i686-w64-ming32/lib as I didn't feel like chasing down multiple scripts for a fix.

I'll keep fiddling with this and see if I can get AC-4 audio working but don't hold your breath.

75038EarlyAdopter
Posts: 1
Joined: Sat Nov 21, 2020 8:28 pm

Re: AC-4 Audio?

Post by 75038EarlyAdopter »

Worked great, played 149.1 here in Dallas.
ferrellsl wrote: Thu Jan 14, 2021 5:44 pm I completed a successful MSYS2 x64 build of ffmpeg that supports AC-4 audio streams and everything is working great for ATSC3.0/AC4 streams in the greater Phoenix area. For those who want to run the binaries outside of the MSYS2 shell, you will need to copy the following DLL files to the folder where your ffmpeg binaries ultimately reside....

ferrellsl
Posts: 39
Joined: Sat Oct 17, 2020 11:57 pm
Location: Mesa, AZ
x 14
Contact:

Re: AC-4 Audio?

Post by ferrellsl »

(;-)
Last edited by ferrellsl on Fri May 07, 2021 4:40 pm, edited 1 time in total.

Lost Dog
Posts: 140
Joined: Tue Jul 03, 2007 11:46 pm
x 4

Re: AC-4 Audio?

Post by Lost Dog »

ferrellsl wrote: Sat Jan 23, 2021 9:03 pm
Well, I'm gonna give the VLC build a rest. I've spent the better part of a week building and testing for Win64 with limited success. Adding the ffmpeg AC-4 branch to the build did not enable AC-4 audio playback as I had hoped so there have to be more adjustments that need to be made that are outside the scope of my abilities and patience. Hopefully Lost Dog will be successful with his efforts.
I've not had any luck on linux either. I've tried multiple attempts and ways to compile against the ffmpeg-ac4 branch but have had no luck. I get a clean compile but ac-4 audio never plays. Kodi was simple to get working!

ferrellsl
Posts: 39
Joined: Sat Oct 17, 2020 11:57 pm
Location: Mesa, AZ
x 14
Contact:

Re: AC-4 Audio?

Post by ferrellsl »

(;-)
Last edited by ferrellsl on Fri May 07, 2021 4:40 pm, edited 1 time in total.

kyl416
Posts: 192
Joined: Wed Sep 17, 2014 12:09 pm
Device ID: 1080DB11
Location: Tobyhanna, PA
x 30
Contact:

Re: AC-4 Audio?

Post by kyl416 »

VLC doesn't use ffmpeg's libavformat for demuxing streams, they use internal demuxers alongside libdvbpsi, so you have to add AC-4 as a recognized codec in key files like include/vlc_fourcc.h, src/misc/fourcc_list.h and modules/codec/avcodec/fourcc.c along with various files inside the modules/demux/mpeg, modules/demux/mp4 and modules/demux/mkv folders.

If you want a starting point, search for the string "EAC3" in the VLC source folder to see an example of how the code should be formatted in each file, then look at the patches made to add AC4 support to FFmpeg to get the correct fourcc values.

If you want to go the extra step and add support for AC4 passthru, you also need to add the values to the include/vlc_aout.h and modules/codec/spdif.c files along with various files inside modules/stream_out/chromecast and modules/audio_output folders.

ferrellsl
Posts: 39
Joined: Sat Oct 17, 2020 11:57 pm
Location: Mesa, AZ
x 14
Contact:

Re: AC-4 Audio?

Post by ferrellsl »

(;-)
Last edited by ferrellsl on Fri May 07, 2021 4:40 pm, edited 1 time in total.

kyl416
Posts: 192
Joined: Wed Sep 17, 2014 12:09 pm
Device ID: 1080DB11
Location: Tobyhanna, PA
x 30
Contact:

Re: AC-4 Audio?

Post by kyl416 »

ferrellsl wrote: Mon Jan 25, 2021 3:29 pmso it makes me wonder why ffmpeg is even one of the default build dependencies.
While they don't use ffmpeg's libavformat to handle some formats like mpeg, mp4, mkv, they still need it to handle many other media formats. They also need ffmpeg's libavcodec to decode and encode most audio and video, along with some other key ffmpeg libraries like libpostproc and libswscale.

ferrellsl
Posts: 39
Joined: Sat Oct 17, 2020 11:57 pm
Location: Mesa, AZ
x 14
Contact:

Re: AC-4 Audio?

Post by ferrellsl »

(;-)
Last edited by ferrellsl on Fri May 07, 2021 4:40 pm, edited 1 time in total.

Post Reply