Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Non-existent paths passed to ffmpeg/ffprobe/etc due to encodeFilename on Windows python2 #4787
Comments
|
Hello, I have run into a similar problem when trying to use the merge feature to download 60 fps DASH videos from YouTube. It seems to effect video names with non-latin characters in them. I noticed the line I have included the original title from YouTube for each video before the block as reference. Notably in the first it can be seen that "Kαzυσ" is converted to "Kz" which causes it to fail to find the intermediate files.
|
|
Hi, @dstftw I still have the same issue on WIndows using youtube-dl.exe (version '2015.04.17'). |
|
Maybe we could change your solution to keep all the characters by keeping the original filename (with all the characters) in a variable and write the file to disk using the encoded filename. Then you could directly pass the encoded filename to the subprocess for the ffmpeg and after post processing the file you could rename it using the os.rename(encoded filename, original filename) Basic Logic original_fname = 'τεστ-test'
encoded_fname = encodeFilename(original_fname, True) # Use this filename to write to disk & for the ffmpeg subprocess.
# Rename both video & audio file after PostProcess
os.rename(encoded_fname + video_extension, original_fname + video_extension)
os.rename(encoded_fname + audio_extension, original_fname + audio_extension) |
|
This is the solution _#_2 I suggested in the first post, but I remember @phihag was not so happy about it. |
|
In any case, open a new issue with full verbose output. |
|
Sorry it was my mistake i was using my own custom py2exe build and i probably had some changes in the code. |
|
Well, I also think _#_2 is more reasonable (apart from _#_3) than current tempfix. At least it will allow to workaround subprocess-related encoding mess on python2 under windows and besides will keep the original filenames. So let's open a new issue to discuss. |
b0e87c3 did not fix the conceptual problem. When filepath is encoded with
encodeFilename(path, True)on python 2 @ Windows it may end up with non existent path (e.g.Trentemøller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.m4abecomesTrentemoller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.m4a,øbecomeso). And this non-existent path is passed to ffmpeg/ffprobe/whatever.Possible workarounds are:
encodeFilename(path, True)before writing to disk.subprocess.pyfrom cpython 3 or so).