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

Speeding up playback speed #22

Closed
suntong opened this issue Jan 2, 2022 · 2 comments
Closed

Speeding up playback speed #22

suntong opened this issue Jan 2, 2022 · 2 comments
Labels

Comments

@suntong
Copy link
Owner

suntong commented Jan 2, 2022

Speeding up playback speed needed.

@suntong
Copy link
Owner Author

suntong commented Jan 2, 2022

Fixed:

$ ffcvt -force -f "$FFCVT_FTC" --Speed 1.28

== Transcoding: Nice_scenic_videos_from_dashcam_With_Evening_sunset_view.mp4
] ffmpeg -i Nice_scenic_videos_from_dashcam_With_Evening_sunset_view.mp4 -speed 2 -c:v libvpx-vp9 -b:v 0 -crf 42 -c:a libopus -b:a 64k -c:s copy -y -filter_complex [0:v]setpts=PTS/1.28[v];[0:a]atempo=1.28[a] -map [v] -map [a] Nice_scenic_videos_from_dashcam_With_Evening_sunset_view_.mkv

Done.
Org Size: 9765 KB
New Size: 6713 KB
Saved:    31% with 3052 KB
Time: 1m55.215753905s at 2022-01-02 17:48:07


Transcoding completed in 1m55.216193021s
Org Size: 9 MB
New Size: 6 MB
Saved:    31%

It works. However, there is a caveat --

Using --Speed and -Cut together doesn't work as expected:

$ ffcvt -force -f "$FFCVT_FTC" --Speed 1.28 -C 00:00:40-00:00:50 -C 00:00:53-00:00:56

== Transcoding: Nice_scenic_videos_from_dashcam_With_Evening_sunset_view.mp4
] ffmpeg -i Nice_scenic_videos_from_dashcam_With_Evening_sunset_view.mp4 -speed 2 -c:v libvpx-vp9 -b:v 0 -crf 42 -c:a libopus -b:a 64k -c:s copy -y -filter_complex [0:v]setpts=PTS/1.28[v];[0:a]atempo=1.28[a] -map [v] -map [a] -filter_complex [0:v]trim=start=40:end=50,setpts=PTS-STARTPTS[v0];[0:a]atrim=start=40:end=50,asetpts=PTS-STARTPTS[a0];[0:v]trim=start=53:end=56,setpts=PTS-STARTPTS[v1];[0:a]atrim=start=53:end=56,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1[vo][ao] -map [vo] -map [ao] Nice_scenic_videos_from_dashcam_With_Evening_sunset_view_.mkv

Done.
Org Size: 9765 KB
New Size: 7112 KB
Saved:    27% with 2653 KB
Time: 2m2.876558318s at 2022-01-02 17:52:08


Transcoding completed in 2m2.876771032s
Org Size: 9 MB
New Size: 6 MB
Saved:    27%

What I got was a full video, not the cut version.

I don't know why and whether that can be fixed. I'll worry about it later...

@suntong suntong closed this as completed in c8dea36 Jan 2, 2022
@suntong
Copy link
Owner Author

suntong commented May 16, 2023

Tried

ffmpeg -i Nice_scenic_videos_from_dashcam_With_Evening_sunset_view.mp4 -speed 2 -c:v libvpx-vp9 -b:v 0 -crf 42 -c:a libopus -b:a 64k -c:s copy -y -filter_complex '[0:v]setpts=PTS/1.28;[0:a]atempo=1.28;[0:v]trim=start=40:end=50,setpts=PTS-STARTPTS[v0];[0:a]atrim=start=40:end=50,asetpts=PTS-STARTPTS[a0];[0:v]trim=start=53:end=56,setpts=PTS-STARTPTS[v1];[0:a]atrim=start=53:end=56,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1[vo][ao]' -map '[vo]' -map '[ao]' Nice_scenic_videos_from_dashcam_With_Evening_sunset_view_.mkv

and

ffmpeg -i Nice_scenic_videos_from_dashcam_With_Evening_sunset_view.mp4 -speed 2 -c:v libvpx-vp9 -b:v 0 -crf 42 -c:a libopus -b:a 64k -c:s copy -y -filter_complex '[0:v]setpts=PTS/1.28[v];[0:a]atempo=1.28[a];[v]trim=start=40:end=50,setpts=PTS-STARTPTS[v0];[a]atrim=start=40:end=50,asetpts=PTS-STARTPTS[a0];[v]trim=start=53:end=56,setpts=PTS-STARTPTS[v1];[a]atrim=start=53:end=56,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1[vo][ao]' -map '[vo]' -map '[ao]' Nice_scenic_videos_from_dashcam_With_Evening_sunset_view_.mkv

The first one still got full video, and the second one's timestamp doesn't seems right.

So, --Speed and -Cut cannot be used together.

Do them in separated steps instead, if needed.

@suntong suntong added the wiki label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant