Console: X
CLEAR CONSOLE
/cre8/ - Art & Creativity
mpv clip script CAT Tue 27/05/2025 12:09:20 PM 6 days ago MER No. 217 +
niggers-1...mp4
(1.15 MB 1606x674 00:00:16)
Thumbnail
I (AI) generated this quick script for mpv: https://mpv.io/ that uses ffmpeg: https://ffmpeg.org/ to generate a 5s, 10s, 15s, 30s, 60s clip while u are watching a video in mpv: https://files.catbox.moe/1j3agj.rar
Put this into \AppData\Roaming\mpv unless u already have ur own uosc.conf file just add for the UI buttons:
command:content_cut:script-message-to clip_next clip 5?Clip 5s,command:content_cut:script-message-to clip_next clip 10?Clip 10s,command:content_cut:script-message-to clip_next clip 15?Clip 15s,command:content_cut:script-message-to clip_next clip 30?Clip 30s,command:content_cut:script-message-to clip_next clip 60?Clip 60s

You can modify the ffmpeg command in clip-next.lua file as it uses -c copy to avoid re-encoding, which makes clipping fast and lossless. Although a bit of a problem with this method as it seeks to the nearest keyframe before your selected start time, so the resulting clip might begin a few seconds earlier than expected. If you want it accurate just re-encode it instead.
Also you can change the directory where it encodes the file by changing "dir" value to a path.

I really don't get why all of the media players never bothered to implement such a simple yet extremely needed feature.
Also u can use either handbrake: https://handbrake.fr/ or https://vidcoder.net/ (preferred as u can set file size limit) to convert the clip later to something else but at least you don't have to mess around with them now to clip something and its all instantaneous now.
Link Icon Edit
Anonymous Wed 28/05/2025 7:56:34 AM 5 days ago MER No. 218 +
Cool stuff! Personally, I prefer to cut things precisely and not have some predefined length. I used some free video editor for that
>I really don't get why all of the media players never bothered to implement such a simple yet extremely needed feature
We're talking about mpv here, they don't even consider a decent UI something necessary.

Personally, I've been trying the various noise-filtering tools available in mpv. I've found out they have 3 or 4 different approaches, including AI stuff. I think mpv command line options are pretty cumbersome to write, and it took me a while to figure everything out, but in the end one approach (afftdn) worked quite well for me.
Anonymous Wed 28/05/2025 8:20:22 AM 5 days ago MER No. 219 +
>>218
>Personally, I prefer to cut things precisely and not have some predefined length.
I think it's just that I don't want to interrupt myself while watching a long TV show or movie just because a scene might make an interesting clip. So instead, I lazily create a bunch of rough clips of interesting scenes, and then cut them down to precise lengths later.
There's also cases where I am watching long ass compilations of something or maybe even a livestream vod.
>We're talking about mpv here, they don't even consider a decent UI something necessary.
I wasn't really talking about mpv in this case but about like all of the other media players that are available like Windows MPC-HC, MPC-BE, VLC, QMPlay2, etc. I mean there are various UI tools for mpv if you want them with fairly simple installation instructions but mpv as a whole seems like a thing for nerds to mess around to their liking.
Anonymous Wed 28/05/2025 11:16:38 AM 5 days ago MER No. 220 +
>>219
>I lazily create a bunch of rough clips of interesting scenes, and then cut them down to precise lengths later.
Makes sense
>I wasn't really talking about mpv in this case
I just checked and apparently you can make clips from a video in vlc. You need to turn on "Advanced controls" in the "View" menu. That gives you a "record" button that can be used to record a clip from what you are watching.
>there are various UI tools for mpv
True, and maybe I should check them out. What discouraged me is that apparently they are not that popular and most people use mpv directly, or at least that was my impression. So I feel like the mpv people deciding not to work on a proper UI resulted in everyone giving up on having one, which is a shame.
Anonymous Thu 29/05/2025 9:15:54 AM 4 days ago
(edited 1x)
  • May 29, 2025, 9:38 a.m.
  • MER No. 221 +
    Clip_90S_...mp4
    (50.99 MB 1918x1080 00:01:30)
    Thumbnail
    Generated a few changes to the script: https://files.catbox.moe/x41md3.rar
    This version of the script re-encodes the video instead of using -c copy, due to the earlier mentioned keyframe precision issue. Because FFmpeg needs to decode the video from the beginning up to the target timestamp when re-encoding (especially when using -ss after the input), the encoding process takes longer the further into the video you go.
    For clipping Anime:
    Subtitles, it copies all of them over to the output container .mkv (or .mp4 if the subtitles are compatible: mov_text).
    Audio, the script checks whether there is a Japanese audio stream (jpn). If one exists, it copies only that stream; otherwise, it defaults to the first available audio stream.
    I did this mostly because you can't really pick out the correct English subtitle stream in most cases and I don't really wanna have to switch to the Japanese audio every time I open a clip. (yeah, fuck you English dub watchers)
    Also its now 5s - 15s - 30s - 60s - 90s - 120s buttons.
    Anonymous Thu 29/05/2025 9:17:51 AM 4 days ago
    (edited 1x)
  • May 29, 2025, 9:21 a.m.
  • MER No. 222 +
    >>221
    Oh yeah, before using this please change the value of "OUT_DIR" to an directory where you want to clips to output to. Also, you can open the console in mpv with ` if you encounter an error with the clip feature.
    [Refresh] ...
    Preview
    Tegaki
    𝄞 𝄡 𝄢 𝄖 𝄗 ( ) $ ¥ £ ¢ ω Д ´ @ _ + × ÷ = π
    Privacy - Terms
    • Supported file types are: JPG, JPEG, PNG, GIF, MP4, WEBM, MP3, OGG, OPUS.
    • (AAC, M4A, FLAC, WAV, AIFF, AIF) are automatically converted to high-quality OPUS format at 192kbps.
      The combined file size can be up to 300MB.
    • You can choose up to 8 files.
    • You can choose up to 1 drawing.
    • Maximum file size 100MB.
    Test your posts here