Opened 18 months ago

Last modified 2 months ago

#8349 open enhancement

Dolby AC-4 Support

Reported by: Nomis101 Owned by:
Priority: wish Component: undetermined
Version: git-master Keywords:
Cc: wrb2c@riede.org, talkenrain@gmail.com, ffmpeg@tmm1.net Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

It would be nice to support the detection, muxing and demuxing of Dolby AC-4 audio streams (in MP4 and MKV).

Information: https://dolbyac4.com/
Specs: https://www.dolby.com/us/en/technologies/ac-4/Next-Generation-Entertainment-Services.pdf
Sample files: http://testassets.dashif.org/#testcase/details/586fb3879ae9045678eab64f

MediaInfo? 19.09 added support for AC-4, so it would be nice to have support in FFmpeg as well.
https://mediaarea.net/MediaInfo/ChangeLog

Attachments (2)

frame-20-789726256.mpa (24.9 KB) - added by siryurian 4 months ago.
AC-4 sample from ATSC3.0
atsc3.ts (1.6 MB) - added by csdesigns 3 months ago.
ATSC 3.0 OTA 5.1

Download all attachments as: .zip

Change History (50)

comment:1 Changed 18 months ago by richardpl

  • Resolution set to wontfix
  • Status changed from new to closed

comment:2 Changed 18 months ago by richardpl

  • Component changed from avcodec to undetermined
  • Priority changed from normal to wish
  • Resolution wontfix deleted
  • Status changed from closed to reopened

comment:4 Changed 6 months ago by wriede

  • Cc wrb2c@riede.org added

ATSC3.0 Broadcast video uses AC-4 sound. Support for AC-4 in ffmpeg appears to be required for Plex TV to be used to play such video streams. I would like to see renewed urgency for this feature. Unfortunately I don't have enough knowledge on the subject to program something like this but I would be happy to help testing if that's of use.

comment:5 Changed 5 months ago by vogateer

I'd be willing to contribute a bit on money if it would help get AC-4 supported. Is there a preferred mechanism for funding such feature requests?

comment:6 Changed 5 months ago by talkenrain

  • Cc talkenrain@gmail.com added

There is a growing need for Dolby AC4 support within ffmpeg. As ATSC 3.0 broadcast becomes mainstream across the US many applications (like PLEX) depend on ffmpegs support of AC4 to be compatible with this growing format. Hardware that requires support has already hit the market. Please add me to the list of willing beta testers as the lack of AC4 support is now the only obstacle to full support with PLEX.

comment:7 Changed 4 months ago by billmackintosh

  • Priority changed from wish to important

It is very important to get AC-4 audio processing in ffmpeg for Plex users (such as myself) as ATSC 3.0 expands and hardware such as the HDHomeRun 4K tuner make use of this. Please add me to the list of potential beta testers as I have this setup (Plex & HDHomeRun 4K)

comment:8 Changed 4 months ago by cehoyos

  • Priority changed from important to wish

comment:9 Changed 4 months ago by netsjtr08

  • Priority changed from wish to important

Adding to the request for this development as well. no sound on plex with new ATSC 3.0 tuner.

comment:10 Changed 4 months ago by cehoyos

  • Priority changed from important to wish

comment:11 Changed 4 months ago by Chris_in_Texas

With more ATSC3.0 channels coming nationwide we really need support for AC3. This will become critical for other systems that use ffmpeg in short time. Please add AC3 support in so we can continue to view 4K ATSC TV.

comment:12 Changed 4 months ago by richardpl

Post short samples of various configurations.

comment:13 Changed 4 months ago by kyl416

If you want a starting point, check out this series of patches. Someone submitted them back in March to patchwork, but they failed some tests:
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=451

comment:14 follow-ups: Changed 4 months ago by richardpl

Looks like nobody cares about AC-4, because if they care they would actually provide AC-4 samples here.

Changed 4 months ago by siryurian

AC-4 sample from ATSC3.0

comment:15 in reply to: ↑ 14 Changed 4 months ago by kyl416

Replying to richardpl:

Looks like nobody cares about AC-4, because if they care they would actually provide AC-4 samples here.

siryurian just posted a sample for ATSC 3.0, but links to multiple AC-4 samples were already provided via the "DASH IF" link in the initial bug report. Just click "Accept" on their TOS popup and refresh the page to get a dozen different AC-4 samples for stereo, 5.1 and multitrack audio.

Also it's not that "nobody cares", it's that ATSC 3.0 is brand new and only active in select markets in the USA, the one device that allows the average user to view it on their PC only started shipping in October, and most users affected by this have no idea how to extract the AC-4 track to provide a usable sample. (Heck most of them had no idea that VLC, Kodi and Plex all rely on FFmpeg for audio and video decoding) I would have done it myself, but the 3 markets I have access to over the air, including the biggest market NYC, have not launched ATSC 3.0 services.

Last edited 4 months ago by kyl416 (previous) (diff)

comment:16 in reply to: ↑ 14 Changed 4 months ago by CBme

Replying to richardpl:
Looks like nobody cares about AC-4, because if they care they would actually provide AC-4 samples here.

That is false and absurd conclusion for a number of reasons. Here are 100 comments and rising of people starting to realize this show stopping problem. ​https://forum.silicondust.com/forum/viewtopic.php?f=133&t=74323
To any interested devs, please let us non devs know what is needed. How many clips? Does the video content matter (HD, standard def, progressive/interlaced). Do you want it where it transitions into commercials? etc.
Here is two longer HD clips from a progressive and borked interlaced stream (due to bug 4141) for anyone who can use them.
https://1drv.ms/u/s!Ap22nCAxKBS7j-Jr9Q8eX45gp2Uh7w?e=3miW5h

Last edited 4 months ago by CBme (previous) (diff)

comment:17 in reply to: ↑ 14 Changed 4 months ago by CBme

double post error

Last edited 4 months ago by CBme (previous) (diff)

comment:18 Changed 4 months ago by Nomis101

FYI, with the patches applied from comment 13, the AC-4 streams from the samples of comment 14 are properly detected as AC4. But the files do play with no sound, because the channels are not detected (says "0 channels"). MediaInfo? does detect the channels as "5.1 Main" and "Stereo Main".

% ffplay /Users/Nomis101/Downloads/ABC\ Stream\ -\ FFmpeg\ bug\ \#8349.ts
ffplay version N-100421-g1eb751955e Copyright (c) 2003-2020 the FFmpeg developers

built with Apple clang version 12.0.0 (clang-1200.0.32.28)
configuration: --pkg-config-flags=--static --enable-swscale --enable-avfilter --enable-fontconfig --enable-gpl --enable-version3 --enable-libass --enable-libbluray --enable-libfreetype --enable-libsoxr --enable-libaom --enable-libmp3lame --enable-librav1e --enable-encoder=librav1e --enable-libtheora --enable-libvorbis --enable-libvpx --disable-debug --enable-libmysofa --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-libfdk-aac --enable-muxer=mov --enable-muxer=mp4 --enable-muxer=ipod --enable-encoder=eac3 --enable-encoder=ac3 --enable-encoder=flac --enable-ffplay --enable-librtmp --enable-libsmbclient --enable-opencl --enable-libssh --enable-openssl --enable-encoder=truehd --enable-bsf=aac_adtstoasc --enable-encoder=h264_videotoolbox --enable-encoder=hevc_videotoolbox --enable-sdl --extra-ldflags=-L/opt/local/lib
libavutil 56. 62.100 / 56. 62.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.100 / 58. 65.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 93.100 / 7. 93.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100

[NULL @ 0x7f81b782ce00] Decoder requires channel count but channels not set
[NULL @ 0x7f81b7817000] Decoder requires channel count but channels not set
[NULL @ 0x7f81b782da00] Decoder requires channel count but channels not set
[mpegts @ 0x7f81b7808a00] stream 3 : no PTS found at end of file, duration not set
[mpegts @ 0x7f81b7808a00] Could not find codec parameters for stream 1 (Audio: ac4 (AC-4 / 0x342D4341), 0 channels): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[mpegts @ 0x7f81b7808a00] Could not find codec parameters for stream 2 (Audio: ac4 (AC-4 / 0x342D4341), 0 channels): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[mpegts @ 0x7f81b7808a00] Could not find codec parameters for stream 3 (Audio: ac4 (STPP / 0x50505453), 0 channels): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from '/Users/polysom/Downloads/ABC Stream - FFmpeg bug #8349.ts':

Duration: 00:01:15.34, start: 12951.873511, bitrate: 3690 kb/s
Program 3

Stream #0:0[0x31]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv), 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x32](eng): Audio: ac4 (AC-4 / 0x342D4341), 0 channels
Stream #0:2[0x33](spa): Audio: ac4 (AC-4 / 0x342D4341), 0 channels
Stream #0:3[0x3a](ee`): Audio: ac4 (STPP / 0x50505453), 0 channels

[hevc @ 0x7f81b886d200] Could not find ref with POC 56
[hevc @ 0x7f81b8814e00] Could not find ref with POC 32 0B f=0/0
[hevc @ 0x7f81b8814e00] Could not find ref with POC 24
[hevc @ 0x7f81b8814e00] Could not find ref with POC 16
13006.05 M-V: -0.025 fd= 305 aq= 0KB vq= 370KB sq= 0B f=0/0

Last edited 4 months ago by Nomis101 (previous) (diff)

comment:19 Changed 4 months ago by Nomis101

Ah, sorry, the "0 channel" thing was just because of AV_CODEC_CAP_CHANNEL_CONF. If I add that to ac4dec.c I have sound with the sample files from above. So, it seems with this patch we are on a good way...

ffplay /Users/Nomis101/Downloads/ABC\ Stream\ -\ FFmpeg\ bug\ \#8349.ts
ffplay version N-100421-g1eb751955e Copyright (c) 2003-2020 the FFmpeg developers

built with Apple clang version 12.0.0 (clang-1200.0.32.28)
configuration: --pkg-config-flags=--static --enable-swscale --enable-avfilter --enable-fontconfig --enable-gpl --enable-version3 --enable-libass --enable-libbluray --enable-libfreetype --enable-libsoxr --enable-libaom --enable-libmp3lame --enable-librav1e --enable-encoder=librav1e --enable-libtheora --enable-libvorbis --enable-libvpx --disable-debug --enable-libmysofa --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-libfdk-aac --enable-muxer=mov --enable-muxer=mp4 --enable-muxer=ipod --enable-encoder=eac3 --enable-encoder=ac3 --enable-encoder=flac --enable-ffplay --enable-librtmp --enable-libsmbclient --enable-opencl --enable-libssh --enable-openssl --enable-encoder=truehd --enable-bsf=aac_adtstoasc --enable-encoder=h264_videotoolbox --enable-encoder=hevc_videotoolbox --enable-sdl --extra-ldflags=-L/opt/local/lib
libavutil 56. 62.100 / 56. 62.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.100 / 58. 65.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 93.100 / 7. 93.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100

[mpegts @ 0x7fd2f082ac00] stream 3 : no PTS found at end of file, duration not set
Input #0, mpegts, from '/Users/Nomis101/Downloads/ABC Stream - FFmpeg bug #8349.ts':

Duration: 00:01:15.34, start: 12951.873511, bitrate: 3690 kb/s
Program 3

Stream #0:0[0x31]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv), 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x32](eng): Audio: ac4 (AC-4 / 0x342D4341), 48000 Hz, 5.1(side), fltp
Stream #0:2[0x33](spa): Audio: ac4 (AC-4 / 0x342D4341), 48000 Hz, stereo, fltp
Stream #0:3[0x3a](ee`): Audio: ac4 (STPP / 0x50505453), 48000 Hz, 3.0, fltp

[hevc @ 0x7fd308885c00] Could not find ref with POC 56
13030.02 A-V: 0.019 fd= 174 aq= 0KB vq= 0KB sq= 0B f=0/0

comment:20 Changed 4 months ago by tmm1

  • Cc ffmpeg@tmm1.net added

I have a patch that fixed some issues with a few stations: https://github.com/FFmpeg/FFmpeg/commit/1b9ae54caf9d1b038583ee9d1e94f130b42b5f7d

comment:21 follow-up: Changed 4 months ago by richardpl

Do you have samples to reproduce this, as that patch contradicts with specifications.

comment:22 follow-ups: Changed 4 months ago by richardpl

comment:23 follow-up: Changed 3 months ago by georgeP

All i know is all the main stations in seattle have switched to ATSC 3.0 so I upgraded to a new HDHomeRun 4k for my Plex DVR. All I can see is really clear video with no audio stream found. So no football for me or anyone else in the same situation. Happy to help however I can and willing to chip in if needed.

comment:24 in reply to: ↑ 23 ; follow-ups: Changed 3 months ago by cehoyos

Replying to georgeP:

Happy to help however I can

Did you see comment:14 and comment:21?

comment:26 in reply to: ↑ 24 Changed 3 months ago by georgeP

Replying to cehoyos:

Replying to georgeP:

Happy to help however I can

Did you see comment:14 and comment:21?

I have no idea how to do that. If you can provide instructions I will try.

comment:27 Changed 3 months ago by vogateer

I've uploaded a TS file from an OKC OTA station with AC-4 audio here:
https://drive.google.com/file/d/1xpEyd59cD4NgLtfYsWuBOrMjovzCO7xj/view?usp=sharing

Unfortunately I can't figure out how to demux the TS file and just upload the audio portion. If anyone has instructions for that, please let me know. I could record multiple samples.

comment:28 Changed 3 months ago by phroenips

Two more samples. These are 30 second extracts from a HDHomerun Quatro 4K. I'm also not sure how to demux just the audio, so these are video and audio

https://1drv.ms/v/s!ArfvDX-zLpfP9XamL2kwsu2JnpKR?e=TBE0XE
https://1drv.ms/v/s!ArfvDX-zLpfP9XVdkW4CMgI5EIKd?e=XvsCgN

comment:29 in reply to: ↑ 22 Changed 3 months ago by mooninite

Replying to richardpl:

This is latest AC4 WIP code: https://github.com/richardpl/FFmpeg/tree/ac4

I tested these patches against a 4.3 branch (Fedora/RPMFusion) and could successfully play live streaming data in the Dallas, TX market from a SiliconDust? CONNECT 4K and Kodi. Audio is working. Thanks!

comment:30 in reply to: ↑ 22 Changed 3 months ago by Nomis101

Replying to richardpl:

This is latest AC4 WIP code: https://github.com/richardpl/FFmpeg/tree/ac4

Playback does also work nicely for me. But if I try to convert the audio stream in e.g. AAC, I see different errors with the provided samples.

Sample from comment 24 gives me:
[ac4 @ 0x7fef1480a200] substream audio data overread: 1153
Error while decoding stream #0:0: Invalid data found when processing input
[ac4 @ 0x7fef1480a200] substream audio data overread: 598
Error while decoding stream #0:0: Invalid data found when processing input
[ac4 @ 0x7fef1480a200] substream audio data underread: 8
[ac4 @ 0x7fef1480a200] substream audio data underread: 10eed= 229x
[ac4 @ 0x7fef1480a200] sect_cb[0][0] > 11
Error while decoding stream #0:0: Invalid data found when processing input
[ac4 @ 0x7fef1480a200] substream audio data underread: 257
[ac4 @ 0x7fef1480a200] substream audio data underread: 131
[ac4 @ 0x7fef1480a200] substream audio data overread: 1217
Error while decoding stream #0:0: Invalid data found when processing input
[ac4 @ 0x7fef1480a200] substream audio data underread: 104
[ac4 @ 0x7fef1480a200] substream audio data underread: 119
[ac4 @ 0x7fef1480a200] sect_cb[0][0] > 11
Error while decoding stream #0:0: Invalid data found when processing input
[ac4 @ 0x7fef1480a200] sect_cb[0][3] > 11
Error while decoding stream #0:0: Invalid data found when processing input
[ac4 @ 0x7fef1480a200] substream audio data underread: 106
[ac4 @ 0x7fef1480a200] substream audio data underread: 122
[ac4 @ 0x7fef1480a200] sect_cb[0][0] > 11
Error while decoding stream #0:0: Invalid data found when processing input

Sample from comment 27 gives me:
[ac4 @ 0x7fe01f008c00] substream audio data overread: 2
Error while decoding stream #0:1: Invalid data found when processing input
[mpegts @ 0x7fe020809a00] Packet corrupt (stream = 0, dts = 1229347550).
[ac4 @ 0x7fe01f008c00] invalid aspx num env: 7 (class 3)
Error while decoding stream #0:1: Invalid data found when processing input

Sample (first one) from comment 28 gives me:
[ac4 @ 0x7ff98980f600] substream audio data overread: 6
Error while decoding stream #0:2: Invalid data found when processing input

Changed 3 months ago by csdesigns

ATSC 3.0 OTA 5.1

comment:31 in reply to: ↑ 22 Changed 3 months ago by ferrellsl

Replying to richardpl:

This is latest AC4 WIP code: https://github.com/richardpl/FFmpeg/tree/ac4

I completed a successful MSYS2 x64 build 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 at: C:\msys64\mingw64\bin

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/eene7ecard5xkij/ffmpeg-ac4.zip?dl=1

EDIT: Download link fixed.

EDIT: For those who used my binaries and experienced stuttering video and the VQ dropping to 0 after a few minutes of streaming an ATSC3.0 channel, add the "-sync video" and infinite buffer switches to your script or command line. I.e.: ffplay.exe -i "http://192.168.2.142:5004/auto/v161.1?transcode=native" -infbuf -sync video

Last edited 3 months ago by ferrellsl (previous) (diff)

comment:32 follow-up: Changed 3 months ago by LostDog

I compiled the ac4 branch at https://github.com/richardpl/FFmpeg/tree/ac4 using Linux Mint 20.1. It built successfully and I was able to play the atsc3.ts samples with AC-4 audio using ffplay.

I've not been able to compile VLC or Kodi against this branch but I'm suspecting it's due to my own lack of understanding rather than the branch code.

comment:33 in reply to: ↑ 32 ; follow-up: Changed 3 months ago by ferrellsl

  • Status changed from reopened to open

Replying to LostDog:

I compiled the ac4 branch at https://github.com/richardpl/FFmpeg/tree/ac4 using Linux Mint 20.1. It built successfully and I was able to play the atsc3.ts samples with AC-4 audio using ffplay.

I've not been able to compile VLC or Kodi against this branch but I'm suspecting it's due to my own lack of understanding rather than the branch code.

Let us know if you're successful. I'd really like to have a PVR that records and plays ATSC3.0 streams without using a bunch of scripts and hacks. Over at the NextPVR forums there's a guy who has written some python scripts that use the binaries from this tree to transcode the ATSC3.0/AC4 audio stream into AC3 on-the-fly but I'm hoping for a cleaner solution.

For now, I can still record my ATSC3.0 channels using NextPVR and use the binaries from this tree for playback of those ATSC3.0 recordings without transcoding, and of course all the 4K channels in the Phoenix area are mirrored in 1080p/ATSC1.0 channels. I'm quite pleased with richardpl's progress. I was expecting things to move much slower than they have, or not at all. At least now I have a poor-man's PVR using scripts for playback. Having AC4 integrated natively into VLC, Kodi, or NextPVR would be very welcome from my standpoint.

comment:34 in reply to: ↑ 33 ; follow-up: Changed 3 months ago by LostDog

Replying to ferrellsl:

Let us know if you're successful. I'd really like to have a PVR that records and plays ATSC3.0 streams without using a bunch of scripts and hacks. Over at the NextPVR forums there's a guy who has written some python scripts that use the binaries from this tree to transcode the ATSC3.0/AC4 audio stream into AC3 on-the-fly but I'm hoping for a cleaner solution.

For now, I can still record my ATSC3.0 channels using NextPVR and use the binaries from this tree for playback of those ATSC3.0 recordings without transcoding, and of course all the 4K channels in the Phoenix area are mirrored in 1080p/ATSC1.0 channels. I'm quite pleased with richardpl's progress. I was expecting things to move much slower than they have, or not at all. At least now I have a poor-man's PVR using scripts for playback. Having AC4 integrated natively into VLC, Kodi, or NextPVR would be very welcome from my standpoint.

I have successfully built Kodi v18.9 against the AC-4 branch of ffmpeg. ATSC3.0 captures work seemingly flawlessly with audio. I cannot verify if it's 5.1 and the channels are correct but on my computer with stereo headphones the audio sounds great.

Tuning live ATSC3.0 is really buggy using the HDHomerun plugins but it will occasionally play and when it does there is audio. I don't think this has anything to do with ffmpeg but rather the plugins themselves.

comment:35 in reply to: ↑ 34 Changed 3 months ago by ferrellsl

Replying to LostDog:

Replying to ferrellsl:

Let us know if you're successful. I'd really like to have a PVR that records and plays ATSC3.0 streams without using a bunch of scripts and hacks. Over at the NextPVR forums there's a guy who has written some python scripts that use the binaries from this tree to transcode the ATSC3.0/AC4 audio stream into AC3 on-the-fly but I'm hoping for a cleaner solution.

For now, I can still record my ATSC3.0 channels using NextPVR and use the binaries from this tree for playback of those ATSC3.0 recordings without transcoding, and of course all the 4K channels in the Phoenix area are mirrored in 1080p/ATSC1.0 channels. I'm quite pleased with richardpl's progress. I was expecting things to move much slower than they have, or not at all. At least now I have a poor-man's PVR using scripts for playback. Having AC4 integrated natively into VLC, Kodi, or NextPVR would be very welcome from my standpoint.

I have successfully built Kodi v18.9 against the AC-4 branch of ffmpeg. ATSC3.0 captures work seemingly flawlessly with audio. I cannot verify if it's 5.1 and the channels are correct but on my computer with stereo headphones the audio sounds great.

Tuning live ATSC3.0 is really buggy using the HDHomerun plugins but it will occasionally play and when it does there is audio. I don't think this has anything to do with ffmpeg but rather the plugins themselves.

Wow, you've been really busy! I took a look at the VLC sources tonight and will attempt to build it against the AC-4 branch this week since I'm feeling brave. I noticed that in the rules.mak file located under vlc/contrib/src/ffmpeg/ that it's referencing the trunk sources. Is it enough to edit the rules.mak file in this directory to point towards the AC-4 branch and then attempt a build? Here's the portion of rules.mak that references the ffmpeg trunk. I'm hoping it would be that simple but that's usually never the case.

# FFmpeg

#Uncomment the one you want
#USE_LIBAV ?= 1
#USE_FFMPEG ?= 1

ifndef USE_LIBAV
FFMPEG_HASH=1e35519fe0b8bbad84641e83d49138152720b544
FFMPEG_GITURL := http://git.videolan.org/git/ffmpeg.git
FFMPEG_LAVC_MIN := 57.37.100
USE_FFMPEG := 1
else
FFMPEG_HASH=e5afa1b556542fd7a52a0a9b409c80f2e6e1e9bb
FFMPEG_GITURL := git://git.libav.org/libav.git
FFMPEG_LAVC_MIN := 57.16.0
endif

comment:36 Changed 2 months ago by ferrellsl

I decided to build an AC-4 capable video player based on the code found here: https://github.com/itisyang/playerdemo

Link to screenshot of player: https://ibb.co/tZ3Zf05

It only has 3 dependencies, SDL2, QT, and ffmpeg so I set about updating it to support richardpl's ffmpeg/AC4 branch. I normally avoid github projects that depend on QT for several reasons but this project is very well-written and modular so it was very easy to compile it against the ffmpeg/AC4 branch. The majority of my time was spent Anglicizing all the dialogs and menus because the author is Chinese and had hardcoded most of the menus and dialogs. I also added the ability to read mpeg TS files directly as that was missing. I've tested it on MKV files and TS files containing AC-4 audio streams and it works great so I suspect it will read any format supported by ffmpeg.

My build environment is Visual Studio 2015 and QT5.6 and the binary is 64-bit. My apologies to those who want 32-bit builds but I have no desire to re-tool my developer system which is entirely 64-bit.

I'm an applications developer, not a video (encode/decode) - (mux/demux) developer, so I will only be able to help you squash bugs in the UI and possibly add more file types.

You can download the Player here: https://www.dropbox.com/s/uuf16gxqs2s4bqk/Player-AC4.zip?dl=1

Just unzip the files to the folder of your choice and run the playerdemo.exe file.

If you want to test it, here's a 40MB TS file with HEVC video encoding and AC-4 audio:
https://www.dropbox.com/s/vzv66pz54phfskl/v161.1.ts?dl=1

Anyway, I hope somebody will get some use out of this player. It was actually a pleasure to update and build, unlike VLC which is a total dumpster fire.

The keyboard shortcuts can be found under the About dialog, just right-click on the screen to bring up the context menu.

If you want to use this player to view your SiliconDust? tuner's media streams, you can do so with the ffmpeg.exe in the archive here: https://www.dropbox.com/s/bze1a5nrhq63u20/ffmpeg-ac4-msys2-shared.zip?dl=1

I built and tested this version of ffmpeg using richardpl's branch. Msys2 64 was my build environment and the exe's work great with HEVC and AC-4 audio.

For example, to stream channel 161.1 here in Phoenix which uses HEVC and AC4 audio, open a command prompt and type:
ffmpeg -i http://x.x.x.x:5004/auto/v161.1 -b 900k -vcodec copy -r 60 -y test.mkv

Just change the X's to your tuner's IP address.

This will create an ever growing video file named test.mkv in the same folder as your ffmpeg.exe file. Now just run the playerdemo.exe and open the test.mkv file.

You can also just use wget to get the raw TS stream:

wget -O test.ts http://x.x.x.x:5004/auto/v161.1

Then use the player to open the TS file.

This also works for RTSP camera streams as well. For password protected cameras substitute your user ID and password, your camera's IP address and stream path I.e: ffmpeg -i rtsp://admin:password@x.x.x.x:554/x -b 900k -vcodec copy -r 60 -y test.mkv

For cameras not using a password: ffmpeg -i rtsp://x.x.x.x:554/x -b 900k -vcodec copy -r 60 -y test.mkv

Alternatively, to stream and watch from your SilconDust? tuner, you could just launch ffplay.exe from the archive. This is an example of how to stream and view channel 161.1 here in Phoenix. This channel uses HEVC and AC-4 audio streams and works great with ffplay.exe.

ffplay.exe -i "http://x.x.x.x:5004/auto/v161.1?transcode=native" -infbuf -sync video

Just replace the X's with your tuner's IP address.

Last edited 2 months ago by ferrellsl (previous) (diff)

comment:37 follow-up: Changed 2 months ago by Moe247

  • Priority changed from wish to important

So I'm new to this. I'm on Plex installed on Ubuntu. I cloned this: https://github.com/richardpl/FFmpeg/tree/ac4. Configured it, but I'm unsure how to get plex use it. I appreciate any advice.

comment:38 in reply to: ↑ 37 Changed 2 months ago by ferrellsl

Replying to Moe247:

So I'm new to this. I'm on Plex installed on Ubuntu. I cloned this: https://github.com/richardpl/FFmpeg/tree/ac4. Configured it, but I'm unsure how to get plex use it. I appreciate any advice.

If you've already ran the ./configure command, then all you should need to do is run make, and then run make install.

comment:39 follow-up: Changed 2 months ago by cehoyos

  • Priority changed from important to wish

comment:40 in reply to: ↑ 39 ; follow-ups: Changed 2 months ago by Moe247

Replying to cehoyos:

I did as you said. Unfortunately, no luck. I even tried both copying the binary to the PMS folder and creating a symbolic link, with no success. I'm a noob, sorry.

Thank you for your time.

comment:41 in reply to: ↑ 40 Changed 2 months ago by ferrellsl

Replying to Moe247:

Replying to cehoyos:

I did as you said. Unfortunately, no luck. I even tried both copying the binary to the PMS folder and creating a symbolic link, with no success. I'm a noob, sorry.

Thank you for your time.

Did you remove the old ffmpeg first? Try removing it before installing richardpl's version.

sudo apt-get remove ffmpeg
sudo apt-get purge ffmpeg

Then go back to the folder containing richardpl's code and run: "./configure" followed by "make". Then run "make install"

comment:42 in reply to: ↑ 40 Changed 2 months ago by cehoyos

Replying to Moe247:

Replying to cehoyos:

I'm a noob, sorry.

I don't know your exact task, but in this case, you should probably wait for a package made by somebody else.

comment:43 Changed 2 months ago by Nomis101

Instead of using an incomplete WIP patch in various customized builds, would somebody be able to finish this patch and submit it to the list?

comment:44 in reply to: ↑ 21 Changed 2 months ago by tmm1

Replying to richardpl:

Do you have samples to reproduce this, as that patch contradicts with specifications.

The sample in comment:27 reproduces, as does this one: https://tmm1.s3.amazonaws.com/atsc3-aspx-num-env.ts

Where in the spec does it state that aspx_num_env is capped at 5?

comment:45 follow-up: Changed 2 months ago by ferrellsl

Here's an updated player with streaming support so there's no longer a need for ffmpeg, wget or other app to capture HEVC/AC-4 streams to a file before playback. I've tested this player with http:// streams from my HDHomeRun tuner as well as an rtsp:// security camera at my home. It still supports AC-4 and HEVC.

To play an HEVC/AC-4 stream, or any other type of stream from your HDHomeRun tuner or web server, enter the channel's URL as found in your channel lineup (Ex: http://x.x.x.x:5004/auto/v161.1 ) into the video selection dialog box or select a local file for videos stored locally.

Download link: https://www.dropbox.com/s/eft7u6d0ajp2twu/Videoplayer-AC4-streaming%20support.zip?dl=1

This player is based on code found here: https://github.com/yundiantech/VideoPlayer

It took me several hours to track down an annoying audio bug/crackle but it works great now.

Last edited 2 months ago by ferrellsl (previous) (diff)

comment:46 in reply to: ↑ 45 Changed 2 months ago by ferrellsl

Replying to ferrellsl:

Here's an updated player with streaming support so there's no longer a need for ffmpeg, wget or other app to capture HEVC/AC-4 streams to a file before playback. I've tested this player with http:// streams from my HDHomeRun tuner as well as an rtsp:// security camera at my home. It still supports AC-4 and HEVC.

To play an HEVC/AC-4 stream, or any other type of stream from your HDHomeRun tuner or web server, enter the channel's URL as found in your channel lineup (Ex: http://x.x.x.x:5004/auto/v161.1 ) into the video selection dialog box or select a local file for videos stored locally.

Download link: https://www.dropbox.com/s/eft7u6d0ajp2twu/Videoplayer-AC4-streaming%20support.zip?dl=1

This player is based on code found here: https://github.com/yundiantech/VideoPlayer

It took me several hours to track down an annoying audio bug/crackle but it works great now.

I squashed a few more bugs and moved the source code as well as the 64-bit Windows installer over to github. The earlier version experienced a strange video buffer underrun after several minutes of streaming from my tuner that caused the video to become choppy. This has been fixed.

You can get the latest release here: https://github.com/ferrellsl/VideoPlayer/releases/tag/v1.1

Last edited 2 months ago by ferrellsl (previous) (diff)

comment:47 follow-up: Changed 2 months ago by richardpl

Is this open source or what kind of endorsement is this at all?

comment:48 in reply to: ↑ 47 Changed 2 months ago by ferrellsl

Replying to richardpl:

Is this open source or what kind of endorsement is this at all?

I'm not an expert on all the licensing issues and I'm not sure what you mean by endorsement so I just chose "Unlicense" when github asked which license I wanted to use when I created the repository for the video player. It's open source as I understand it and I don't care what anyone wants to do with the code. The other dependencies (SDL2, QT, and your experimental ffmpeg branch) weren't modified in any way so whatever terms those dependencies were released under still apply to those dependencies.

If by endorsement you mean that your code works and plays well with others, then yes, this player is an endorsement of the stability and capabilities of your experimental ffmpeg branch. Your code works amazingly well in both an msys2 64 and Visual Studio environment. I'm anxious to see you update your branch with AC-4 encoder support next.

Last edited 2 months ago by ferrellsl (previous) (diff)
Note: See TracTickets for help on using tickets.