From 52dd44778fe686919cecb530542448e51e3fe43a Mon Sep 17 00:00:00 2001 From: Reto Kromer Date: Sat, 28 Jul 2018 10:28:47 +0200 Subject: [PATCH 1/2] add `-r` in modify speed recipe --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 094fd54..8136557 100644 --- a/index.html +++ b/index.html @@ -669,10 +669,11 @@

Examples

Modify image and sound speed

E.g. for converting 24fps to 25fps with audio pitch compensation for PAL access copies. (Thanks @kieranjol!)

-

ffmpeg -i input_file -filter_complex "[0:v]setpts=input_fps/output_fps*PTS[v]; [0:a]atempo=output_fps/input_fps[a]" -map "[v]" -map "[a]" output_file

+

ffmpeg -i input_file -filter_complex -r output_fps "[0:v]setpts=input_fps/output_fps*PTS[v]; [0:a]atempo=output_fps/input_fps[a]" -map "[v]" -map "[a]" output_file

ffmpeg
starts the command
-i input_file
path, name and extension of the input file
+
-r output_fps
sets the frame rate of the output_file
-filter_complex "[0:v]setpts=input_fps/output_fps*PTS[v]; [0:a]atempo=output_fps/input_fps[a]"
A complex filter is needed here, in order to handle video stream and the audio stream separately. The setpts video filter modifies the PTS (presentation time stamp) of the video stream, and the atempo audio filter modifies the speed of the audio stream while keeping the same sound pitch. Note that the parameter order for the image and for the sound are inverted:
  • In the video filter setpts the numerator input_fps sets the input speed and the denominator output_fps sets the output speed; both values are given in frames per second.
  • From 738ceabfe659d28f775259d07889629810d990cc Mon Sep 17 00:00:00 2001 From: Reto Kromer Date: Sat, 28 Jul 2018 11:22:47 +0200 Subject: [PATCH 2/2] fix error --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 8136557..c8bba03 100644 --- a/index.html +++ b/index.html @@ -669,7 +669,7 @@

    Examples

    Modify image and sound speed

    E.g. for converting 24fps to 25fps with audio pitch compensation for PAL access copies. (Thanks @kieranjol!)

    -

    ffmpeg -i input_file -filter_complex -r output_fps "[0:v]setpts=input_fps/output_fps*PTS[v]; [0:a]atempo=output_fps/input_fps[a]" -map "[v]" -map "[a]" output_file

    +

    ffmpeg -i input_file -r output_fps -filter_complex "[0:v]setpts=input_fps/output_fps*PTS[v]; [0:a]atempo=output_fps/input_fps[a]" -map "[v]" -map "[a]" output_file

    ffmpeg
    starts the command
    -i input_file
    path, name and extension of the input file