Sometimes get file rename error at end of download

Ralph Corderoy ralph at inputplus.co.uk
Sat Nov 25 05:31:47 PST 2017


Hi,

I missed the start of this thread, but jumping in midway...

> > > INFO: Command: "ffmpeg" "-loglevel" "fatal" "-stats" "-y" "-i"
...
> > > INFO: Command exit code 0 (raw code = 0)
> > > ERROR: Could not rename file:
> > > D:\Users\Nick\Videos\iplayer\Peaky_Blinders-s04e02-Heathens.partial.mp4
> > > ERROR: Destination file name:
> > > D:\Users\Nick\Videos\iplayer\Peaky_Blinders-s04e02-Heathens.mp4
> > > INFO: Skipping all versions of this programme

IIRC Windows doesn't allow a file to be rename if a process has it open.
I predict that ffmpeg is multiple threads/processes and the one
get_iplayer started, and sees exit successfully with `0', isn't the
"last man standing".  One or more of the other ffmpegs are still around,
with a handle on that partial file, causing the rename to fail.

I'd consider this an ffmpeg bug;  its main process should only exit when
it knows the others it has started have finished.  Meanwhile, you may
want to edit get_iplayer to add a `sleep 3.14;' between the ffmpeg exit
and the rename to make the race condition far less likely.  If that
works, let the list know.

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



More information about the get_iplayer mailing list