GithubHelp home page GithubHelp logo

gdquest / blender-power-sequencer Goto Github PK

View Code? Open in Web Editor NEW
694.0 64.0 58.0 1.75 MB

Add-on for video editing in Blender 3D: edit videos faster! Included in Blender 2.81+

Home Page: https://gdquest.com/blender/power-sequencer/

License: GNU General Public License v3.0

Python 99.19% Shell 0.81%
blender vse sequencer add-on plugin editing video-editing blender280 blender-vse

blender-power-sequencer's People

Contributors

aditiapratama avatar alopatindev avatar blezyn avatar calinou avatar chepecarlos avatar crenshawda avatar davcri avatar doakey3 avatar francois-grassard avatar guilhermehto avatar henriiquecampos avatar jooert avatar lucarood avatar modicolitor avatar nathanlovato avatar samytichadou avatar sudopluto avatar tangentstorm avatar theduckcow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blender-power-sequencer's Issues

Make GrabSequenceHandles work with multiple sequences

The current tool only works with the active strip. How can we determine which handle to grab? Using the selection's average middle frame (won't work if there's a strip far from the main selected body)? For each strip?

The latter option seems to be the easiest and most consistent one. It means you must pull the cursor to the right of the selection to get the right handle everywhere, and to the left to get the left. But if you select 2 strips, you can place the cursor in the middle and get the connecting handles without any click (B, border select the 2, and call the operator).

Write cli tool to check and transcode videos to the same framerate

To do:

  • Read the framerate with ffmpeg
  • Re-encode videos that have the wrong framerate

A very important tool as you'll find videos with 23.98, 24, 30, etc. fps online and Blender always treats them like they have the same framerate as your project.

Possible solution

From the command line:

  • Check that ffmpeg and/or ffprobe are available. If not, warn the user and exit the program
  • From Python, use ffprobe or another tool to check the framerate and info of every strip in a folder.
  • Store a list of video file paths with info dictionaries (only framerate to start with)
  • Build a list of the different video framerates found
  • Either use a default framerate to transcode if it's set or let the user pick one valid framerate from a list
  • Transcode the videos with ffmpeg and the -r option. Be sure to use ntsc and other built-in keywords for non-integer rates (not 29.98 etc.).

Feel free to ask help with the ffmpeg commands!

Extra notes

If you know a standard python lib that does it or a lightweight cross-platform python 3 script/lib/module we can ship with the add-on, great, we could avoid the external dependency. The lib's license must be compatible with the GPL license Blender uses.
Otherwise FFprobe comes with ffmpeg, which is almost necessary if you do FOSS video editing.

ImportLocalFootage: remove need for a specific folder structure

ImportLocalFootage requires local img/, audio/ and video/ folders next to the .blend file.
Instead, wouldn't it be better to let the users organize files the way they want? Traverse all the sub-directories entire directory and only ignore BL_proxy/ folders.

Issues: How about keeping source files within the project folder?

  • Add support for ignored folders (e.g. src)
  • Remove the need for specific directory names
  • Make reimport work with the new code

Design a landing page for Github

The current readme lacks some important info about what the add-on does, what it doesn't do, and some pictures/footage to showcase its features.

Review keymaps for faster editing

There are powerful editing features in Blender + the add-on, but the default shortcuts try to stay true to how Blender works in general. I tried to follow the same logic with the power-sequencer keymaps, but now it's time to review the full scheme and provide more accessible shortcuts.

A few ideas, coming from other programs:

  • I/O to do in and out trims (use smart trim operator) instead of Ctrl K, Alt K

  • [ and ] to change playback speed step

  • U and Ctrl R for undo/redo (Vi-style)?

  • Use a global modifier to apply operator to all channels instead of selected strips*

  • Use a modifier to represent left and right side operations

  • Find better shortcut for the contextual menu

  • Review shortcuts for all tools

  • E.g. Shift K to cut all, Shift I to trim all in, Shift O to trim all out, etc.

See #18 for related work

Rewrite ImportLocalFootage from scratch

The operator is a little monstrous. The code separation and clarity could be better, so it may be worth adding a bit of object-oriented design in there. The code broke at least 5 times this year, when fixing minor issues or edge cases. The problem is the operator's execute method does multiple completely different things:

  • find specific file types
  • write file paths to blender internal text files
  • convert paths to dictionaries blender can import
  • import strips
  • process imported strips

I think it's worth splitting up these things as class methods to start with.

known issues

Upon importing some files, only with this operator, they break audio strips. And I don't know why - couldn't find a reliable codec, container or case where this happens.

Add option to select cuts based on mouse position with Grab Handles

Grab handle lets you grab a handle without clicking. It finds the handle that's closest to the cursor and fires the grab operator. It's faster and often more precise than trying to click on the handles (depending on the zoom level you can miss the handle).

We should add the option to select cuts (handles on both sides of a cut) as well. The built-in option, Alt Shift Mouse Select, always adds to the selection, and you still have to press G to slide the cut so that's up to 3 keystrokes: A to deselect, Shift Alt R-Click to select the cut, and G to slide the cut.

 Shift G
 Add smart support: if no selection, select closest strip and closest handle to the cursor
 If close to a cut, select the handles on either side of the cut. Detection range should be zoom dependent.

Automatically add transform strips to imported pictures

The add-on offers a tool to quickly center the image strips' pivot, resize them to fit their original size, and add a transform strip to quickly move and animate it with VSE Transform.
If you loop over newly imported pictures and try to use this operator, you get a ZeroDivisionError. It seems Blender doesn't store an image's width and height (keeps it at 0) unless it's buffered/rendered on screen.

Workaround idea: move the time cursor to the start of each img strip and run the setup function on each of them individually?

Design a landing page on GDquest.com

The docs aren't going to stay on Github because the wiki isn't the most flexible tool. So the official website also needs a good landing page to help people understand what the add-on is about, see some pictures, find video tutorials...

Find a better name for the addon

The tool could use a more descriptive name. Something that's both clear and short. It should be clear it's a video editing addon:

  • Power-VSE
  • VSE-Plus
  • Video Editor Plus
  • Video Power

Any idea?

Add safety check for FPS change in ImportLocalFootage

Blender may change the FPS settings after importing new strips. Add a safety check to:

  • Warn the user if Blender detected a different framerate on the imported strips (Blender doesn't like it too much when sequences have different framerates)
  • Force the FPS settings to stay the same (fps, and fps_base if set to use a custom framerate)

Idea: store the framerate setting at the start of the script. Force to keep it at the end? Blender changes the FPS setting the first time you import a video, so the project settings match the given strip.

  • check if the length of the imported video and audio is different and warn the user
  • use self.report to print a warning if the user imports footage with a different framerate from the project. Ideally it should open a pop up window to make sure the user sees it. If not, if you grab a video from the web and import it after you did some edits, it can completely mess up your project.

Port quick video export operator to 2.79

Blender 2.79 introduced Constant Rate Factor for video export (the encoder tries to keep a certain quality level by itself) and changed the encoding options. It's simpler, clearer and so far 2.79 seems stable so it's worth porting the add-on to it. This means it the export tool won't be compatible with older versions of blender, but aside from that it should be backwards-compatible.

Add option to increase or lower the playback speed

Blender can't playback video or animation faster per se, but you can always skip frames during playback, effectively moving faster in time. There are 2 options:

  1. Move the time cursor on frame change
  2. Wrap all the features that affect the time cursor

I chose 1., as 2. seemed to work easier for frame offsets (arrow keys), but not playback. This choice has some drawbacks:

  • Add option in the header to change playback speed
  • Write handler to accelerate playback
  • Add keyboard shortcuts
  • Change the UI option an enum or a clearer selection (Speed: 1.5x, Speed: 2x, etc.)
  • Write initial docs

Add option to concatenate one next strip at a time

Concatenate snaps strips together as a continuous block. It removes gaps in a given channel in the timeline.

C

If you select a single strip, it will find the next one in the channel and concatenate it for you. It also selects the concatenated strip so you can chain it as many times as you want.

If you select multiple strips, it only concatenates your selection.

Shift C

If you select a single strip it concatenates all the next strips in the channel. Useful if you edit audio and video from different sources and want to remove gaps per channel.

Add a paint select tool?

Border select is nice, but we can have a faster option to select with the mouse.

Ideas:

  • Paint select, select all the strips on hover, without the need to click
  • Faster box select: start from the cursor, without the need to click first

[DOCS] Add "import local footage"

Here it is!
Let me know if there is something, in either form or content, that can be improved!

EDIT: changed "Blender root folder" to "Blender project folder".


Import local footage

Description: imports all images from a folder named IMG.

How to use it:

  1. Create a folder named IMG inside your Blender project folder (where the .blend file is)
  2. Put images inside this folder
  3. Go in Blender sequencer:
    1. Press SPACE
    2. Type ps importer
    3. Press ENTER

Note: Blender project needs to be saved before using this feature.

import_local_footage

Images will be stretched, by default, to fit the entire screen; if you want to keep the original size, read the next section.

Write a script to generate proxies with ffmpeg

Blender can't generate transparent proxies for images. 25% proxies are often of too low quality and have a high file size. Blender uses a single CPU core, so it takes a lot of time to generate them, and if you keep working and press Ctrl Z, you'll cancel the operation. I prefer to use ffmpeg outside Blender, but you need to automate the task:

  • find all movie and image files in the project folder
  • queue ffmpeg commands to generate individual proxies
  • add support for img files

Add operator to register and remove keybindings

Add 2 operators, accessible from the add-on, preferences, to register and unregister keymaps.

  • parse keymaps from a dict (and/or a JSON file?) for easier editing
  • duplicate the active keymap, rename to Power Sequencer
  • register and replace existing shortcuts if need be
  • Print collisions to the console
  • Report to the user?
  • add buttons to the add-on prefs

Should there be an option to register the full keymaps or by operator type (e.g. markers, editing, etc.)?

Add replacement copy and cut tools

You can copy strips in the vse but not cut and paste your selection. On top of that copy is relative to the time cursor, which is strange. Meaning if you copy and the time cursor is 300 frames away from the strip, when you paste it there'll be the same 300 frames offset.

  • there's no cut (copy and delete) tool

Prepare conference for the Capitole du Libre

I'll give a conference about video editing with Blender at the Capitole du Libre, a major FOSS event in France. The goal is to show that Blender is a serious option for video production. There are some excellent tools for motion graphics. I'm hoping to help raise awareness around the sequencer with the presentation and this add-on.

Add option to remove gaps with mouse_cut

In other video editors, gaps can often be selected and removed. It takes 3 keystrokes. In Blender, it takes 2 by default: place the time cursor before the gap, and press backspace. It's a common need while cutting, so let's add an option to do it with 1 keystroke.

Add initial menu

Add a menu in the VSE toolbar to show the most important operators from the add-on

  • Design the menu with the menu generator add-on
  • Learn to create and place a menu, with icons
  • Create a simple menu with the most important operators and icons
  • Parse/convert the JSON from the pie menu editor addon
  • Add the menu to keymaps

Merge sequencer content from another project

We need a quick and reliable way to import all the strips from a given scene in another .blend file to the current one, along with its dependencies (e.g. for a scene strip). This is the first step to conveniently reuse content and work more efficiently within the VSE.

The longer term goal is to build a library system, so you can quickly add template content to the sequencer (missing things like animated text, transitions, etc.)

It may be worth waiting to see how the asset workflow may help in Blender 2.8? It's not top priority right now.

Document the 5 main features of the add-on

For v1.0, not every function needs docs. Let's focus on the most useful ones, that'll be part of the initial menu, and add other operators as they get improvements. E.g. the tools that work with markers aren't as useful without extra features, like generating titles from blender and importing external blend files are in.

  • Import local footage
  • Render videos for the web
  • Add and edit crossfade
  • Cut and trim with the mouse
  • Add and clear fade

Write a script to retrieve operators, their id and label

A utility script to keep track of all the operators, and the ones that need documentation would be a time saver. Getting started, with Powershell:

Get-Content *.py | Select-String -Pattern "(^class)|(bl_idname)|(bl_label)" > output.txt

Help wanted: Do you know a tool to do it more easily? If not, I'll go with a python script.

  • Find class names, ids and labels
  • Write classes to a file in rst format
  • Write the rest to another file to use to build menus

Add tool to trim/delete strips to closest cuts

Trims strips above and below the mouse cursor between the two closest cuts

This is something I often need cutting video and audio that are not in sync (like in tutorials or vlogs). Working on this tool also means adding some new snap detection behavior for upcoming tools.

Python code structure review

The add-on could use a review from a more experienced python developer. If you could check it out quickly and give me some feedback on how to improve the code, it'd be deeply appreciated! Especially:

  • The overall code structure/organization
  • Pointing out bad practices
  • Should it feature automated/unit testing (I have no idea how to apply it efficiently to such an add-on)

Improve grab handles to take in account ripple edit

This operator grabs strips handles on the fly, based on the mouse position. It calls back the builtin grab operator. Snapping works (Ctrl key), but not ripple edit (Alt Key). The strip often overlaps existing ones.

Possible solutions:

  • Try macro operator (call them in succession)
  • ?

Improve mouse cut frame precision

Currently all mouse operators floor Blender's float coordinates for the frame and channel.
When you zoom in and want to do precision cuts, sometimes it feels 1 frame off. IIRC the add-on used to round coordinates but it didn't work. Gotta check it again.

ImportLocalFootage directory code is Windows only

For example, I was testing the ImportLocalFootage from load_files.py (with the intention of using it and then writing some doc ๐Ÿ˜„) and at Line 78 there is :

folders[folder_upper] = directory + "\\" + folder
# On my GNU\Linux OS:
# folders={'IMG': '/home/daenn/blender_projects/test\\IMG'}
# invalid path!

I don't understand why you use two backslash. Maybe it's a Windows thing ?


However code can be easily improved using os.path.join to create a path:

folders[folder_upper] = os.path.join(directory, folder)
# On my GNU\Linux OS:
# {'IMG': '/home/daenn/blender_projects/test/IMG'}

Note: using os.sep you will get the right path separator for every platform:

print(os.sep)  
# Linux =>  '/'
# Windows => '\'

mouse trim on a strip's end frame deletes it

Operator: gdquest_vse.mouse_cut
Cut mode: trim
Selection mode: smart

Steps:

  1. Apply mouse cut on a strip's end frame

Deletes the strip and everything between its start and end frames.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.