Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-emissions
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-emissions
Commits
5cb54f88
Commit
5cb54f88
authored
Apr 04, 2020
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert bitrate conversion scale to match mp3 encoder
parent
b44ec973
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
emissions/management/commands/create-sound-files.py
emissions/management/commands/create-sound-files.py
+5
-4
No files found.
emissions/management/commands/create-sound-files.py
View file @
5cb54f88
...
...
@@ -123,23 +123,24 @@ class Command(BaseCommand):
vorbis_rates
=
[
64
,
80
,
96
,
112
,
128
,
160
,
192
,
224
,
256
,
320
,
500
]
orig_bitrate
=
get_bitrate
(
soundfile
.
file
.
path
)
vorbis_q
=
5
mp3_q
=
4
if
orig_bitrate
is
not
None
:
if
soundfile
.
episode
.
emission
.
podcast_sound_quality
==
'high'
:
vorbis_q
=
9
mp3_q
=
9
# cap quality to original bitrate (using vorbis quality mapping)
for
i
,
rate
in
enumerate
(
vorbis_rates
):
if
orig_bitrate
<
rate
:
vorbis_q
=
min
((
i
,
vorbis_q
))
mp3_q
=
min
((
i
,
mp3_q
))
break
cmd
=
[
'ffmpeg'
,
'-y'
,
'-i'
,
soundfile
.
file
.
path
]
if
format
==
'ogg'
:
cmd
.
extend
([
'-q:a'
,
str
(
vorbis_q
)])
elif
format
==
'mp3'
:
cmd
.
extend
([
'-q:a'
,
str
(
mp3_q
)])
mp3_q
=
9
-
vorbis_q
if
mp3_q
==
0
:
cmd
.
extend
([
'-b:a'
,
'320k'
])
else
:
cmd
.
extend
([
'-q:a'
,
str
(
mp3_q
)])
cmd
.
append
(
file_path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment