diff --git a/index.html b/index.html index 7151417..8bae9ae 100644 --- a/index.html +++ b/index.html @@ -450,14 +450,14 @@
WAV to MP3
-

ffmpeg -i input_file.wav -write_id3v1 1 -id3v2_version 3 -dither_method rectangular -out_sample_rate 48k -qscale:a 1 output_file.mp3

+

ffmpeg -i input_file.wav -write_id3v1 1 -id3v2_version 3 -dither_method triangular -out_sample_rate 48k -qscale:a 1 output_file.mp3

This will convert your WAV files to MP3s.

ffmpeg
starts the command
-i input_file
path and name of the input file
-write_id3v1 1
This will write metadata to an ID3v1 tag at the head of the file, assuming you’ve embedded metadata into the WAV file.
-id3v2_version 3
This will write metadata to an ID3v2.3 tag at the tail of the file, assuming you’ve embedded metadata into the WAV file.
-
-dither_method rectangular
Dither makes sure you don’t unnecessarily truncate the dynamic range of your audio.
+
-dither_method triangular
Dither makes sure you don’t unnecessarily truncate the dynamic range of your audio.
-out_sample_rate 48k
Sets the audio sampling frequency to 48 kHz. This can be omitted to use the same sampling frequency as the input.
-qscale:a 1
This sets the encoder to use a constant quality with a variable bitrate of between 190-250kbit/s. If you would prefer to use a constant bitrate, this could be replaced with -b:a 320k to set to the maximum bitrate allowed by the MP3 format. For more detailed discussion on variable vs constant bitrates see here.
output_file
path and name of the output file
@@ -476,7 +476,7 @@
Generate two access MP3s from input. One with appended audio (such as a copyright notice) and one unmodified.
-

ffmpeg -i input_file -i input_file_to_append -filter_complex "[0:a:0]asplit=2[a][b];[b]afifo[bb];[1:a:0][bb]concat=n=2:v=0:a=1[concatout]" -map "[a]" -codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2 output_file.mp3 -map "[concatout]" -codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2 output_file_appended.mp3

+

ffmpeg -i input_file -i input_file_to_append -filter_complex "[0:a:0]asplit=2[a][b];[b]afifo[bb];[1:a:0][bb]concat=n=2:v=0:a=1[concatout]" -map "[a]" -codec:a libmp3lame -dither_method triangular -qscale:a 2 output_file.mp3 -map "[concatout]" -codec:a libmp3lame -dither_method triangular -qscale:a 2 output_file_appended.mp3

This script allows you to generate two derivative audio files from a master while appending audio from a separate file (for example a copyright or institutional notice) to one of them.

ffmpeg
starts the command
@@ -487,10 +487,10 @@
[b]afifo[bb];
this buffers the stream "b" to help prevent dropped samples and renames stream to "bb"
[1:a:0][bb]concat=n=2:v=0:a=1[concatout]
concat is used to join files. n=2 tells the filter there are two inputs. v=0:a=1 Tells the filter there are 0 video outputs and 1 audio output. This command appends the audio from the second input to the beginning of stream "bb" and names the output "concatout"
-map "[a]"
this maps the unmodified audio stream to the first output
-
-codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2
sets up MP3 options (using constant quality)
+
-codec:a libmp3lame -dither_method triangular -qscale:a 2
sets up MP3 options (using constant quality)
output_file
path, name and extension of the output file (unmodified)
-map "[concatout]"
this maps the modified stream to the second output
-
-codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2
sets up MP3 options (using constant quality)
+
-codec:a libmp3lame -dither_method triangular -qscale:a 2
sets up MP3 options (using constant quality)
output_file_appended
path, name and extension of the output file (with appended notice)
@@ -502,14 +502,14 @@
WAV to AAC/MP4
-

ffmpeg -i input_file.wav -c:a aac -b:a 128k -dither_method rectangular -ar 44100 output_file.mp4

+

ffmpeg -i input_file.wav -c:a aac -b:a 128k -dither_method triangular -ar 44100 output_file.mp4

This will convert your WAV file to AAC/MP4.

ffmpeg
starts the command
-i input_file
path and name of the input file
-c:a aac
sets the audio codec to AAC
-b:a 128k
sets the bitrate of the audio to 128k
-
-dither_method rectangular
Dither makes sure you don’t unnecessarily truncate the dynamic range of your audio.
+
-dither_method triangular
Dither makes sure you don’t unnecessarily truncate the dynamic range of your audio.
-ar 44100
sets the audio sampling frequency to 44100 Hz, or 44.1 kHz, or “CD quality”
output_file
path and name of the output file
@@ -1066,7 +1066,7 @@

For example, to ensure that the video stream of the output file is visually lossless H.264 with a 4:2:0 chroma subsampling scheme, the command above could be amended to include the following:
-map "[video_out]" -c:v libx264 -pix_fmt yuv420p -preset veryslow -crf 18

Likewise, to encode the output audio stream as mp3, the command could include the following:
- -map "[audio_out]" -c:a libmp3lame -dither_method modified_e_weighted -qscale:a 2

+ -map "[audio_out]" -c:a libmp3lame -dither_method triangular -qscale:a 2

Variation: concatenating files of different resolutions

To concatenate files of different resolutions, you need to resize the videos to have matching resolutions prior to concatenation. The most basic way to do this is by using a scale filter and giving the dimensions of the file you wish to match:

-vf scale=1920:1080:flags=lanczos