Skip to content

Conversation

Carbaz
Copy link

@Carbaz Carbaz commented Jun 16, 2025

The widely reported "permissions" issues with "play" while using ffmplay player under windows is directly related to how NamedTemporaryFile creates and deletes the temporal file, not allowing it to be accessed from a subprocess, which is what _play_with_ffplay function does in the end.

Also, the widely suggested workaround is to modify locally the "pydub" library to set the NamedTemporaryFile call delete parameter to False.
( No one should like to modify dependencies locally 😠 )

To avoid the need to modify the library code locally best approach is allow users to set this "delete" behavior on call.

As setting it to False will lead to non deleted temporal files left over it's interesting to let the user also choose the temporal folder to store them so he can deal with leftover temporal files later or whatever.

Finally I documented the new two parameters specifying the will work only while using ffmpeg library.

Carbaz added 2 commits June 16, 2025 19:47
The widely reported issues with "play" using 'ffmplay' under windows is related to how NamedTemporaryFile creates and deletes the temporal file not allowing it to be accessed from a subprocess, which is what '_play_with_ffplay' function does in the end.

Also, the widely suggested workaround is to modify in site the "pydub" library to set the delete to 'False'.

To avoid the need to modify the library code best approach is allow users to set the "delete" behavior on call.

As setting it to False will lead to non deleted temporal files left over it's interesting to let the user choose the temporal folder to store them so he can deal with leftover temporal files later.
Following the contributions rules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant