Sequencer Addon: Trim Videos before adding them to the Timeline (In and Outpoints)

I guess you could make virtual subclips by adding a colour effect strip of the range that you want and place it beneath the source strip. You could select the colour effect strip and trim the scene duration to that “Virtual Subclip” then use that as in/out points.

Here is a video to describe what I mean :wink:

@sunboy: congratulations for this addon!!

idea:, you can just remove the scene created when the video is loaded, it is not needed at all, you can record the last edit points selected in a scene property, and also keep record of filepaths and in/out points in a text-block, with CSV or something similar…

another idea, an operator can be made to “paint/add” the color strips (like 3pointedit does) over any movie according to the actual usage of this strip in another VSE scene…

I was using the color strip as a in/outpoint markers I guess. It would be neat to have the tools from Carlos’s Jump to Cut script (set start/end frame from selection), so that you don’t have to do much manual clicking around.

Yes, click counts are one of the focal points. As I like to put it, when an idea seems only a step away mentally, having to do too many clicks to actually do it makes things cumbersome and distracting, especially in a live event environment like I work in.

this rocks! VSE is getting better and better!

@JTA, yes while your solution is great it is a shame that the tools from Jump to Cut couldnt just cross over. That is to use the marker keys In/out then a return action that autocompletes the start/end frame trim.

But thanks anyway, it really is a fun script.

@3pointEdit, I dont like the markers option as it is a little ugly, but i like the colored strip idea, so i will think about make something with this… and with movieclips

anyway, what you say about crossover tools is totally possible. If you have an addon installed you can call any of the operators in it from other scripts.

but better is to share functions, thats why turi and i merged the scripts. I have planned to merge also jumptocut, and @sunboy this is a great candidate to be merged, if you want.

I have no say at all, but a simple suite of tools would be great. Even better would be integration of tools like the “mark selected” tool in Jump to Cut, so it is available with out lots of scrolling.

I confirm that the script works again with r51267! :slight_smile:

I also find the idea of combining multiple scripts very appealing.
For example, it was tempting to use Carlo’s Jump 2 Cut addon for marking in and out points but the script ignored the markers.

@carlos Yes, please feel free to include the script :slight_smile:

Hey Sunboy, I was just wondering if this tool could also alter the project settings based on first clip imported. This would address the Blender issue of conforming the media to the project. Where frame rate is ignored and dimensions are stretched.

Could the fist clip/strip be selected and interogated to get:

  1. frame rate
  2. dimensions

Then apply that to the master scene before first edit? This would mean an end to weird duration mismatches that noobs often have trouble with. It would also improve performance as no scaling would have to happen during edit. And you wouldn’t have to load the clip up in another app. to find those details first.

This would assume that the first loaded strip provides the global settings for subsequent media (many editing apps do it this way). I am not sure if Blender stores frame rate as a media value but you could check duration of sound to vision and determine difference.

What do you think?

Hey,
The problem with this is that, as far as I can see, blender does not provide the original dimensions and framerate of a strip as accessible properties to the python api. So it looks like such an operator had to execute ffmpeg separately and read out the framerate and dimensions of the given file. Could get complicated.
And if this will be achived, I would prefer to make a separate one-button script which takes the properties of a selected clip and fits the project settings to it, because most people will like to have a simple dedicated button for that. Unfortunately it is not (meaning I don’t see a way :wink: ) to change the project settings by the first clip that is imported on any way.

BTW, here is the next version of the script:
Tidied up the GUI a bit and added an option to automatically zoom to selection when entering the edit range mode.

Attachments

SequencerIOP_0_3.zip (3.55 KB)

I know what you mean. I just wondered if you could bring in a strip with audio into your project that is for example 60fps.
Determine the project Frames per Second = 60fps
Determine the length of the audio strip in frames (duration) eg: length = 200 frames
Determine the length of the video strip in frames (duration) eg: length = 100 frames

Length Audio / length video = 2
project fps / 2 = source media frame rate 30fps

60/(200/100)

All are variables and some place errors may occur (like 29.75 fps) depending on the number of frames involved, but frame rates tend to come in predetermined values so we could round them to the nearest logical frame rate.

I wondred if you could run that just once in a scene by itself (then discard) to alter project fps with a button click as you say.

Just a thought, but does video clips in texture slot have dimensions exposed? I use that to determine frame length often. Perhaps you could load a alt version in a null slot and pull dimensions?

you can get the dimensions of a selected strip and assign them to the current scene. Look at bpy.ops.sequencer.rendersize() but this doesnt help with fps…

you can also have a look at the exif reader in the sequencer_extra_tools, it reads the metadata but you had to find the name of the metadata for each fileformat (it can be diferent, for a mov you can find quicktime:VideoFrameRate and for a mkv you will find matroska:VideoFrameRate

it is a hackish way but it can work also with videos not loaded into blender.

Hmm. Seems not easy to do this on an elegant way…

New version (first post):

  • Support for sound strips added.
  • New Button added, insert into editing scene: It will insert the strip you have selected in the current timeline into the editing timeline. Purpose is to use it with two windows: One with your timeline for editing, the other for editing the ranges of your material before inserting into main timeline. In that case you do not have to set your in and outpoints with the scene start and endframe but may easily cut the strip into pieces and insert those areas into the main timeline. So you can also work with multiple ranges for one file.

Attachments


Sunboy v 4.0 r o c k s!
I’ve been using it for a couple of days and have become addicted to it.
The only drawback is zooming in and out when switching between the trimming and main timeline scenes. Pressing home (or period .) upon switching resolves the issue.
Many thanx for coding this script which takes the sequencer on a whole new level of functionality.

Can’t wait to try but I’m stuck using Fcp at work just now. Thanks Sunboy. Does anyone know of python tutorials or tips for scripting in the vse?

FCP?! Gee, I thought you were on windoze.

Unrelated to the thread:
The addition of the vse-2-compositor addon and the trimming one (this thread) essentially turn the VSE into a great NLE as far as editing and compositing are concerned. So it’s getting there, steadily but slowly.

From what I can tell the area in which the vse is still seriously lacking atm is in media and asset management. Adding meta-data and other info per clip to facilitate cutting should be easily doable with Python. I’m in the process of learning python in my spare time so I plan to take this task up and see what I come up with. I don’t expect to start before the summer holiday though.

Secondly, we need to sort out media import issues, say converting sources to intermediate codecs for editing. I’m wondering if we can use the compositor to do this. Peter mentioned in one of the December irc meetings that he might consider recoding the sequencer so that it supports multiple cores and GPUs.

Finally, new need better (i.e. actual) audio editing functionality.

IMHO, any improvements in these areas will take the sequencer up to the big league, NLE-wise.

*I edit on mixture of Win and Mac at work, Blend on Win for access to internet.

You are right it would be nice to see better use of media metadata generally. And improved sound handling would be great (even a simple level meter!).

If Peter wants to code something really usefull in, how about the ability to use proxies and original source on the same timeline? At the moment you can use one or the other. Which means that you can’t just promote one annoying strip to proxy, you must do all :frowning:

Also, EVERY nle on the market can treat audio and video (from the same source) as linked. It would be excellent if Blender would have a switchable facility for moving linked strips too. The new VSE scripts can allow various selection types but it is just additional button clicking that shouldn’t be necassary.

On topic, I love this script.