Giter VIP home page Giter VIP logo

Comments (13)

mifi avatar mifi commented on June 11, 2024

not exactly sure what you are doing to reproduce the issue and what's the problem. Basically when the checkbox is unchecked, losslesscut will not overwrite existing files with the same name. this was a feature request because some people want to not have to re-export already processed segments (speed improvement). Maybe you could try to explain using the actual file names that you are using?

from lossless-cut.

ChicagoScanningMG avatar ChicagoScanningMG commented on June 11, 2024

File 1:

  1. Open 1234_Michael_001.MKV in Lossless Cut
  2. Trim File
  3. Set to rewrap as MP4
  4. Click Export
  5. Set output file name to ${FILENAME}${EXT}
  6. Set Save location to Network Drive
  7. Export
  8. Files saves as 1234_Michael_001.MP4 on my network Drive.

File 2:

  1. Open 5555_Smith_001.MKV in Lossless Cut
  2. Trim File
  3. Set to rewrap as MP4
  4. Click export
  5. Set output file name to ${FILENAME}${EXT}
  6. Deselct Overwrite Existing file
  7. Set save Location to network Drive
  8. Export
  9. File does not save to my network drive and Lossless Cut reports some files may have been skipped since Overwrite was deselected. Expected outcome was file to save as 5555_Smith_001.MP4 on my network drive. This file is not made, there is no file on my network drive called 5555_Smith_001.MP4

So I'm recording video files in OBS and I have a script set up that once I stop recording the video, a dialog pop-ups which allows me to name the saved file, then once the file is renamed, it will open the video file in LosslessCut. I have LosslessCut configured to output the file to a network drive with the same name as the file provided. So if the file name is "1234_Michael_001.MKV" I have LosslessCut set to rewrap the file as MP4 and set the output name using ${FILENAME}${EXT} to my network drive as "1234_Michael_001.MP4"

Now, the problem is, let's say I'm recording a new video, it's supposed to be "5555_Smith_001" but I put in the wrong name and instead use "1234_Michael_001". If I have overwrite selected, my new file will overwrite the original "1234_Michael_001", which is bad. If I have overwrite deselected, the file doesn't output nor am I warned that there is a file name collision. I still want to output the file. Usually when I'm outputting files, I'll hit export and then tab back to OBS to start a new recording, so I won't see any warning messages until I'm opening up a new video to edit. (I know, I'm sure this is a unique use case.)

File name collisions I can understand, but what isn't working is if I have previously saved "1234_Michael_001.MP4" and I have overwrite deselcted, and I export this file using ${FILENAME}${EXT} to autoname the output file. Then I open a brand new file, "5555_Smith_001.MKV" and output using ${FILENAME}${EXT} (so the output file name should be "5555_Smith_001.MP4") it will not save the file and reports that some files may have been skipped because overwrite wasn't selected. It seems to think that although the file has a unique name that it matches another file on my network drive, which it doesn't.

Based on other user requests, and why the feature was added, I think you need to add an option for handling file name collisions "Skip Already Processed Files" or "Save All Files With Unique Names." That way when people forget to properly rename a file, it will still export and then I'm not wondering later why my file didn't save properly. But the issue I'm having is that even when I'm saving with unique file names, it's not outputting files if overwrite is deselected.

I hope that cleared things up.

from lossless-cut.

mifi avatar mifi commented on June 11, 2024

Thanks for detailing. Hmm, I think this is a bug then. Just to be sure: your input directory is the same as the output directory right? If there exists no file named 5555_Smith_001.MP4, but it says that it will export this file name, then I don't understand why it doesn't. I assume there is no warning in the export confirm dialog before exporting, and I assume that you're on the latest version? I tried to reproduce the problem but I cannot. for me it does create the file, and I don't understand why it doesn't for you.

Also I don't undertstand what's the difference between File 1 and file 2. It seems you are doing the exact same thing, except that for File 1 you have the "Overwrite" option selected? (even though you didn't explicitly say). In that case if you run the File1 scenario again with Overwrite deselected, you get the same result as file2 right?

from lossless-cut.

ChicagoScanningMG avatar ChicagoScanningMG commented on June 11, 2024

Very strange. Yeah, it's the latest version. My input directory is NOT the same as my output directory. Input directory is local on my machine, output directory is to a network drive.

File 1 is there to illustrate how I can get a successful export, and how I was doing things before the overwrite option was added. File 2, if done after exporting file 1, the file does not save and I am given those warning. It's there to illustrate that it's possible the bug has something to do with exporting a file using ${FILENAME}${EXT} back to back. It makes me wonder if your code that checks for file name collisions is somehow seeing that the previous file was exported using ${FILENAME}${EXT} and the next exported file is also using ${FILENAME}${EXT} rather than actually comparing the file names.

Just a thought. Either way, I'd still love to see more options (as listed in my previous comment) to handle file name collisions.

from lossless-cut.

mifi avatar mifi commented on June 11, 2024

Hmm, I'm still not sure I understand exactly. Did you have the overwrite option enabled or disabled while exporting File 1? before the overwrite option was added, all files would get overwritten (there were no checks in the code for existing files before trying to output).

from lossless-cut.

ChicagoScanningMG avatar ChicagoScanningMG commented on June 11, 2024

That's correct. File 1 has overwrite enabled.

I'm just saying if you want to try and reproduce my results, I exported a file with overwrite enabled, saving to a network drive, use automatic file naming by using variables ${FILENAME}${EXT}, and this export is successful. If then export another file with a unique name, disable overwriting, save to a network drive, use automatic file naming with the variables ${FILENAME}${EXT}, the file does not export even though there is not already a file in the destination folder that matches the input file.

This leads me to believe the code sees the selected variables as the previous and current file name, rather than the actual file name itself. I can successfully export with overwriting disabled if I don't use file name variables. It has something to do with the file name variables.

But either way, there should be an option to export all files with unique names OR skip existing files. That way, rather than not exporting any possible file name collisions, it will still export the file with an added suffix of "_01" or "Copy."

from lossless-cut.

mifi avatar mifi commented on June 11, 2024

so if you don't export File 1 first, then File 2 exports successfully? or are you saying that as long as you have the output file name set to ${FILENAME}${EXT} (and overwrite disabled), no files will be outputted, regardless of their name, even if it's the first file you export after opening losslesscut?

from lossless-cut.

ChicagoScanningMG avatar ChicagoScanningMG commented on June 11, 2024

It's the latter. I have not yet tested it with a fresh install nor on another machine. Even if I close LosslessCut and reopen, if the output file name is set to ${FILENAME}${EXT} (and overwrite disabled) no files will be output regardless of their name.

from lossless-cut.

mifi avatar mifi commented on June 11, 2024

ok, so to summarize, the bug that I need to try to reproduce is:

  1. set overwrite setting OFF
  2. open a file from a directory, e.g. /Users/me/Downloads/input.mp4
  3. filename template set to ${FILENAME}${EXT}
  4. choose a different working directory, e.g. /mount/somewhere
  5. confirm that there exists no file with the same name in working dir, e.g. /mount/somewhere/input.mp4 does not exist
  6. export and observe that nothing gets written to /mount/somewhere/input.mp4

from lossless-cut.

ChicagoScanningMG avatar ChicagoScanningMG commented on June 11, 2024

from lossless-cut.

mifi avatar mifi commented on June 11, 2024

I tried it now:

  • open losslesscut
  • only a single cut segment spanning the whole duration of the video
  • working dir set to /users/me/desktop
  • filename template ${FILENAME}${EXT}
  • export mode "separate files"
  • output container format unchanged
  • sanitize file names ON
  • set overwrite OFF
  • open /users/me/downloads/file1.mp4, export, successfully outputs /users/me/desktop/file1.mp4
  • open /users/me/downloads/file2.mp4, export, successfully outputs /users/me/desktop/file2.mp4

maybe this bug is windows-specific (im on macos)

from lossless-cut.

ChicagoScanningMG avatar ChicagoScanningMG commented on June 11, 2024

from lossless-cut.

Related Issues (20)

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.