olive-editor / olive

Free open-source non-linear video editor
https://olivevideoeditor.org/
GNU General Public License v3.0
8.24k stars 556 forks source link

Olive has no sound support #4

Closed itsmattkc closed 6 years ago

itsmattkc commented 6 years ago

Even if audio clips are in the timeline, Olive makes no sound.

itsmattkc commented 6 years ago

Sound files now play in Olive but they only play when no video is attached from the same source. There either needs to be a way to synchronize the video frame retrieval with the audio frame retrieval, or opening a separate format context for the audio (this solution could also address #21)

itsmattkc commented 6 years ago

WAV files also don't work. FFmpeg, despite reporting the channel count in its stderr output, does not seem to place them in its AVCodecContext struct, so when Olive tries to retrieve this value and pass it to libswresample, it crashes. Clearly the channel count has to be retrieved from elsewhere.

itsmattkc commented 6 years ago

Additionally, sample rate conversions (e.g. 44100Hz clip in a 48000Hz sequence) are surprisingly low quality, despite passing through swresample for that specific purpose. There must either be an option for higher quality resampling or Olive will have to use libsoxr instead.

This of course might also be a flaw in Olive's sample/byte count detection and have nothing to do with FFmpeg specifically.

itsmattkc commented 6 years ago

WAV files work now due to a workaround/fallback that uses the "channel count" to detect the "channel layout" (i.e. 2 channels defaults to stereo).

itsmattkc commented 6 years ago

Olive now officially supports all codecs, sample rates, and format types that FFmpeg supports. Issues that are still present are no seeking support (sound can't detect moving around the timeline), and there is still major slowdown and glitches when video and audio are playing from the same sources.

Once seeking is implemented, I will consider this issue finally(!) closed, and address the second issue in #21