Skip to content

Commit

Permalink
clarify merge option
Browse files Browse the repository at this point in the history
  • Loading branch information
slhck committed Feb 27, 2017
1 parent b793489 commit 2698efd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Expand Up @@ -3,6 +3,11 @@
History
-------

0.4.2 (2017-02-27)
__________________

* Clarify use of merge option

0.4.1 (2017-02-13)
__________________

Expand Down
3 changes: 1 addition & 2 deletions README.rst
Expand Up @@ -43,8 +43,7 @@ Options:
- ``-v``, ``--verbose`` — Enable verbose output
- ``-n``, ``--dry-run`` — Show what would be done, do not convert
- ``-d``, ``--debug`` — Show debug output
- ``-u``, ``--merge`` — Don’t create a separate WAV file but update the
original file. Use in combination with -p to create a copy
- ``-u``, ``--merge`` — Take original file's streams and merge the normalized audio. Note: This will not overwrite the input file, but output to ``normalized-<input>``.
- ``-a``, ``--acodec <acodec>`` — Set audio codec for ffmpeg (see
`ffmpeg -encoders`) (will be chosen based on format, default pcm_s16le for WAV)
- ``-r``, ``--format <format>`` – Set format for ffmpeg (see `ffmpeg -formats`) to use for output file [default: wav]
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg_normalize/__init__.py
@@ -1 +1 @@
__version__ = "0.4.1"
__version__ = "0.4.2"
8 changes: 4 additions & 4 deletions ffmpeg_normalize/__main__.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""
ffmpeg-normalize 0.4.1
ffmpeg-normalize 0.4.2
ffmpeg script for normalizing audio.
Expand All @@ -27,7 +27,7 @@
-v --verbose Enable verbose output
-n --dry-run Show what would be done, do not convert
-d --debug Show debug output
-u --merge Don't create a separate WAV file but update the original file. Use in combination with -p to create a copy
-u --merge Take original file's streams and merge the normalized audio. Note: This will not overwrite the input file, but output to `normalized-<input>`.
-a --acodec <acodec> Set audio codec for ffmpeg (see `ffmpeg -encoders`) to use for output (will be chosen based on format, default pcm_s16le for WAV)
-r --format <format> Set format for ffmpeg (see `ffmpeg -formats`) to use for output file [default: wav]
-e --extra-options <extra-options> Set extra options passed to ffmpeg (e.g. "-b:a 192k" to set audio bitrate)
Expand Down Expand Up @@ -287,9 +287,9 @@ def adjust_volume(self):

if self.merge:
# when merging, copy the video and subtitle stream over and apply the audio filter
cmd += '-strict -2 -c:v copy -c:s copy -filter:a "volume=' + str(self.adjustment) + 'dB" '
cmd += '-strict -2 -c:v copy -c:s copy -map_metadata 0 -filter:a "volume=' + str(self.adjustment) + 'dB" '
if not self.acodec:
logger.warn("Merging audio back into original file, but encoder was automatically chosen. Set '--acodec' to overwrite.")
logger.warn("Merging audio with the original file, but encoder was automatically chosen. Set '--acodec' to overwrite.")
else:
# when outputting a file, disable video and subtitles
cmd += '-vn -sn -filter:a "volume=' + str(self.adjustment) + 'dB" '
Expand Down

0 comments on commit 2698efd

Please sign in to comment.