3b1b / manim

Animation engine for explanatory math videos
MIT License
60.43k stars 5.71k forks source link

[concat @ <nums>] Impossible to Open "'DD:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00000.mp4'" #1051

Closed SuperMaZingCoder closed 4 years ago

SuperMaZingCoder commented 4 years ago

I followed this tutorial: https://www.youtube.com/watch?v=ZltiKHFWmv8 After, I ran the python -m manim example_scenes.py SquareToCircle -pl command through the Windows terminal, in the manim repo folder, and got an error. Here is the trace:

D:\Documents\Coding\Installations\manim>python -m manim example_scenes.py SquareToCircle -pl
Media will be stored in media\. You can change this behavior by writing a different directory to media_dir.txt.
[concat @ 000001a1d404bf80] Impossible to open 'DD:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00000.mp4'
D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt: Protocol not found
Did you mean file:D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt?

File ready at D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\SquareToCircle.mp4

Played 3 animations

Traceback (most recent call last):
  File "D:\Documents\Coding\Installations\manim\manimlib\extract_scene.py", line 154, in main
    open_file_if_needed(scene.file_writer, **config)
  File "D:\Documents\Coding\Installations\manim\manimlib\extract_scene.py", line 35, in open_file_if_needed
    os.startfile(file_path)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'D:\\Documents\\Coding\\Installations\\manim\\media\\videos\\example_scenes\\480p15\\SquareToCircle.mp4'

I am using this version of manim: https://github.com/3b1b/manim/tree/3b088b12843b7a4459fe71eba96b70edafb7aa78

SuperMaZingCoder commented 4 years ago

I tested this on the newest version, as well. Still getting the issue.

SuperMaZingCoder commented 4 years ago

SystemPropertiesAdvanced_rmPQDq1inU

SuperMaZingCoder commented 4 years ago

Those are the environment variables I have (that I am using for manim).

Kasajizoo commented 4 years ago

I'm having the exactly the same problem. Disrupted by the absence of some answer for this issue >:(

NavpreetDevpuri commented 4 years ago

Try to add this file_list = "file:" + file_list line to the file manim/manimlib/scene/scene_file_writer.py at line number 289 just before the line movie_file_path = self.get_movie_file_path()

Kasajizoo commented 4 years ago

Didn't work

NavpreetDevpuri commented 4 years ago

look, it says DD:/Documents...etc but it should be D:/Documents..etc in [concat @ 000001a1d404bf80] Impossible to open 'DD:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00000.mp4'

Try to add this print("file::::::", partial_movie_files) line to the file manim/manimlib/scene/scene_file_writer.py at line number 284 just before the line with open(file_list, 'w') as fp:

After that show your output

NavpreetDevpuri commented 4 years ago

and check you file D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt

this file may also contains wrong path DD:/Documents...etc instead of D:/Documents..etc

olympic-games commented 4 years ago

Followed the same tutorial and got the same error. Did try print("file::::::", partial_movie_files) line to the file manim/manimlib/scene/scene_file_writer.py at line number 284 just before the line with open(file_list, 'w') as fp: But got the same Traceback.

olympic-games commented 4 years ago

The path is correctly specified in the txt file

jnhyjere commented 4 years ago

I'm facing this issue too. Impossible to open it

SuperMaZingCoder commented 4 years ago

@NavpreetDevpuri Followed those steps, but am still getting an error. Here is what was printed:

file:::::: ['D:\\Documents\\Coding\\Installations\\manim\\media\\videos\\example_scenes\\480p15\\partial_movie_files\\SquareToCircle\\00000.mp4', 'D:\\Documents\\Coding\\Installations\\manim\\media\\videos\\example_scenes\\480p15\\partial_movie_files\\SquareToCircle\\00001.mp4', 'D:\\Documents\\Coding\\Installations\\manim\\media\\videos\\example_scenes\\480p15\\partial_movie_files\\SquareToCircle\\00002.mp4']
SuperMaZingCoder commented 4 years ago

Also tried it with pip install manimlib. Same error.

NavpreetDevpuri commented 4 years ago

Also tried it with pip install manimlib. Same error.

This problem is with ffmpeg Try to reinstall ffmpeg

SuperMaZingCoder commented 4 years ago

@NavpreetDevpuri Alright, I'll try.

SuperMaZingCoder commented 4 years ago

I reinstalled it and then tested it. Works fine when I test it but I get that error still when I try to use manim.

SuperMaZingCoder commented 4 years ago

I looked at the error some and looked again at the part that said: FileNotFoundError: [WinError 2] The system cannot find the file specified: 'D:\\Documents\\Coding\\Installations\\manim\\media\\videos\\example_scenes\\480p15\\SquareToCircle.mp4' And, well, it definitely doesn't exist.

There is a folder within there called partial_movie_files and in there a folder called SquareToCircle. Inside of there, there are three mp4 files and a txt file. The files are:

The .txt file just says:

file 'D:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00000.mp4'
file 'D:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00001.mp4'
file 'D:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00002.mp4'

I think this had something to do with what you might have been saying above.

NavpreetDevpuri commented 4 years ago

This is a error due to ffmpeg somehow it takes sub files names from partial_movie_file_list.txt after that when it try to concat those videos to produce SquareToCircle.mp4 it shows error that sub files impossible to open because somehow it change the file paths from D:/Documents...etc to DD:/Documents...etc

NavpreetDevpuri commented 4 years ago

try to run following command in cmd

ffmpeg -y -f concat -safe 0 -i D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt -loglevel error -c copy D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\output.mp4

After that it should create a file outpu.mp4 in folder D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\

jnhyjere commented 4 years ago

How, then, can we fix it? If we uninstall and reinstall but still pose the same problem.

NavpreetDevpuri commented 4 years ago

After trying above command if it shows same error then i suggest you to post this issue about that command on stackoverflow mentioning that what your text file is containing and how it replace a single 'D' in path 'D:/Document..etc" to double 'DD' and showing error impossible to open 'DD:/Documents/....etc' because this is a issue related to ffmpeg associate with specify system configuration

SuperMaZingCoder commented 4 years ago

@NavpreetDevpuri I'll post a SO question like you said. I did: ffmpeg -y -f concat -safe 0 -i D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt -loglevel error -c copy D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\output.mp4 and got:

[concat @ 0000021cf2ebbe80] Impossible to open 'DD:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00000.mp4'
D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt: Protocol not found
Did you mean file:D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt?
NavpreetDevpuri commented 4 years ago

Try to change partial_movie_file_list.txt

file 'file:D:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00000.mp4'
file 'file:D:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00001.mp4'
file 'file:D:/Documents/Coding/Installations/manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle/00002.mp4'

After that run that command again

NavpreetDevpuri commented 4 years ago

and try following command

ffmpeg -y -f concat -safe 0 -i file:D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt -loglevel error -c copy file:D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\output.mp4
NavpreetDevpuri commented 4 years ago

and also try to reboot your system and run manim because sometimes ffmpeg requires rebooting

SuperMaZingCoder commented 4 years ago

I did the second to last command and there was no error.

SuperMaZingCoder commented 4 years ago

(after I changed the .txt file to what you said). Should I try the last command as well?

NavpreetDevpuri commented 4 years ago

try to run following command in cmd

ffmpeg -y -f concat -safe 0 -i D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt -loglevel error -c copy D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\output.mp4

After that it should create a file outpu.mp4 in folder D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\

Is that one works fine after changes in .txt file ?

SuperMaZingCoder commented 4 years ago

I believe so, I typed in this:

ffmpeg -y -f concat -safe 0 -i D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\partial_movie_file_list.txt -loglevel error -c copy D:\Documents\Coding\Installations\manim\media\videos\example_scenes\480p15\partial_movie_files\SquareToCircle\output.mp4

and got a output.mp4 file in the manim/media/videos/example_scenes/480p15/partial_movie_files/SquareToCircle folder.

So, that is the one that worked after the changes to the .txt file.

NavpreetDevpuri commented 4 years ago

Now change line number 288 in file manim/manimlib/scene/scene_file_writer.py from fp.write("file \'{}\'\n".format(pf_path)) to fp.write("file \'file:{}\'\n".format(pf_path))

after that try to run manim again

SuperMaZingCoder commented 4 years ago

It worked! I think that it might have been on line 289, or that is from the fact that I tried your other changes before. So, is this worth me making a pull request for? Or should we I leave that for someone else that might know more about this?

NavpreetDevpuri commented 4 years ago

i did https://github.com/3b1b/manim/pull/1057

SuperMaZingCoder commented 4 years ago

Alright, thanks for all of your help. :D

SuperMaZingCoder commented 4 years ago

I'll close the issue.

jnhyjere commented 4 years ago

Thank you very much @NavpreetDevpuri! I added the 'file:' into line 258 and it finally work for me as well. Thank you very much :)

Kasajizoo commented 4 years ago

@NavpreetDevpuri I appreciate your help, thank you very much!

ethiclesshacker commented 4 years ago

Had the same issue thanks @NavpreetDevpuri

lwzzzzzzzz commented 4 years ago

thank you very much, it fixed my problem! @NavpreetDevpuri

Alkl58 commented 4 years ago

There is a issue tracker now on ffmpeg: https://trac.ffmpeg.org/ticket/8674

SuperMaZingCoder commented 4 years ago

Awesome! The pull request was merged. No one will be having this problem anymore (unless it gets fixed on ffmpeg and we then have to undo it).

NavpreetDevpuri commented 4 years ago

I think, there will be no need to undo this because it will works fine even with file: and there is no problem with that.

SuperMaZingCoder commented 4 years ago

Ah, that's good.

NavpreetDevpuri commented 3 years ago

thank you very much, it fixed my problem! @NavpreetDevpuri

@lwzzzzzzzz why are you "so upset", is everything ok? I just noticed ur status on Github.