Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#10206 closed defect (invalid)

Recoded mkv files with ffmpeg don't have sound in Davinci Resolve

Reported by: PassingStrike Owned by:
Priority: normal Component: ffmpeg
Version: unspecified Keywords: mkv Davinci Resolve
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: If I use ffmpeg to convert a .webm to a .mkv, Davinci Resolve will recognise and play the file but it won't reproduce sound
How to reproduce:

% ffmpeg -i input.webm output.mkv
ffmpeg version 2023-02-19-git-2aec86695a-full_build-www.gyan.dev
built on gcc 12.2.0 (Rev10, Built by MSYS2 project)

Basically, I tend to work with .webm files, but Davinci don't recognise those. So I thought about using ffmpeg to recode them to .mkv, an extension that I know the software works with. However, when I import the new .mkv, Davinci plays the video with no sound. I tried to export it to see if it was a problem of the player but no, there is no sound neither.

I sadly don't have more information. I will try to get more information if this is too little to think about a solution. Also I would like to know if I will have to create a ticket in their forums instead of yours.

I'm in Windows 10 and working with Davinci Resolve 1.18.2.

Change History (15)

comment:1 by Michael Koch, 15 months ago

please show the console output of the ffmpeg command

comment:2 by PassingStrike, 15 months ago

After trying with different .mkv files to my computer, I bumped into one that really had video and sound in Davinci. After inspecting both with the command

ffmpeg -i input.mkv

The only difference I could see is their encoder:
The first one (which works) is Lavf58.29.100
The second one (which does not work) is Lavf59.5. 100

I don't know if this helps, maybe it is a version too new for the video editor? Maybe something broke in the new version?

in reply to:  1 comment:3 by PassingStrike, 15 months ago

Replying to Michael Koch:

please show the console output of the ffmpeg command

Here it is

comment:4 by PassingStrike, 15 months ago

I just checked and it looks like recoding to .mp4 works... Is there any quality difference between recoding to mp4 and recoding to mkv, or is just a container difference? If the answer is that there isn't, then I guess this ticket is closed.

comment:5 by Balling, 15 months ago

Mkv only started working since 18 version of Davinci.

Also webm is mkv. You can just rename the file and it should open.

Last edited 15 months ago by Balling (previous) (diff)

in reply to:  5 comment:6 by PassingStrike, 15 months ago

Replying to Balling:

Mkv only started working since 18 version of Davinci.

Also webm is mkv. You can just rename the file and it should open.

I know mkv compatibility is new in Davinci, that's why I said at the end that maybe I will instead convert my webm to mp4 because every software recognise those without a problem.

Yes, changing the extension makes it recognisable for Davinci... The video. The sound is still missing.

I've made more tests and the only files that had this problem were the ones I recoded with ffmpeg. I've tried with videos recorded already in .mkv and .mp4 files that were recoded to .mkv using HandBrake. All of those work, video and sound.

In fact, I have an idea. I will try to convert the same webm I'm trying to make their sound work with Handbrake instead of ffmpeg. Maybe the problem is not ffmpeg, maybe it is the recoding from .webm to .mkv.

EDIT: Just checked. Recoding from .webm to .mkv in Handbrake works (both video and audio play). So no, the issue it's not the recoding from .webm to .mkv.

Last edited 15 months ago by PassingStrike (previous) (diff)

comment:7 by Balling, 15 months ago

Well, Handbreak is mostly using ffmpeg. Please attach working Handbreak file.

Last edited 15 months ago by Balling (previous) (diff)

in reply to:  7 comment:8 by PassingStrike, 15 months ago

Replying to Balling:

Well, Handbreak is mostly using ffmpeg. Please attach working Handbreak file.

Here they are, the original .webm and the recoded .mkv with Handbrake

comment:9 by PassingStrike, 15 months ago

I checked my files (the ones that work in Davinci and the one that doesn't) with ffprobe (ffprobe -i input) and I found a key difference in the audio stream:

Original .webm:

Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
    Metadata:
      DURATION        : 00:03:08.021000000

Mkv encoded with ffmpeg:

Stream #0:1(eng): Audio: vorbis, 48000 Hz, stereo, fltp (default)
    Metadata:
      ENCODER         : Lavc60.4.100 libvorbis
      DURATION        : 00:03:08.008000000 

Mkv encoded with Handbrake:

 Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : Stereo
      DURATION        : 00:03:08.010000000

Original mkv:

Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp (default)
    Metadata:
      DURATION        : 00:03:57,493000000

As you can see, any .mkv that works has aac as the audio format, while the others do not. Maybe Davinci doesn't recognise opus or vorbis, and that's why it doesn't recognise the audio.

comment:10 by Balling, 15 months ago

recognise opus or vorbis, and that's why it doesn't recognise the audio.

Of course it does not. Only Youtube app does really uses opus as the main audio format.

in reply to:  10 comment:11 by PassingStrike, 15 months ago

Replying to Balling:

recognise opus or vorbis, and that's why it doesn't recognise the audio.

Of course it does not. Only Youtube app does really uses opus as the main audio format.

Then I don't really know what it is.

comment:12 by Mads Johansen, 15 months ago

1) The mkv file you made works in DR 18.1.3 on windows (both audio and video).
2) Renaming the webm to mkv shows the video but no audio (because DR does not support opus audio)
3) So the problem is not ffmpeg -i xyz.webm xyz.mkv, but that you need to do ffmpeg -i xyz.webm -c:v copy -c:a aac -b:a 320k -ac 2 -ar 48000 xyz.mkv (where xyz is the file name), to copy the video and convert the audio to a DR supported codec.

in reply to:  12 comment:13 by PassingStrike, 15 months ago

Replying to Mads Johansen:

1) The mkv file you made works in DR 18.1.3 on windows (both audio and video).
2) Renaming the webm to mkv shows the video but no audio (because DR does not support opus audio)
3) So the problem is not ffmpeg -i xyz.webm xyz.mkv, but that you need to do ffmpeg -i xyz.webm -c:v copy -c:a aac -b:a 320k -ac 2 -ar 48000 xyz.mkv (where xyz is the file name), to copy the video and convert the audio to a DR supported codec.

1) No, I just updated to 18.1.3 and both renaming the .webm to .mkv and using ffmpeg -i input.webm output.mkv don't work. If you are talking about the -1.mkv, of course it does. I just said it was recoded with Handbrake and that it worked (in DR 18.1.2).
2) Glad to know I was right. As I said, I knew that just recoding it to .mp4 works, but I wanted to know why recoding it to .mkv didn't work.
3) Yes, that works. Thank you very much.

comment:14 by PassingStrike, 15 months ago

Resolution: fixed
Status: newclosed

comment:15 by Balling, 15 months ago

Resolution: fixedinvalid
Note: See TracTickets for help on using tickets.