Giter VIP home page Giter VIP logo

Comments (5)

AngelaDMerkel avatar AngelaDMerkel commented on July 24, 2024

This seems correct to me. The unit is different in each of those. You requested 4000 Kilobytes and are getting results in Megabits which are a different unit. 4000 Kilobytes is 32 Megabits and you are well within that range based on what you've shown us.

Bits v Bytes

from immich.

Goodwu avatar Goodwu commented on July 24, 2024

This seems correct to me. The unit is different in each of those. You requested 4000 Kilobytes and are getting results in Megabits which are a different unit. 4000 Kilobytes is 32 Megabits and you are well within that range based on what you've shown us.

Bits v Bytes

This setting is for "max bitrate". So the unit should be kilo bit.
And this setting also appear at ffmpeg command line:
/usr/bin/ffmpeg -hwaccel qsv -hwaccel_output_format qsv -async_depth 4 -threads 1 -i /media/photos/xxx.mp4 -y -c:v h264_qsv -c:a aac -movflags faststart -fps_mode passthrough -map 0:1 -map 0:0 -bf 7 -refs 5 -g 256 -v verbose -vf scale_qsv=-1:720:async_depth=4:mode=hq:format=nv12 -preset 1 -global_quality:v 5 -maxrate 4000k -bufsize 8000k xxx.mp4
The ffmpeg manual also indicate the unit is kilo bit.
I add -b:v 1000k argument to ffmpeg command line and calculate the bitrate of output file, it shows 1000k is 1000kilo bit. It's not reasonable that the unit of -b:v is different from -maxrate in the single command line.
So I request for 4000kilo bits here and immich also treat it as 4000 kilo bits on ffmpeg command line but treat it as 4000 kilo bytes on examing the orinal video file?

from immich.

AngelaDMerkel avatar AngelaDMerkel commented on July 24, 2024

There are two things that could be causing this problem:

  1. The final bitrate is including the aac which you are not transcoding into something smaller like opus
  2. QSV isn't compliant with all the filters and other flags you've set and is misbehaving. I don't have access to anything with QSV enable and generally don't use quicksync so I can't test this on my machine either. Sorry.

I have always had problems with NVENC and more complex transcodes and just don't bother. Also, I understand that ffmpeg likes two pass encoding to achieve a desired max bitrate.

from immich.

AngelaDMerkel avatar AngelaDMerkel commented on July 24, 2024

I have taken a quick look at some of the documentation and there is no mention of support for ffmpeg filters in QSV but the ffmpeg wiki seems like it should include support for scaling and most of the other filters you are using.

from immich.

Goodwu avatar Goodwu commented on July 24, 2024

There are two things that could be causing this problem:

  1. The final bitrate is including the aac which you are not transcoding into something smaller like opus
  2. QSV isn't compliant with all the filters and other flags you've set and is misbehaving. I don't have access to anything with QSV enable and generally don't use quicksync so I can't test this on my machine either. Sorry.

I have always had problems with NVENC and more complex transcodes and just don't bother. Also, I understand that ffmpeg likes two pass encoding to achieve a desired max bitrate.

I'm not talking about transcoding it self but the decision of if transcoding or not.
I think the video should be transcoded instead of just copy the video track.
Here's the command line of ffmpeg:

/usr/bin/ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i /media/photos/小区相关/业委会/00001.MTS -y -c:v copy -c:a aac -movflags faststart -fps_mode passthrough -map 0:0 -map 0:1 -bf 7 -refs 5 -g 256 -v verbose -preset 7 -global_quality:v 23 -maxrate 4000k -bufsize 8000k upload/encoded-video/0ef79aea-c9d6-4f20-b7d2-bc3a01408cb6/57/7f/577f0c7e-cb57-45ec-85e4-bacb04c4b2e0.mp4

from immich.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.