cdgriffith / FastFlix

FastFlix is a free GUI for HEVC and AV1 encoding, GIF/WebP/AVIF creation, and more!
MIT License
1.08k stars 54 forks source link

DTS can't convert when using HEVC #32

Closed schlotkins closed 3 years ago

schlotkins commented 3 years ago

I am trying to encode with the DTS audio channel. I can't change anything in the conversion box (ac3 would be great!) and in the log I get this error:

2020-07-14 21:57:58,787 - flix INFO ffmpeg version git-2020-07-13-7772666 Copyright (c) 2000-2020 the FFmpeg developers 2020-07-14 21:57:58,791 - flix INFO Input #0, matroska,webm, from 'F:/Beautiful Day in the Neighborhood, A_t00.mkv': 2020-07-14 21:57:58,791 - flix INFO [NULL @ 00000146d8d42700] Unable to find a suitable output format for '768k' 2020-07-14 21:57:58,792 - flix INFO 768k: Invalid argument

the 768k is the bitrate for the DTS so I assume that is giving off the error.

Thanks! Chris

cdgriffith commented 3 years ago

Thanks for reporting these issues, and sorry it has them!

Something with how the command is being constructed with the audio must be being messed up. If you could copy paste the command it generated on the "Command List" tab could give some insight.

schlotkins commented 3 years ago

This is the code it gives:

"{ffmpeg}" -y -i "F:/RAMBO II_t00.mkv" -map 0:0 -c:v libaom-av1 -strict experimental -b:v 0 -crf 30 -map 0:2 -metadata:s:1 title="Surround 5.1" -metadata:s:1 handler="Surround 5.1" -c:1 copy "{output}"

It's the second stream of audio (DTS MAster is the first and ac3 audio commentary is 3. If DTS could convert to ac3 that would be ideal of course.

Thanks!

schlotkins commented 3 years ago

here's the audio screen rmabo

cdgriffith commented 3 years ago

I assume you probably just rushed for this example (which is much appreciated), need to make sure the Output format is set to HEVC and not AV1 as shown above. It also isn't showing any 768k in the actual command, so was it possible it was accidentally on a conversion and switched back or something? (aka I could have bad state somewhere in the app).

schlotkins commented 3 years ago

Sorry, here's the HEVC One:

"{ffmpeg}" -y -i "F:/RAMBO II_t00.mkv" -map 0:0 -c:v libx265 -crf 20 -preset slow -map 0:2 -metadata:s:1 title="Surround 5.1" -metadata:s:1 handler="Surround 5.1" -c:1 -b:a:1 768k -map 0:4 -c:2 copy -disposition:s:2 0 -metadata:s:2 language=eng -map_chapters 0 "{output}"

and here is the error:

2020-07-16 14:55:02,199 - flix INFO Running command: "C:\Users\Chris Schwarz\AppData\Roaming\FFmpeg\bin\ffmpeg.exe" -y -i "F:/RAMBO II_t00.mkv" -map 0:0 -c:v libx265 -crf 20 -preset slow -map 0:2 -metadata:s:1 title="Surround 5.1" -metadata:s:1 handler="Surround 5.1" -c:1 -b:a:1 768k -map 0:4 -c:2 copy -disposition:s:2 0 -metadata:s:2 language=eng -map_chapters 0 "F:/RAMBO II_t00-flix-1594936500.mkv" 2020-07-16 14:55:02,236 - flix INFO ffmpeg version git-2020-07-13-7772666 Copyright (c) 2000-2020 the FFmpeg developers 2020-07-16 14:55:02,250 - flix INFO [matroska,webm @ 000002ac9b6defc0] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size 2020-07-16 14:55:02,250 - flix INFO Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options 2020-07-16 14:55:02,251 - flix INFO Input #0, matroska,webm, from 'F:/RAMBO II_t00.mkv': 2020-07-16 14:55:02,252 - flix INFO [NULL @ 000002ac9b714180] Unable to find a suitable output format for '768k' 2020-07-16 14:55:02,252 - flix INFO 768k: Invalid argument

cdgriffith commented 3 years ago

Ah perfect, thank you! So I need to find where it's happening, but the issue is -c:1 -b:a:1 768k as there needs to be a codec after -c:1, if it was just going to be copied, it should be -c:1 copy and no -b:a.... What I am assuming is that somewhere in the code it thinks None is a valid conversion, instead of "don't convert".

schlotkins commented 3 years ago

Great glad that helped. If there is a way to get convert options in there (I have none to select from) that would be awesome. I want to stream to my roku. I think it can passthru DTS but still.

Thanks Chris

cdgriffith commented 3 years ago

Ah ok, so with some testing the main issue is that yes, right now FastFlix is "dumb" with how it does audio, aka it has a list of stuff it can convert to for a container and what encoders are available. Was made a subset of both conditions for safety, for example webm can only handle opus and vorbis, whereas this is cutting the other way (wrongly) that it thinks because it can't convert to it, the container can't handle it.

As DTS and DTS-HD MA are hugely popular formats, that needs to change. Will work on that soon:tm:

schlotkins commented 3 years ago

Awesome - look forward to it! Thanks!

schlotkins commented 3 years ago

I should note the only movie I have tried without DTS throws some really weird conversion bug that I think if FFMPEG related.

2020-07-16 17:59:53,145 - flix INFO frame= 2 fps=0.0 q=0.0 size= 3kB time=00:00:00.70 bitrate= 34.3kbits/s speed=0.858x 2020-07-16 17:59:53,145 - flix INFO [hevc @ 000001908459cb40] Skipping NAL unit 62 2020-07-16 17:59:53,193 - flix INFO [hevc @ 000001908459d000] Skipping NAL unit 62 2020-07-16 17:59:53,244 - flix INFO [hevc @ 000001908459dd80] Skipping NAL unit 62 2020-07-16 17:59:53,290 - flix INFO [hevc @ 000001908459e6c0] Skipping NAL unit 62 2020-07-16 17:59:53,342 - flix INFO [hevc @ 000001908459d480] Skipping NAL unit 62 2020-07-16 17:59:53,387 - flix INFO [hevc @ 000001908459e240] Skipping NAL unit 62 2020-07-16 17:59:53,437 - flix INFO [hevc @ 000001908459d900] Skipping NAL unit 62 2020-07-16 17:59:53,485 - flix INFO [hevc @ 000001908459b000] Skipping NAL unit 62 2020-07-16 17:59:53,531 - flix INFO [hevc @ 0000019084cf0d40] Skipping NAL unit 62 2020-07-16 17:59:53,580 - flix INFO [hevc @ 0000019084cefb00] Skipping NAL unit 62 2020-07-16 17:59:53,629 - flix INFO frame= 12 fps=8.8 q=0.0 size= 3kB time=00:00:01.15 bitrate= 20.9kbits/s speed=0.843x 2020-07-16 17:59:53,630 - flix INFO [hevc @ 0000019084ceff80] Skipping NAL unit 62 2020-07-16 17:59:53,678 - flix INFO [hevc @ 0000019084cf51c0] Skipping NAL unit 62 2020-07-16 17:59:53,724 - flix INFO [hevc @ 000001908459b480] Skipping NAL unit 62 2020-07-16 17:59:53,775 - flix INFO [hevc @ 000001908459b900] Skipping NAL unit 62 2020-07-16 17:59:53,821 - flix INFO [hevc @ 000001908459bdc0] Skipping NAL unit 62 2020-07-16 17:59:53,871 - flix INFO [hevc @ 000001908459c6c0] Skipping NAL unit 62 2020-07-16 17:59:53,918 - flix INFO [hevc @ 000001908459cb40] Skipping NAL unit 62 2020-07-16 17:59:58,058 - flix INFO Killing worker process

cdgriffith commented 3 years ago

Thankfully that is something you can safely ignore.

copy pasta from: https://codecalamity.com/encoding-uhd-4k-hdr10-videos-with-ffmpeg/#convert-the-video

During a conversion like this, when a Dolby Vision layer exists, you will see a lot of messages like [hevc @ 000001f93ece2e00] Skipping NAL unit 62 because there is an entire layer that ffmpeg does not yet know how to decode.

schlotkins commented 3 years ago

ah ok - I just tried and it worked! Once the color space issue is fixed I can convert some! Thanks again for this great tool!

schlotkins commented 3 years ago

Hi Chris: FYI I downloaded 2.2 and I am still getting the error when I try to convert with DTS selected. (Colors are still washed out too.) Thanks! Chris

cdgriffith commented 3 years ago

So the only hold up for the audio part is really figuring out a full set of supported codecs per container (which this could then also allow for changing container types, so would be very useful), but I have no idea how to accomplish that with FFmpeg so I have an open ticket for it on stack overflow.

Short term I am going to switch it to allow pass-through for HEVC no mater what it is, because there are very few audio formats MKV does not support. (Will address colors in other thread shortly!)

cdgriffith commented 3 years ago

Fixed in https://github.com/cdgriffith/FastFlix/releases/tag/2.3.0

Tracking better passthrough / audio / container support in https://github.com/cdgriffith/FastFlix/issues/37