OpenShot / openshot-qt

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.
http://www.openshot.org
Other
4.27k stars 532 forks source link

Default audio codec "ac3" not supported on majority/most players #1594

Closed N3WWN closed 6 years ago

N3WWN commented 6 years ago

Describe the bug I just tried uploading a video directly to a new video streaming service and my video did not contain any audio after upload. Uploading to YouTube and then importing it into the new video streaming service works. After consulting with the new video service's support engineers, it turns out that ac3 is not supported by their system. The reason it works when imported from YouTube is that YouTube converts the ac3 stream into aac, which they can then import.

System Details (please complete the following information):

Additional open issues reported which have a high probability of being due to the use of ac3:

996

1047

1466

1583

There are other closed issues which are likely due to this, also, but I won't list them here.

N3WWN commented 6 years ago

Additional info:

The video which I was having issues with on one service and worked fine on YouTube had the audio converted to mp4a.40.2 (Low-Complexity AAC).

N3WWN commented 6 years ago

Research indicates:

DylanC commented 6 years ago

@N3WWN - Would you consider this a bug or enhancement?

N3WWN commented 6 years ago

@DylanC - "Ummm... I think... BOTH!" 😜 (Is it too early for Ground Day quotes... or flapjacks?)

Seriously, I'm not sure which bucket this would go into. Since this is only changing the two container presets where ac3 is not a typically supported audio codec, I'd think it was bug.

But, since some devices/players can play ac3 within these two containers, and this will only open up compatibility with more devices/players, I'd think it was an enhancement.

None of the referenced issues have any tags except #1466, which is tagged as a bug, so perhaps we default to the only tagged issue and go with "bug"?

Is there any benefit to getting it tagged one way versus another? Would a bugfix have a better chance of being merged than an enhancement?

DylanC commented 6 years ago

@N3WWN - I will go with bug for now. I think its important to fix and I feel bugs should take priority over enhancements.

N3WWN commented 6 years ago

Confirmed that this fix resolved the issue reported in #1599 , also. (Updated comment in PR with reference to this ticket).

DylanC commented 6 years ago

@N3WWN - Maybe we will need to have another think about this again. Seems just changing to acc was causing some issues. If @jonoomph could provide some input on the matter we could move forward with a different fix.

ferdnyc commented 6 years ago

Seems just changing to acc was causing some issues.

OOC, what issues? In what profiles/situations? As I said in the comments to #1595, at least for an MP4 container and stereo audio AAC should be supported everywhere, as it's literally in the MP4 spec.

ferdnyc commented 6 years ago

@N3WWN researches-and-writes:

"Can", but... "should"? As I read their info, they expect AC-3 for 5.1 surround, and E-AC-3 for 7.1 surround, but there's no mention of stereo AC3. Of course you can always output stereo audio to AC-3 even if it's going to be decoded as 5.1 surround, but it seems like there's a potential for a lot of wasted bandwidth and/or excessive compression involved in doing that. For stereo audio, I'm still unconvinced that AAC isn't the right format even for Apple TV.

  • AVCHD, DVD NTSC, DVD PAL, MP4 XVID presets can retain ac3 default due to this being a standard format for these targets

Agreed for DVD. Those have to stay AC-3, it's a hard requirement. Ditto Blu-Ray, I believe. Agreed for AVCHD, it appears they wanted files to be as media-ready as possible, so AC-3 audio. XviD is a video codec, there isn't a "standard" audio format for it by definition. It is often paired with AC-3 audio, it seems, for the same reasons that AVCHD is. But when all's said and done it's MP4, which in theory makes AAC the standard. Still, I don't suppose it'll hurt to leave it at AC-3 for... not compatibility, but... "familiarity"?

Also, see related concern, below.

  • Flikr HD and Nokia nHD - Unable to find any recent info on these, so leaving these preset alone

Flickr's latest help is here, they list only video formats. MP4 is "recommended", and I take that as endorsing the native audio format specified for MP4, which is AAC. The Nokia preset... should probably go away, to be perfectly honest?

  • MP4 x264 preset should change to aac to be supported on as many devices as possible

Unquestionably.

  • MOV x264 preset should change to aac due to lack of ac3 support in older versions of QuickTime

~Hmmmm, I'm not so sure about that one. AAC is absolutely a better choice than AC-3, I just wonder if it's universally supported everywhere MOV is. The oldest, pre-MP4 MOV files used Sorenson video and QDesign audio, but it's hard to even find a compatible decoder for Sorenson anymore so I doubt we need to be concerned about that. (Typically old-school MOVs will play audio-only in most players, since QDesign is basically just a particular AIFF compression.) I'm just wondering if there's a possibility that something like AIFF audio would be more universally supported than AAC, for MOV containers.~

ETA: Rescinded, see below

Regardless, I agree that AAC is a much better choice than AC-3.

Related: Audio bitrate

I get the impression that we're still defaulting to 44.1kHz sample rates in a lot of places, mostly out of pure inertia? Almost ALL video formats should be using 48kHz, and many of these in fact require it. 44.1kHz audio isn't officially supported by DVD (or Blu-Ray, I believe), or by YouTube. Heck, I don't believe it's "really" supported by AC-3, period, in home theater applications. Apple's Soundtrack 3 manual says:

All files intended for video and audio DVD authoring must have a 48 kHz sample rate as per the DVD specification. The 32 kHz and 44.1 kHz sample rates are only available when Generic AC-3 is the target system.

We really need to get OpenShot's profiles and presets caught up to 48kHz audio wherever possible. I'd brought this up previously but then sort of dropped the ball on it. Even in places where 44.1kHz is currently working, that's likely a fluke of permissive players and codecs working to paper over our mistakes, rather than an officially supported configuration.

ferdnyc commented 6 years ago
  • MOV x264 preset should change to aac due to lack of ac3 support in older versions of QuickTime

Hmmmm, I'm not so sure about that one. AAC is absolutely a better choice than AC-3, I just wonder if it's universally supported everywhere MOV is. The oldest, pre-MP4 MOV files used Sorenson video and QDesign audio, but it's hard to even find a compatible decoder for Sorenson anymore so I doubt we need to be concerned about that. (Typically old-school MOVs will play audio-only in most players, since QDesign is basically just a particular AIFF compression.) I'm just wondering if there's a possibility that something like AIFF audio would be more universally supported than AAC, for MOV containers.

I take all that back, I got fixated on the MOV part and blocked out the x.264. If we're talking x.264 then we're talking MP4 era, in fact modern QuickTime ".MOV" files are literally just ".MP4" files renamed with a ".MOV" extension, there are no functional differences because everything QuickTime-y about them is implemented as standard MP4 container extensions. You can rename .MOV/.MP4 files back and forth between the two extensions and it won't change anything. So, yeah, AAC.

N3WWN commented 6 years ago

@DylanC wrote:

Maybe we will need to have another think about this again. Seems just changing to acc was causing some issues. If @jonoomph could provide some input on the matter we could move forward with a different fix.

What kind of issues were turned up with defaulting mp4 to the preferred audio codec for the container?

If it's an issue with one type of build or another, it may be that there's a missing dependency, although I would think that ac3 would be more likely to have an unsupported dep than aac since ac3 was a proprietary, non-free codec up until recently.

ferdnyc commented 6 years ago

@N3WWN Aha, I found the answer to our issue in the commit log for f607d9b7:

commit f607d9b7
Author: Jonathan Thomas <jonathan@openshot.org>
Date:   2018-05-25 00:35:49 -0500

    Reverting back to ac3 temporarily (as the default codec), since not all builds support aac

So, hopefully that's merely a build issue that'll get fixed ASAP, because AC3 is just incorrect for a lot of these profiles, and AAC support is a hard requirement for video production in the x.264/AVC age.

DylanC commented 6 years ago

@ferdnyc - Yeah this was the issue I was talking about. I should have referenced it earlier.

N3WWN commented 6 years ago

@jonoomph - Any chance we can get aac as the default codec (undo the revert in https://github.com/OpenShot/openshot-qt/commit/f607d9b7aa4cd1dabd273a8cbf586c9e9dd02383) for the 2.4.2 release so we can nip all of these "no audio" issues in the bud?

ferdnyc commented 6 years ago

Failing that, I definitely think #1595 and #1660 should be priorities for immediately after release. Actually, I think #1595 should be expanded beyond just those two, and more of the presets should switch to AAC. Heck, the YouTube-HD preset is using MP3 audio, which like the 44.1kHz samplerate is technically supported, but DEFINITELY not their recommended format. (#1660 will correct the samplerate, but thus far the audio codec choice hasn't been addressed.)

OpenShot is behind the curve on audio support, and it's causing real issues for users.

DylanC commented 6 years ago

@ferdnyc - Since we got the change for AAC got merged in should this be closed?

N3WWN commented 6 years ago

@DylanC - Yes, since the default is now AAC, that should resolve this issue and the ones referenced.

DylanC commented 6 years ago

@N3WWN - Alright, I've commented on the other issues to hopefully get this fix confirmed.

ferdnyc commented 5 years ago

Removing recommendation for a particular commercial conversation software, because format conversion is not the issue here (OpenShot can do that natively, if necessary), and even if it wasn't intended that way, the "plug" has the appearance of commercial spam.