Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-pass encoding #6

Open
rikai opened this issue Sep 10, 2016 · 6 comments
Open

Multi-pass encoding #6

rikai opened this issue Sep 10, 2016 · 6 comments

Comments

@rikai
Copy link
Contributor

rikai commented Sep 10, 2016

I took a swing at implementing this myself already, but it was more difficult than i anticipated.

The ability to do multi-pass encoding would help to improve the quality:filesize ratio, though.

@ardeaf
Copy link

ardeaf commented May 31, 2017

Added in a PR for multiple passes, afaik anything beyond 2 is inconsequential, so I hard-coded that in for now in the #19

dv-anomaly pushed a commit that referenced this issue Jun 6, 2017
a rendering engine that uses more threads
@dv-anomaly
Copy link
Collaborator

We will need to rework this into the newgui branch.

@ardeaf
Copy link

ardeaf commented Jun 6, 2017

Yeah, should be much easier once there is an options drop-down for it that we can pull from, or whatever.

@ardeaf
Copy link

ardeaf commented Jun 7, 2017

Quite new to ffmpeg myself and encoding in general, but can someone confirm/clarify something for me:

By default, when you encode in x264, ffmpeg uses a crf with a factor of 23 or so.

Once you specify what bitrate you want, you can do multi-pass encoding.

In that case for our new GUI we would need to incorporate a radio button to switch between those two options as they are incompatible with each other. Or a separate "bitrate"/"quality" tab where we can specify the various options for CRF and Multi-pass encoding, like:

Setting for both:
Preset: Ultra fast to very slow, determines compression, default = medium

CRF:
Value: 0-51 quality, 0 is lossless, 51 is the worst. default = 23

Multi-pass:
Number of passes
Bitrate for each pass

@tassaron
Copy link
Collaborator

tassaron commented Jun 7, 2017

Perhaps we should separate the encoder settings widget into its own file with a separate ui file, so it's easier to manage this complexity as more settings are added.

@tassaron tassaron removed the newgui label May 2, 2022
tassaron added a commit that referenced this issue May 9, 2022
Currently broken for any component using the Video class which doesn't properly re-open a pipe to FFmpeg during the second pass. Should be an easy fix. The bigger issue is that multipass encoding only works with specific bitrates
@tassaron
Copy link
Collaborator

tassaron commented May 9, 2022

I separated 1 encoder pass into its own method, and tried adding a 2-pass encoding option based on @ardeaf's pull request #19

Branch here: https://github.com/djfun/audio-visualizer-python/tree/feat-2-pass-encoding
Note: the 2-pass encoding breaks if using Video, Spectrum, or Waveform components. That would be easy to fix later.

It seems to work at some video bitrates (1200 with my test audio) and will produce slightly different videos, but I don't really know how to tell if I'm doing it right nor how to tell which bitrates would actually work. We have to detect that ahead-of-time.

If anyone still wants this feature, please let me know :)

tassaron added a commit that referenced this issue May 10, 2022
Currently broken for any component using the Video class which doesn't properly re-open a pipe to FFmpeg during the second pass. Should be an easy fix. The bigger issue is that multipass encoding only works with specific bitrates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants