When creating videos in Blender VSE, it’s often necessary to separately create a silent video sequence and only then overlay separately prepared audio tracks onto the edited video stream. However, when adding a video strip to VSE, it is added along with its audio track, with the audio also connected to the video. Separating the audio and video tracks is not difficult, but it takes time. Let’s write a small script that will automatically detach the audio from the video in a strip added to VSE and completely delete the original audio track.
First, we need to save a list of existing strips in VSE so we don’t have to reprocess them each time we add a new strip.
Save a list of existing strip names and add it to the WindowManager object for future access.
|
1 2 |
bpy.context.window_manager['existed_strips'] = [_strip.name for _strip \ in bpy.context.scene.sequence_editor.strips[:]] |
Define a function in which we’ll perform all operations for disconnecting tracks and deleting audio.
|
1 |
def auto_remove_audio_from_strip(scene, depsgraph): |
This function will be called every time we add a new strip to the VSE.
Here, we first need to identify the added strips. This is very simple – they will always be selected. Get a list of the names of the selected strips.
|
1 |
selected_strips = [_strip.name for _strip in bpy.context.scene.sequence_editor.strips if _strip.select] |
We’ll need to perform several actions. Therefore, let’s create a flag variable that determines whether we should process the selected strips or not.
|
1 2 3 4 5 |
process = False for _strip in selected_strips: if _strip not in bpy.context.window_manager['existed_strips']: # need to process process = True |
Initially, the flag is set to False, meaning we don’t process anything. Then, we search for the names of the selected strips in the previously saved list of all existing strips. If the name of the selected strip isn’t in the list, we set the flag to True, meaning the selected strips are new and we need to process them.
So, if we need to process the selected strips:
|
1 |
if process: |
First, remove audio tracks.
|
1 2 3 4 |
for _strip in selected_strips: strip_ptr = bpy.context.scene.sequence_editor.strips.get(_strip) if strip_ptr.type == 'SOUND': bpy.context.scene.sequence_editor.strips.remove(strip_ptr) |
Here, we access the strip by its name through a pointer, and if the current strip type is “SOUND,” we remove it.
Now that we’re left with only video tracks, let’s update the list of names of existing and processed strips so that we don’t have to reprocess the current ones in subsequent actions.
|
1 2 |
bpy.context.window_manager['existed_strips'] = [_strip.name for _strip \ in bpy.context.scene.sequence_editor.strips[:]] |
This completes our function. All that’s left is to ensure it’s called when we need it—when new strips are added.
The Blender Python API doesn’t have a specific handler called when strips are added to the VSE. However, we can catch any scene change events, including strip additions, using the general “depsgraph_update_post handler”.
Register a call of our function through it.
|
1 2 |
if auto_remove_audio_from_strip not in bpy.app.handlers.depsgraph_update_post: bpy.app.handlers.depsgraph_update_post.append(auto_remove_audio_from_strip) |
Now we can run the code.
When it runs, the function we wrote will be called every time the scene changes. Inside the function, we determine whether the scene change was caused by adding new strips. If so, we process the strips added to the VSE by removing their audio tracks.

.blend file on Patreon