NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
yt_clipper is a relatively simple way to clip videos from popular platforms (for now YouTube, WeVerse, Naver TV, and AfreecaTV).
It provides a graphical UI for video editing that creates instructions in json
format for clipping the video.
These instruction files are small and in plain text so they can be easily read, modified, and shared with others.
The clipper script
component provides a way to process these instructions and generate the clips you want.
For a video quickstart check out this video: https://imgur.com/a/gQ4KItt
Visit this quickstart guide to get up and running with yt_clipper
.
The contents of the quickstart guide are included here for convenience:
markup script
component of yt_clipper
by clicking here.clipper script
component of yt_clipper
by visiting Clipper Script Installation.markup script
is active on the page. Refresh the page if it is not active.markup script
and its hotkeys. You should see a flash message below the video..json
format.clipper script
.yt_clipper_auto.bat
.yt_clipper_auto.sh
program, drag and drop the saved markers data onto the terminal, and hit Enter.yt_clipper/webms/title-suffix
folder where title-suffix
is the file name stem of the markers data file.yt_clipper
discord server if you want further help or want to contribute.ffmpeg-N-101776-gd4575982f4-win64-gpl.zip
.yt_clipper_win_*/bin
with the contents of the bin
folder in the ffmpeg zip.YouTube is the primary video platform supported by yt_clipper. Other supported platforms are listed below.
gfycat.com
easier (e.g., quickly tagging multiple gfys, copying gfy links in various formats) at https://openuserjs.org/scripts/elwm/gfy-tools.Markup script
refers to the user script installed in your browser through a user script extension. It is used to mark up videos (e.g. on YouTube) before creating webm clips.Clipper script
refers to the python script (.py
)or the installation that consumes marker data in json
format to generate webm clips.First ensure the script is active on the page by checking your user script extension.
Alt+Shift+A: Toggle hotkeys on/off. A green message will flash below the video indicating hotkeys are enabled.
A shortcuts reference can be toggled by clicking the scissor icon in the video controls bar.
A: Add marker at current time (start = green, end = yellow, selected = black center). Multiple marker pairs can be added simultaneously.
Z: Undo last marker.
Shift+Z: Redo last undone marker.
Ctrl+Shift+Alt+Z: Delete currently selected marker pair. Does nothing if no pair selected.
Shift+Mouseover End Marker (Yellow) or Left-Click Any Marker Numbering: Toggle marker pair editor. Selected marker pairs have a black center.
Title Prefix
that will be prepended to the Title Suffix
and used in the webm name for the marker pair.Ctrl+Up: Select/deselect the most recently selected marker pair or else the first available pair.
Ctrl+Down: Toggle auto-hiding of unselected marker pairs. Hidden marker pairs cannot be selected with the mouse.
Adjusting marker position/time:
While a pair is selected use Shift+Q/Shift+A to move the start/end marker to current time.
Use Alt+Shift+Mousewheel and scroll up/down to move marker one frame forward/backward.
Alt+Click+Drag a marker numbering to quickly make rough adjustments to the marker's time.
Use Alt+Z/Alt+Shift+Z to undo/redo marker moves as well as speed and crop changes.
Jumping to and selecting marker pairs without the mouse
W: Global settings editor:
clipper script
and the crop resolution auto-scaled if a mismatch is detected.Title Suffix
appended to each marker pair Title Prefix
to produce its Full Title
.Title Suffix
is the YouTube video ID in square brackets (e.g., [Bey4XXJAqS8]).Title Suffix
is used for the name of the folder containing all generated webms.Shift+W: Open additional settings when the global settings editor or a marker pair editor is open.
Auto
will be automatically calculated based on the input video bitrate and other video properties. This is the recommended default.Inherit
will get their value from the global settings.Inherit
will get their value from the command line options or the yt_clipper_options
helper script prompt.Alt+Shift+Q/alt+Shift+X: Update all existing markers to default new marker speed (Q) or crop (X).
X: When marker or defaults editor is open, begin drawing crop.
Click+Drag on the video to set draw a rectangular crop.
While drawing crop, pressing X again will cancel drawing.
Crop is given as x-offset:y-offset:width:height
. Each value is a positive integer in pixels. Width
and height
can also be iw
and ih
respectively for input width and input height.
Ctrl+X: Cycle crop dim opacity by 25% plus one stop point at 90%.
Ctrl+Shift+X: Toggle crop crosshair.
Mouse-Based crop Adjustment:
Ctrl+Hover: Indicate potential drag action when hovering over crop.
Ctrl+Click+Drag: Drag and move crop or resize crop in the indicated directions.
Ctrl+Alt+Drag: Approximately aspect-ratio-locked mouse resizing of crop.
Ctrl+Shift+Drag: Center-out resize/draw of crop.
Ctrl+Shift+Drag: Horizontally-fixed (Y-only) drag of crop.
Ctrl+Alt+Drag: Vertically-fixed (X-only) drag of crop.
Arrow Key Crop Adjustment:
10
.y offset
by 10
.x offset
by 10
.y offset
to height
or from x offset
to width
.1
, Shift to 50
, Alt+Shift to 100
.Shift+Mouse-Wheel: Scroll the mouse wheel up/down over the video to skip forward/backward one frame per tick.
Alt+Click+Drag: Scrub/seek video time backward or forward by dragging left or right respectively.
C: Toggle previewing marker pair speed.
Shift+C: Toggle auto looping of currently selected marker pair.
Ctrl+Shift+C: Toggle auto crop chart section looping. This setting takes precedence over auto marker pair looping.
Alt+C: Toggle auto previewing gamma correction setting when between a marker pair.
Alt+Shift+C: Toggle fade loop previewing.
Ctrl+Alt+Shift+C: Toggle all previews.
If any preview feature is disabled, turns it on. If all preview features are enabled, disables all of them.
Works only when in fullscreen mode or theater mode.
Note that this does not yet work with drawing and previewing crops and should be disabled when doing so.
This feature is only for watching or previewing the video, and does not affect webm output.
Shift+R: Toggle big video previews on video progress bar hover.
Q: Toggle auto force setting of video playback speed. Takes precedence over any marker pair speed. This can be useful to try out different playback speeds without modifying settings.
Alt+Q: Cycle the force-set video speed down by 0.25. Use Q to toggle force settings video speed.
R/Alt+R: Toggle between a 90 degree clockwise/counter-clockwise rotation and no rotation.
E: Capture frame at current time of video at currently selected video quality/resolution.
Frame must be buffered and loaded.
Opens a pop-up window where captured frames are saved.
https://www.youtube.com
in your browser settings.Alt+E Trigger zipping of all captured frames for download.
S: Save markers info to a .json
file.
yt_clipper_auto
on Windows. On Mac, run the helper script and try dragging and dropping in the window that opens up when prompted.clipper script
use--json/-j
and pass the path of the markers data file.Alt+S: Copy markers json
data to clipboard. Useful if saving breaks.
G: Toggle markers data commands UI. Allows for uploading and loading markers data files in .json
format and for restoring markers data auto-saved in browser local storage.
Choose File
, pick your markers json
file, then click Load
.Shift+F: Flatten a VR video to make it easier to crop.
D: Toggle dynamic speed chart.
Alt+D: Toggle dynamic crop chart.
Shift+Click: Add a point at the clicked location.
Alt+A: Add a point at the current time.
Alt+Shift+Click: Delete a point.
Right-Click: Seek to time on bottom time-axis when clicking anywhere in chart area.
Alt+Right-Click/Ctrl+Alt+Right-Click: Set chart looping start/end marker.
Shift+D: Toggle chart loop markers
Ctrl+Mousewheel: Zoom in and out of chart.
Ctrl+Click: Reset zoom.
Click+Drag: Drag a point to move it or drag chart area to pan when zoomed in.
Alt+Z/Alt+Shift+Z: Undo/redo marker moves as well as speed and crop changes.
See Common Dynamic Chart Shortcuts for shortcuts shared between dynamic charts
like adding and removing points.
D: Toggle dynamic speed chart.
Notes:
0.05
and greater than or equal to 0.25
.See Common Dynamic Chart Shortcuts for shortcuts shared between dynamic charts
like adding and removing points.
Dynamic crop allows for panning a crop in the default pan-only
mode.
In pan-only
mode the crops of all crop chart points are maintained equal.
For zooming and panning, enable zoompan
mode from the marker pair settings extended options (Shift+W).
In zoompan
mode crops can change size for a zooming effect, but their aspect ratios are maintained equal.
Alt+D: Toggle dynamic crop chart.
Left-Click: Left-click a crop chart point to seek to it's time.
Left-Click+Drag: Left-click and drag a crop chart point to change it's time and seek/scrub the video.
Ctrl+Shift+C: Toggle auto crop chart section looping.
Ctrl/Alt+Mouseover: Select point as start/end of crop section.
Alt+Mousewheel-Up/Down: Intelligently toggle modes or select points. More specifically:
Ctrl+Alt+Shift+Mousewheel-Up/Down: Set current crop point's crop to that of the next/previous point's crop.
Ctrl+Shift+Click: Toggle crop point easing between auto and instant.
A/Shift+A: Set target crop component of all points following/preceding the currently selected point. Select crop components by placing your cursor in the crop input field in the marker pair settings.
10|0:100:920:1080
where the |
represents your cursor. Now hit the A key and all following crop points will have an X-Position of 100
.In zoompan
mode crops can change size for a zooming effect, but their aspect ratios are maintained equal.
The usual crop shortcuts have different effects than usual in this mode as described here.
Ctrl+Drag: Resize crop while maintaining aspect ratio.
Ctrl+Alt+Drag: Freely resize the crop, updating the aspect ratio of all other crop points to match automatically.
X: Draw crop.
clipper script
skips regenerating any existing webms.markup script
to view tooltips describing each setting.clipper script
is set to use the vp9 encoder by default (encoding used for webm videos on YouTube).--help
, -h
, or the yt_clipper_options
helper script for additional options that can be enabled on the command line.gamma
setting to bring back shadow or highlight detail.gamma values
with the markup script
.python ./yt_clipper.py -h # Prints help. Details all options and arguments.
python ./yt_clipper.py --markers-json markers.json # automatically generate webms using markers json
python ./yt_clipper.py -j markers.json --input-video ./clip.webm # provide a local input video
python ./yt_clipper.py -j markers.json --preview # preview marker pairs using ffplay
python ./yt_clipper.py -j markers.json --format bestvideo[width<=1080] # specify download format used by youtube-dl
Default arguments for the clipper
script may be set using a simple file format.
A default_args.txt
file with comments explaining the usage is provided with the clipper script installation.
The file contents are copied below for convenience:
# By default, this args file will be read by yt_clipper to set default arguments.
# To see all arguments use the `yt_clipper_options` helper script or the `-h` argument.
# Lines that begin with a `#` in this file are comments and are ignored.
# To use other arg files use the `--arg-files` argument outside of an arg file.
# The following commented lines provide an example of how to use this file.
# The lines can be uncommented (by removing the `#`) to test their effects.
# --audio
# --two-pass
# -di -dn 2
# --youtube-dl-alternative yt_dlp
See https://ffmpeg.org/ffplay.html#While-playing.
There is an installation that does not require the dependencies below.
yt_clipper_auto.bat
file on Windows or at the terminal prompt after executing yt_clipper_auto
on Mac.Ctrl+C
if you need to cancel the process../webms/<markers-json-filename>
.Markup script (js): (1) Find the yt_clipper*.js
file in the github release assets, (2) right-click > copy address
, (3) open user script extension dashboard, (4) find and use option to add a script via url (in tampermonkey, utilities tab > install from url
; in violentmonkey, +
button at top > install from url
).
Alternatively, (1) Download the yt_clipper*.js
file from the github release assets, (2) open user script extension dashboard, (3) open yt_clipper for editing, (4) click inside the editor and select everything with Ctrl+A
, (5) delete everything with say backspace
, (6) drag and drop the markup script js file into the editor, (7) Ctrl+S
to save.
Clipper script (platform-specific zip): Install as usual by extracting the zip file to a convenient location.
There are some alternative helper scripts for more options:
yt_clipper_options
to print all the available options and to be prompted for a string with additional options before running the script. This allows you to combine options (e.g., include audio and rotate and denoise).yt_clipper_preview
to locally preview markers json
data with ffplay
.yt_clipper_auto_download
to download video before processing markers.yt_clipper_auto_input_video
to specify both markers json
data and an input video for processing.json
and the input video onto yt_clipper_auto_input_video
.yt_clipper_auto_input_video
will prompt for the json
then the input video.The helper scripts have a simple format. Copy and edit yt_clipper_auto
in a text editor to create custom automated versions. For example you could add --deinterlace
to enable deinterlacing or use --only 2,5
to process only marker pairs 2 and 5.
On Windows:
@echo off
chcp 65001
cd /D "%~dp0"
FOR %%A IN (%*) DO (
REM you can add options after %%A of the next line as shown
.\yt_clipper.exe --markers-json %%A
)
pause
On Mac
#!/bin/bash
cd "$(dirname "$0")" || exit
read -rp "First enter the paths of 1 or more markers json data files (you may be able to drag and drop files at the prompt): " JSONPROMPT
IFS=$'\n' JSONS=( $(xargs -n1 <<< "$JSONPROMPT") )
for JSON in "${JSONS[@]}"
do
if [ -f "$JSON" ]; then
# you can add options after $JSON of the next line as shown
./yt_clipper --markers-json "$JSON"
else
echo "$JSON does not exist"
fi
done
There several utility scripts provided as well that wrap ffmpeg or other tools either for convenience or additional functionality.
fast_trim
utility script takes a single video file as input and trims it quickly BUT approximately. The script prompts for a start time and an end time to trim the input video file. The output file name will be suffixed with -trim
.vid2gif
utility script converts an input video file to a gif
with a small file size and resolution. The script will prompt for the output gif fps and scale/resolution.preprocess_hevc
utility script preprocesses an input video file (likely mp4
) with an hevc
video stream to ensure compatibility with ffmpeg. You may need to use this script if you see errors like Invalid data found when processing input
from ffmpeg when using hevc
with the --input-video
/-i
option or the yt_clipper_auto_input_video
helper script. The preprocessed output file name will be suffixed with -preproc
.The merge
utility script can be used to merge any webm files in any order:
merge.bat
script.-merged
appended to the first input file name.merge.txt
file to confirm the correct videos were merged in the correct order.Since clipper script v3.6.1
, releases can be tracked here: https://github.com/exwm/yt_clipper/releases.
These dependencies must be manually installed when not using the clipper script installation:
requirements.txt
:pip install -r ./src/clipper/requirements.txt
For a complete changelog, including beta and alpha releases,
see https://github.com/exwm/yt_clipper/blob/master/changelog.md.
For pre-version-unification (between markup
and clipper
scripts) changelogs see https://github.com/exwm/yt_clipper/blob/master/changelog-pre-version-unification.md.
Rating: 1