Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch process from multiple video files workflow (different cuts) #89

Open
4 of 6 tasks
VuDuCiel opened this issue Sep 10, 2018 · 50 comments
Open
4 of 6 tasks

Batch process from multiple video files workflow (different cuts) #89

VuDuCiel opened this issue Sep 10, 2018 · 50 comments

Comments

@VuDuCiel
Copy link

VuDuCiel commented Sep 10, 2018

What I have in mind is to be able to import many video files at once in order to batch-process them.

Dragging multiple files could open a panel with a select list to individually set the in/out points of every shot and have a BATCH-CUT button to export the files. Shots with no set new in or out points would be ignored. With keyboard shortcuts like ARROW UP and ARROW DOWN to navigate the list, it would allow me to go through a batch of files SO FAST!!!!!! An editor's dream come true!!!!

losslessmultifiles

Edit by @mifi:

Features:

For being able to run the exact same cut or operation on multiple files, see this separate issue #868

@mifi
Copy link
Owner

mifi commented Sep 12, 2018

Hi. I can see it would be nice to be able to drag multiple files (or a directory) and have the files appear on the left side as you pictured here, but why is it necessary to be able to batch cut? why can't you do one file at a time, then cut, then next file?

@kaikaiiiiiii
Copy link

Hi. I can see it would be nice to be able to drag multiple files (or a directory) and have the files appear on the left side as you pictured here, but why is it necessary to be able to batch cut? why can't you do one file at a time, then cut, then next file?

Maybe the series have same openings / endings.

@1pp1k10k4m1
Copy link

I don't know if this is the correct way to go about this, but I would love to see this feature as well and for the same reason (opening/endings the same). Thank you for such a great piece of software!

@VuDuCiel
Copy link
Author

Sorry for the misunderstanding, my request involved setting different IN/OUT points for each loaded clip, and then having one batch-cut process all the files while I go have a warm coffee!

But since some people have requested the other way around, you could have the added option of setting the exact same IN/OUT point for every loaded clip. Or even maybe the option to have both varying or static IN, and OUT points, or simple "Apply IN point to ALL" and "Apply OUT point to ALL" buttons so it fits every needs!

@mhavo
Copy link

mhavo commented Jun 3, 2020

This would be a must. Imagine that you can harvest your folders and then keep on trimming. Just using shortcuts on the keyboard - like Lightroom with pictures. Even better would be an option to overwrite the original file. Flying through files leaving behind much more space on disk and just the needed parts of the videos.

@spike229
Copy link

spike229 commented Jun 8, 2020

this is exactly the functionality I was hoping to find in this software:
grab a folder full of 100 files, load them into this app, set a single cut point, batch cut that much off the front of each of the files. hopefully leaving behind just the corrected files and deleting the originals.

@Rubens10010
Copy link

Rubens10010 commented Feb 25, 2021

Hi, I also need this exact feature. This would be very helpfull as my main use case for this software is processing about 100 videos per day extracting interesting parts and then delete the original. I think the left side panel would be the right place. I think this could be a list, first video is loaded on drag, then if user wants to delete this file, first delete from list and then from storage, if list have any items left auto play next. This would be a list since user can choose to play any file on it at any time. Another use case would be to select multiple files from list and merge.

@Droyk
Copy link

Droyk commented Jul 22, 2021

@mifi any progress on this one?

@mifi
Copy link
Owner

mifi commented Jul 23, 2021

Not yet unfortunately, have been focusing on other issues like customizable keyboard shortcuts (not yet done), and been quite busy with other projects lately. Hopefully will get some time soon!

@Knud3
Copy link

Knud3 commented Aug 2, 2021

Maybe like:

  1. User select/drop multiple files to LLC ("Merge/concatenate files" popup would have the option to process multiple files).
  2. New panel would open and has all the files listed.
  3. Selecting segments works like everything works now. Users just select file from the list and then select clip segments and continue to select files so far that all files segments are selected.
  4. "Export" button now has changed to the "Export All" button and it process all listed file segments.

Nice and easy :) Really a life saving with hundreds/thousands of video clips.

@mitchcurtis
Copy link

+1 for this. I often have a bunch of 1 minute long clips where I want to cut a short (~10 second) segment out, where the start and end position of that segment vary between clips. Having a way to do them all at once, and especially being able to name the exported videos (I don't think that part has been mentioned so far), would be awesome.

I thought about trying to have a go at this myself but it seems like a huge task for someone unfamiliar with the codebase (and frameworks).

mifi added a commit that referenced this issue Aug 28, 2021
@mifi
Copy link
Owner

mifi commented Aug 28, 2021

Basic batching is implemented! No mass export but a possibility to load a list.

Screenshot 2021-08-28 at 21 44 11

Screenshot 2021-08-28 at 21 43 54

  • SHIFT + : Previous file
  • SHIFT + : Next file

@Rubens10010
Copy link

Hi @mifi. Thanks for this new feature. I've tested it and find out two things. You should be able to remove items from list and also items should disappear by default when you trash them.

@mitchcurtis
Copy link

Thanks for adding it @mifi! Should we open more specific feature requests for the other things we would like to see as part of this feature (deleting the original files, renaming, etc)?

@mifi
Copy link
Owner

mifi commented Aug 29, 2021

Thanks for adding it @mifi! Should we open more specific feature requests for the other things we would like to see as part of this feature (deleting the original files, renaming, etc)?

I'll put the remaining features the first post. I'm not sure how the "rename" feature would work though

@mitchcurtis
Copy link

mitchcurtis commented Aug 29, 2021

Thanks for adding it @mifi! Should we open more specific feature requests for the other things we would like to see as part of this feature (deleting the original files, renaming, etc)?

I'll put the remaining features the first post. I'm not sure how the "rename" feature would work though

Currently my workflow is:

  1. Load a video
  2. Trim it
  3. Export
  4. Rename in file explorer

It would be awesome if it could instead be:

  1. Load a video
  2. Trim it
  3. Rename it
  4. Export

That would also make it easier to see which videos I've already edited (and then delete the originals), as the names of my videos are generated, and (after LosslessCut appends the trimmed timestamp to them) can get so long that their text is elided.

So basically each item in the list you added would be able to be renamed, and that name would be what the export is saved as.

@mifi
Copy link
Owner

mifi commented Aug 29, 2021

Can’t you achieve custom naming with the output naming in the export dialog?

@mitchcurtis
Copy link

Can’t you achieve custom naming with the output naming in the export dialog?

I don't get a dialog when I click export; it just does the export and then shows the notification about cut accuracy.

@Sascha353
Copy link

Hey Mikael, I also would like to see some sort of "batch cut" where I can cut several files at once but with the same cut points. That's useful if you have files with the same intro/outro or shadow play recordings where the action is always happening at a pre-defined time and therefore can be cut identically. If you have hundreds of files/recordings that would be a huge time saver. Maybe with an option like "use cut points for the whole queue" or something. It could be also achieved via CLI. Cycle through a folder via batch/power shell with cut point parameters or maybe an exported cut config.

@mifi
Copy link
Owner

mifi commented Sep 23, 2021

I see more and more people asking to be able to run the exact same cut on multiple files. So I created a separate issue for that #868

Let's keep this issue (#89) for the batch list which is currently partly implemented, and the new issue #868 for same-cut batching.

@mifi mifi changed the title [REQUEST] Batch process from multiple video files [REQUEST] Batch process from multiple video files workflow (different cuts) Sep 23, 2021
@mifi mifi changed the title [REQUEST] Batch process from multiple video files workflow (different cuts) Batch process from multiple video files workflow (different cuts) Sep 23, 2021
@vancrize
Copy link

vancrize commented Nov 9, 2021

Totally +1. I am currently cutting folders with 20+ Files over 100GB total. I cut them all one by one and now i have to go to each batch object and export. Would be a pleasure to click export and go to sleep to find all my cuts from batch items in place tomorrow.

@mifi
Copy link
Owner

mifi commented Feb 25, 2022

Ok I have now fixed so that when a file is removed from the batch list, the next item in the list will be selected

@jtagcat
Copy link

jtagcat commented Apr 7, 2022

Implement a toggle for 'process in background'. I edit most of my stuff on an 11-year-old laptop, 2 cuts running can lead to a choppy desktop.

200 4h clips, each need a proxy.

  1. Import them all, wait for the proxies to finish.
    • or not: no toggle needed, just show a progress bar
      • The progress bar should stay visible at 100%, as the user might've gone afk, or done other things.
      • User interaction to dismiss 100% isn't valid, as it might be accidental (alt-tab or multi-monitor or ...). There is enough room at the top of the batch sidebar.
      • It might be nice to unpin it (as the 1st item in scrollable list) after it's done <100%
  2. Edit them all in one go, queuing the cuts, then at the end, cut1 them all.
    • or if wanted, cut the files in the background, limiting resource usage to say 80%

Gonna leave this here.

GitHub Etiquette

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Footnotes

  1. I mean render, but it's not really rendering, it's encoding, but not really.

@jleiss
Copy link

jleiss commented Jun 7, 2022

+1 for Mass exporting for batch, that would save time instead of having to wait for 1 to export before proceeding. I could make all my changes and when done do a mass export and go off and spend time with my daughter and come back later to do more with the files.

@RoyceRemix
Copy link

+1 for export button to process full batch list - It's essentially what would make it batch, currently it functions the same as one-by-one loading and exporting. It's the only thing this awesome tool is missing for me! <3

@Rubens10010
Copy link

Ok I have now fixed so that when a file is removed from the batch list, the next item in the list will be selected

It's been a long time but I wanted to point out that the next item should auto-play whenever I remove the current item.

@ChicagoScanningMG
Copy link

Ok I have now fixed so that when a file is removed from the batch list, the next item in the list will be selected

It's been a long time but I wanted to point out that the next item should auto-play whenever I remove the current item.

I'm gonna have to disagree with that. I really would not want videos to auto play. I'm also primarily quickly scrubbing through the video and trimming the end. I don't need to have videos auto play. A toggle for this option wouldn't be unhelpful, but it definitely should NOT auto play by default.

@jtagcat
Copy link

jtagcat commented Aug 23, 2022

I stand for no autoplay. I wouldn't even make it an option (clutters up options and maintenance). In addition, it helps retain control of your position. The feeling of knowing exactly where you are and what you are doing, staying in flow. Being able to execute 5 keyboard shortcuts with confidence.1

From the user side, pressing space or automating removing and pressing space in one action is easy (on Windows see AHK or Power Automate).

Footnotes

  1. Ok, this is all true, but I can agree it sounds too much like selling a pen to you. Buy my pen! It empowers you in writing astonishing letters without any friction. Stand out in meetings with it's fabulous design. Stop blunders before they happen with our patent-pending quick-dry ink!

@ChicagoScanningMG
Copy link

In addition, it helps retain control of your position. The feeling of knowing exactly where you are and what you are doing, staying in flow. Being able to execute 5 keyboard shortcuts with confidence.1(#user-content-fnref-1-928dd1b0f055a1cf5640ef607ef8e1ee)

For what it's worth, if you hit play and then click through the clip, it will continue playing. I do absolutely love that and want that feature to remain. I believe this is how most video players work anyway. I just don't want videos to autoplay on load. I'm not using this as a video player, I'm using it to trim/cut/merge videos.

@noyse27
Copy link

noyse27 commented Oct 5, 2022

I'm not sure if it's possible now to edit a bunch of videos in the batch list and then export them all at once.... I have about 40 videos edited in the batch list and was a little disappointed to find that I have to export one video at a time.

@ChicagoScanningMG
Copy link

ChicagoScanningMG commented Oct 11, 2022 via email

@LeChatNoir666
Copy link

LeChatNoir666 commented Mar 9, 2023

Oh my...
I wish I would have read this before...
I've edited a bunch of Videos, clicked on Export and was wondering, why only one Video was exported...
I thought, I made a mistake ans so I started to investigate about it and found here, that "Mass Exporting" is not implemented.
For me, as it have Batch import, I was thinking, it have Batch export too.

A one time warning for first time user would be nice, if someone do Batch import the first time like:
"At the moment you can only batch import and not export so be warned, that exporting many files will take time as you need to export every Video on its own." :)

I was lucky that many of the Videos I've edited have had the same Time Markers so I took the "Last ffmpeg command" and made a batch file on my own with "foreach" aso...

Anyway it's a great tool and lightning fast!!!
Many thanks for this awesome tool!!!

Apropos Batch:
Is there a Keyboard Shortcut to remove a Video from the list?
I can't find it in the Shortcut listing...
As I'm an keyboard enthusiast it's breaking my workflow to use the right mouse button on the Video to remove it... :)

@mifi
Copy link
Owner

mifi commented Mar 10, 2023

Thanks, I'll add it to the readme/features.

Is there a Keyboard Shortcut to remove a Video from the list?

No, but if you select "close currently opened file" (settings) or keyboard shortcut "D" will close the current file and remove it from batch.

@LeChatNoir666
Copy link

LeChatNoir666 commented Mar 10, 2023

Thank you for your comment. :)
I've read about this "D" Key but as it says:
"Delete source file" I was unsure if it will delete the File from my Harddisk.
Maybe it's my understanding of "deleting and removing" because English is not my native language. :)

Oh and...
Why can I seek with keyframes forward (ALT+Right Arrow Key) if a Video is playing but not backwards?

EDIT:
If someone knows an Autohotkey or AutoIt Script for "Batch exporting" in LosslessCut please leave a note! :)

@mifi
Copy link
Owner

mifi commented Mar 10, 2023

Why can I seek with keyframes forward (ALT+Right Arrow Key) if a Video is playing but not backwards?

I think because the player will move the playhead ahead of the keyframe, then if you press alt+left it will go to the previous keyframe. then you're not able to press it fast enough so it will keep going to the same keyframe

@Mehedi998877
Copy link

Hi. I can see it would be nice to be able to drag multiple files (or a directory) and have the files appear on the left side as you pictured here, but why is it necessary to be able to batch cut? why can't you do one file at a time, then cut, then next file?

did you completed this project or continuing ?

@vancrize
Copy link

vancrize commented Aug 7, 2023

Is there any information if this feature is still planned? I joined the thread almost 2 years ago and had much hope it could be implemented in a foreseeable future. LLC has so far the fastest workflow for my use case of dropping in 30-100 files, cutting highlights to a merged file and go to the next file.

With a simple "cut/merge/export all changed files from the batch list" i could sit down once a week, do my videos and export them over a night or two instead of waiting for each cut before i can process the next file on a daily basis.

Would love to know if it will be implemented someday or if i have to look out for a new toolset. I would consider paying you for this as i dont know of any (even premium) tool that allow this in the so far perfect fashion LLC does.

@mifi
Copy link
Owner

mifi commented Aug 17, 2023

I have tried a few times to implement it, only to realize it's a really big undertaking to implement it properly. This is because LosslessCut was never designed to run batch operations in the first place. From the time a file is opened, until it is exported, a lot of things happen, many of which require user interaction:

  • A lot of pre-file checks are run, and possible dialogs pop up needing user-interaction (e.g. import timecode, import chapters?)
  • project file is loaded
  • Something might go wrong due to the operating system blocking access to a file (e.g. windows often like to "lock" files out of the blue, maybe anti-virus kicked in)
  • sometimes a dialog is opened if the user needs to allow LosslessCut access to reading/writing to the input file path or output path
  • Video file is converted to supported format if needed
  • UI state gets loaded

Now UI state has loaded and it will take a while for everything to settle:

  • Video is loaded into <video> tag, and we need to wait for the file to finish loading/start playing to see if there's any problems
  • User configured settings are loaded into the UI state (e.g. whether to always use a particular output format, cut/export settings etc)
  • User clicks "export"
  • Export confirmation dialog may or may not show (depending on user settings)
  • User adjust export settings and clicks "export" again
  • Now the actual export operation starts, and it will produce output files
  • Once done, depending on user settings, as well as UI state, the resulting files will have to be merged
  • Ok, we're done with one file 😅

So is it possible? Yes. But it's a huge rewrite to make all this code run in a sequential manner.

Alternatively it might be possible to implement as a "quick hack", where we simulate the button presses or actions needed for each of these steps. One major drawback is that we might be clicking the required button too early or too late, and there might be some dialog box or error message blocking the next action, causing the batch operation to get stuck.

I think it will be implemented eventually, because it's the number 3 most requested feature, but I need to set aside a lot of time to do the rewrite, in order to not break anything (and still allow the current non-batch workflow to also work correctly).

@vancrize
Copy link

Thank you for the bigger insight. Sounds like i imagined the stuff behind the scenes right.

I can only speak for my workflow and it would even help if some kind of automation happens depending on events.

At the moment i have bound some of my plenty mouse buttons with the following functions and can handle my complete batch list just with 5 Buttons and the wheel. If i had any form of hooks or event detection i could even automate it myself after the cutting.

Most of the time its "load first file from batch -> set input output markers -> merge-export -> cleanup -> load first file from batch > set input output markers ->repeat".

So basically what my dream workflow would be to set the input output markers on each file and then the auto-export cycles again, exporting each and hopping to the next file (without cleanup to prevent possible "EBUSY" errors).

I automated it a while ago in a way with auto key presses, assuming the longest export time i can experience, but thats very inefficient as 100 files each "exporting" 10 minutes even if some would finish in 30 seconds and other shenanigans like some window stealing focus for whatever reason.

A batch feature i imagine demands from the user to be aware that everything will be exported with the settings he provided and every file in the edit exports as he left it in the batch list.

But im happy to hear its on your mind. Keep up the very good work!

@yur1xpp
Copy link

yur1xpp commented Oct 11, 2023

@mifi Do you think it's possible to automate these actions by CLI. Albeit, it's still one-by-one process, but I'll still takes that than requiring user input (clicking) throughout the process. The idea is that since one could already load a project file using cli, additional parameter like --export --autoclose (just an example) effectively making batch exporting interaction-less process. One could create a script to loop through all the project files, for example pseudocode:

for project.llc in my/many/subfolder/projects
    Lossless-Cut-win.exe project.llc --export --autoclose
done

This will export all segments same as the source project folder.

--export indicates user want the export process to start automatically
--autoclose indicates user want the Lossless-Cut-win.exe to auto exit once export done. This is so that the loop will proceed with next project instead of waiting the process to exit.

@mifi
Copy link
Owner

mifi commented Oct 15, 2023

part of the problem is that it's very hard to implement open, export and autoclose due to lack of coordination as described above (we don't know when the opened file is ready to export).

I've added a way to control llc using keyboard shortcut actions from the command line, e.g. call keyboard shortcuts like export and quit, however the user would have to implement these api calls with a generous delay between sending the events, which would effectively make the batch operation very slow.

see example here: https:/mifi/lossless-cut/blob/master/cli.md#batch-example

@mifi
Copy link
Owner

mifi commented Oct 15, 2023

have also added a new HTTP API that will allow waiting for certain actions to complete

@mifi mifi mentioned this issue Jan 13, 2024
4 tasks
@mklaber
Copy link
Contributor

mklaber commented Apr 13, 2024

Thoughts on adding an Export & Next button to the export dialog when in "batch mode?"

I've just had a play in batch mode and found this workflow quite handy (after going through and making different cuts to the dozen or so files I opened):

  1. E (disabling the export dialog made this even quicker)
  2. SHIFT +
  3. SHIFT +
  4. ...repeat...

(update: I see the latest version has batchOpenNextFile which at least combines 2 & 3)

So the improvement would be the export dialog having an Export & Next which does the same thing as Export but then advances to the next item in the batch list.

Or, perhaps better: a keyboard binding like SHIFT + E which does step 1, 2, & 3 without displaying the dialog?

@mifi would this be practical? Or does the challenges described in #89 (comment) apply here, too? (is it too hard to know when the export is finished, for example) If you think it's practical and are supportive of either approach (preferably the keyboard binding one), I'm happy to work on a PR.

@mifi
Copy link
Owner

mifi commented Apr 21, 2024

I guess it's possible but in the meantime there's a new shortcut (not relased afaik but nightly) for "Open next file"
so you can reduce your workflow to:

  1. E
  2. CTRL + SHIFT +
  3. ...repeat...
Screenshot 2024-04-21 at 19 48 07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests