Momentarily unable to write to MOV and MP4 Files

Started by Tveloso, October 17, 2023, 04:18:06 AM

Previous topic - Next topic

Tveloso

It's been some time since I tried a write-back with a video file, and don't think I had done it yet in IMatch 2023 until today, but it failed consistently for the file I was trying to write.

After the initial failure, I spot-checked a few other files, and in all cases, IMatch/ExifTool reported that the file was  not writable, and the ExifTool Output Panel contained only the following for each attempt:
-execute9999

Writable file extensions:
  360 3G2 3GP 3GP2 3GPP AAX AI AIT APNG ARQ ARW AVIF CIFF CR2 CR3 CRM CRW CS1
  DCP DNG DR4 DVB EPS EPS2 EPS3 EPSF ERF EXIF EXV F4A F4B F4P F4V FFF FLIF GIF
  GLV GPR HDP HEIC HEIF HIF ICC ICM IIQ IND INDD INDT INSP J2K JNG JP2 JPE JPEG
  JPF JPG JPM JPS JPX JXL JXR LRV M4A M4B M4P M4V MEF MIE MNG MOS MOV MP4 MPO
  MQV MRW NEF NKSC NRW ORF ORI PBM PDF PEF PGM PNG PPM PS PS2 PS3 PSB PSD PSDT
  QT RAF RAW RDF RW2 RWL SR2 SRW THM TIF TIFF VRD WDP WEBP X3F XMP

----- Runtime: 0.8 s.
...(so no references to .args files, or to any explicit XMP Tags).

When I tried updating one of the Files using ExifTool at the command line it worked ok:
C:\Progra~1\photools.com\imatch6\exiftool -Comment="Just Testing"  D:\Home\Tveloso\PhotoHold\WorkDir\Videos\IMG_5018.MOV
    1 image files updated
I returned to IMatch to get a ScreenShot of the error dialog given following the failed write operation, but now the Write was successful in IMatch as well (using a different file from the one I had written in ExifTool, but one of those that had originally failed in IMatch).

IMatch had been sitting idle for a long period of time, before I returned to perform that initial write (which failed), so perhaps that had something to do with it?

IMatch sat idle for another little while, as I wrote this post (not nearly as long as it had before), and an attempt to write back another file also failed - so I got my ScreenShot:

    Screenshot 2023-10-16 220817.png

So this appears to be an intermittent issue.  I'll send a Debug Log to the Support email address in case this might be a bug that can be identified there.
--Tony

mopperle

Tony, and what do you see, when you click on ,,See details"?

Mario

#2
Keep the ExifTool output panel open (View menu > Panels) when you write back.

If it fails again, copy the text from the panel into a text file and attach it. It will show us what data IMatch was writing and which problem ExifTool encountered while writing the file.

This gives us a minimum of information to work with and is much easier than sieving though a large log file.
And it keeps all the info about the problem in one place. Splitting things between community posts and emails is always a bit of a hassle.

-- Update --

I have had a look at the log file.
I see a number of warnings from the IMatch Media Player, so I assume you've had the Quick View Panel open and used it to watch videos? Were any problems reported? What did you do, exactly? The warnings I see seem to indicate that there was some problem with the workflow in IMatch.

Then I see several warnings like

ETWARN: Writeback: File not writable: D:\Home\...n.mov

ETWARN: Writeback: File not writable: D:\Home\Tveloso\...020.MP4

Did you try to write-back to files which were currently open/playing in the Quick View Panel?
In that case, close the Quick View Panel and retry.
When a video is loaded in the Quick View Panel, it is "locked" and Windows will not allow other applications (or IMatch) to modify the file in that state.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Tveloso

Quote from: mopperle on October 17, 2023, 08:52:53 AMTony, and what do you see, when you click on ,,See details"?
Sorry, I should have opened the "See details" section before taking the ScreenShot.  It contained a message saying some thing like "see the Exiftool Output Panel for more details"

Quote from: Mario on October 17, 2023, 09:11:29 AMDid you try to write-back to files which were currently open/playing in the Quick View Panel?
In that case, close the Quick View Panel and retry.
When a video is loaded in the Quick View Panel, it is "locked" and Windows will not allow other applications (or IMatch) to modify the file in that state.
Ah, yes, I had previously watched the video that had the initial write-back failure (shortly before attempting the write-back).  But it was not playing at the time that I attempted any of the write-backs for it, and none of the other files that failed to write-back had been played (but the player in the QuickView Panel was open at the time). 

The file that was later successfully written, was also loaded in the QuickView Player (but not played then), although it was some time between when that file was focused, and when the write-back was attempted (which was now successful), so perhaps when the QuickView is open, files are locked for a period of time when they're first loaded to the Player (even if not played)?

Thank you Mario.  I'll remember to close the QuickView when writing back Videos.
--Tony

Mario

Quoteso perhaps when the QuickView is open, files are locked for a period of time when they're first loaded to the Player (even if not played)?
Maybe. Microsoft does not document details like that. The Media Framework in Windows is very powerful and super-complex, dealing with video rendering on the graphic card, asynchronous file transfer and read-ahead for media files and all that. If, and how long the Media Framework locks media files currently enqueued for rendering is undocumented.

When AutoPlay is off, the Media Player loads the media when you click on play. And it unloads it when you click on stop.
If the file on disk remains locked may depend on the size of the file, the memory available and many other factors the Media Framework in Windows considers. It is the same with images and WIC. Sometimes, rarely, a JPG file that is focused while the Quick View Panel is open and then written-back fails because WIC has the file still locked. Even after the Quick View Panel has already "closed" the file and opened another one in the background preloader.

If closing the Quick View Panel solves the problem and opening it again reproduces the problem, we have at least a hint of that the problem might be. I have never experienced this issue, but that does not mean much.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Tveloso

Thank you so much Mario.

I have seen some weirdness (mostly in Microsoft apps) that I think might be attributable to my graphics card/driver, so this might be why I'm seeing this issue on my PC.

It does seem that on my PC, the focused Video File, is locked while QuickView is open (so write-back fails for it).  This seems to happen consistently...(so I may have been mistaken when I had the successful write-back, that that file was still focused - it might not have been).

After a little more testing, the following seems to be true:

  • Clicking the Pen on the currently focused file, results in a failed write-back (even if that file has not been played in the QuickView Player)
  • Clicking the Pen on any other (not currently focused) file, gives a successful write-back
  • Write-back is successful for all files when the QuickView Panel is not open

Of course, for #2, the clicked file then becomes focused (and loaded into the QuickView), but perhaps the write-back gets started before the QuickView Player establishes the lock?

In any case, now that I know this is how it behaves, I can simply avoid the lock problem.

Thanks again.
--Tony

Mario

I have made some improvements for the next release. Hopefully they solve this issue.

The Quick View Panel is notified when the user starts to write back files and it also received notice for each written back file.
So far, when the file currently showing is written back, the Quick View Panel schedules a reload that is triggered once the file is reported as "write-back" complete.

For the Video Player, IMatch now completely unloads the media and "closes" the player.
And re-opens it again and reloads it once the file has been written.
I hope this is sufficient.
I could not really reproduce the problem. I've tried smaller and larger videos, smaller and larger batches etc.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Tveloso

Thank you so much Mario.

I'll report back when the next Release comes out.
__PRESENT
--Tony

Tveloso

After installing IMatch 2023.4, I was able to write back a video file with the Quick View Panel open.  Thank you Mario!
--Tony

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook