MediaArea / RAWcooked

Encodes RAW audio-visual data into the Matroska container (MKV), using the video codec FFV1 for the image and audio codec FLAC for the sound.
https://mediaarea.net/RAWcooked
BSD 2-Clause "Simplified" License
43 stars 11 forks source link

Decoding: No message/warning when target files already exist #122

Open pjotrek-b opened 6 years ago

pjotrek-b commented 6 years ago

When running RAWcooked decoding twice for the same MKV file, it just overwrites the already existing target DPXs.

Would it be possible to give a classic "already exists, overwrite Y/N?" option?

retokromer commented 6 years ago

What is the status of this one?

JeromeMartinez commented 6 years ago

Not yet implemented

JeromeMartinez commented 5 years ago

@pjotrek-b please test latest snapshot and let me know if something looks weird.

Note that it a file exists, I check that it is not same before asking the user if the file should be overwritten, so there will be no user interaction and no file modification (even no modification timestamp change in the file system, only last access timestamp change if supported by the file system) if files exist and are same.

pjotrek-b commented 5 years ago

Just returned from a workshop (where I also presented RAWcooked :smile:) @JeromeMartinez Will test as soon as possible and report here.

pjotrek-b commented 5 years ago

Updated to latest snapshot (18.10.1.20190323).

There's no error message when nothing was changed, but there is a check if a file was changed. As you described.

Yet, I don't understand why this extra check is necessary? Why not just a "if target_file exists: ask()"?

pjotrek-b commented 5 years ago

Now I still can accidentially unpack the same MKV file to exactly the same destination - and it will do the whole unpacking process (which is CPU intensive) again. Without asking, and without any reason (because nothing has changed)...

That's the most likely case that nothing was changed, I guess.

Like this (just tried it):

pb@pb-combat:~/Videos/dpx$ rawcooked pb_test1.mkv 
Using default license.
Consider to support RAWcooked: https://MediaArea.net/RAWcooked

58 MiB/s, 0.24x realtime                              

Files are in pb_test1.mkv.RAWcooked/.
pb@pb-combat:~/Videos/dpx$ rawcooked pb_test1.mkv 
Using default license.
Consider to support RAWcooked: https://MediaArea.net/RAWcooked

61 MiB/s, 0.25x realtime

I don't get it.

JeromeMartinez commented 5 years ago

Why not just a "if target_file exists: ask()"?

Why should I ask for the right to overwrite a file if I don't need to overwrite a file? ;-) I prefer to ask only if it is useful i.e. "if file on disk is not same as decoded new file". Since the check feature, it is not necessary to overwrite a file if it is same as the one expected to be written, so the answer to the question is useless in that case.

Do you mean you would prefer to "force" overwriting even if file are same, i.e. without checking the file? why? I personally prefer to avoid writes if not necessary (no change in file timestamps, backup tools appreciate and read is with some HW faster than write).

Without asking, and without any reason (because nothing has changed)...

The reason is that I need to decode the file if I want to compare the packed file to the file on disk. I can not compare without decoding FFV1 to DPX.

pjotrek-b commented 5 years ago

Now I get it! :smile: I was assuming a slightly different behavior/starting situation...

Generally, there are different kinds of "target already exists":

  1. Target folder: filename.mkv.RAWcooked
  2. Attachments (=non DPX/WAV): They don't need decoding.
  3. A/V content (DPX / WAV): They do need decoding.

Am I right?

If so, then I think the most awesome behavior could be:

  1. If target folder exists: Ask (I expect this to cover 99% of all accidental re-extractions)
  2. Attachment exists: Ask
  3. A/V content exists: The behavior you already have right now.

How's that sound?

JeromeMartinez commented 5 years ago
  1. Target folder: filename.mkv.RAWcooked
  2. Attachments (=non DPX/WAV): They don't need decoding.
  3. A/V content (DPX / WAV): They do need decoding.

Am I right?

Right now I handle 2. and 3. I create the dir if it does not exist.

  1. Attachment exists: Ask
    1. A/V content exists: The behavior you already have right now.
  1. is same as 3., no difference.
  1. If target folder exists: Ask (I expect this to cover 99% of all accidental re-extractions)

I could add a test on the output dir existence and ask before doing any decoding.

retokromer commented 5 years ago

I could add a test on the output dir existence and ask before doing any decoding.

+1

pjotrek-b commented 5 years ago

Checking output dir existence: +1