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

Option "bitrate=32k" fails silently when exporting to ogg. #80

Closed
BreadMaker opened this issue Dec 4, 2014 · 5 comments
Closed

Option "bitrate=32k" fails silently when exporting to ogg. #80

BreadMaker opened this issue Dec 4, 2014 · 5 comments

Comments

@BreadMaker
Copy link

I have this script that I use to maintain a music database. So far I have no problems, the files are exported to ogg format and stored in the database, but I've noticed that the quality options (intended to reduce the final size of the DB) are ignored completely. I tried both the bitrate and the parameters options.

preview.export("tmp.ogg", "ogg", codec="libvorbis", parameters=["-aq", "1", "-ab", "32k"])
preview.export("tmp.ogg", "ogg", codec="libvorbis", bitrate="64k")

I've done some tests in mp3, and the quality options work as they should. My question is: Do I need some library (libav seems to be installed), or I found a bug?

In case you were wondering, I prefer to use ogg for its best quality/size ratio compared to mp3.

I'm using python 2.7.6 and pydub 0.9.5. Don't know if relevant, but I'm using a 64-bit GNU/Linux system.

@BreadMaker
Copy link
Author

After reading through a lot of different documentations, I have found the correct parameters for avconv, adding -ab (non-existent) made the important parameter -aq be ignored. bitrate keeps ignored. This info should be documented.

BTW, the corrected (and working as expected) line is:

preview.export("tmp.ogg", "ogg", codec="libvorbis", parameters=["-aq", "0", "-ar", "32000"])

@BreadMaker BreadMaker changed the title Quality options ignored when exporting to ogg. Option "bitrate" ignored when exporting to ogg. Dec 4, 2014
@BreadMaker
Copy link
Author

I've been trying different settings and I've noticed something, the bitrate parameter has always worked, but not the way I expected.

Now the following happens: bitrate="64k" works but bitrate="32k" fails silently. The lowest option that works for me is bitrate="48k" that generates a much smaller file (just what I need)

preview.export("tmp.ogg", "ogg", codec="libvorbis", bitrate="48k")

After this odyssey, I conclude that pydub is a great project, but unfortunately requires more documentation.

@BreadMaker BreadMaker changed the title Option "bitrate" ignored when exporting to ogg. Option "bitrate=32k" fails silently when exporting to ogg. Dec 4, 2014
@jiaaro
Copy link
Owner

jiaaro commented Dec 4, 2014

@BreadMaker thanks for the bug report! I've been working on docs (even wrote some today!) but there's a lot to cover, especially for the export method, since it covers much of the functionality of ffmpeg.

I will update the docs with your notes when I'm back at my computer :)

Thanks again!

@jiaaro
Copy link
Owner

jiaaro commented Dec 8, 2014

@BreadMaker After further research, each codec has it's own rules about acceptable bitrates. The ffmpeg documentation is pretty light on details but does have some info on bitrate arguments.

@BreadMaker
Copy link
Author

Cool, if you add an statement about that in the export docstring, I think we can close this issue.

jiaaro added a commit that referenced this issue Dec 9, 2014
@jiaaro jiaaro closed this as completed Dec 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants