Repository: ManimCommunity/manim
Pull request: Removed temporary partial movie file in scenefilewriter
<!--- 
Thanks for contributing to manim!
**Please ensure that your pull request works with the latest version of manim from this repository.**
You should also include:
  1. The motivation for making this change (or link the relevant issues)
  2. How you tested the new behavior (e.g. a minimal working example, before/after
     screenshots, gifs, commands, etc.) This is rather informal at the moment, but
     the goal is to show us how you know the pull request works as intended.
If you don't need any of the optional sections, feel free to delete them to prevent clutter.
-->

## List of Changes
<!-- List out your changes one by one like this:
- Change 1
- Change 2
- and so on..

Be sure to note your changes in the [changelog](docs/source/changelog.rst) if your
changes warrant it!
-->

- Removed temp partial movie file from SceneFileWriter (ffmpeg directly renders partial movie files instead of temp files)

## Motivation
<!-- Why you feel your changes are required. -->

Issue #486 

Closes #486 

## Explanation for Changes
<!-- How do your changes solve aforementioned problems? -->

## Testing Status
<!-- Optional, but recommended, your computer specs and what tests you ran with their results, if any -->

## Further Comments
<!-- Optional, any edits/updates should preferably be written here. -->

## Acknowledgements
- [x] I have read the [Contributing Guidelines](https://docs.manim.community/en/latest/contributing.html)
- [X] I have added an entry describing the changes from this PR to the [Changelog](https://docs.manim.community/en/latest/changelog.html) at `docs/source/changelog.rst`

<!-- Once again, thanks for helping out by contributing to manim! -->


Problem statement:
Removing temp ffmpeg's temp-files 
Before partial movie files are generated by ffmpeg, scenefilewriter creates temp partial movie file and then move them and rename them with their definitive name (which is the hash of the animation). 
Why ? Why not rendering directly partial movie files? 
I think we should, if there is no objection, remove this and make ffmpeg directly render partial movie files.  

<!-- Edit the body of your new issue then click the ✓ "Create Issue" button in the top right of the editor. The first line will be the issue title. Assignees and Labels follow after a blank line. Leave an empty line before beginning the body of the issue. -->

Hints from issue discussion:
No objection here.
Is this still open? If it is, I would like to look into it. 
@farahash yes! Please feel free to discuss here or open a PR.
@farahash and to assign yourself on this issue if you work on it ;)
@huguesdevimeux it doesn't seem like I can do that myself. Do I need to be added as a collaborator to the repo to get access? 
(you can go ahead and assign it to me if that works too)
Sorry. I thought you could. 

Now you are assigned !

Commit message: Added entry to changelog

Patch to review:
diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
index 1be4bcc07d..59353eb06a 100644
--- a/docs/source/changelog.rst
+++ b/docs/source/changelog.rst
@@ -207,3 +207,4 @@ Other Changes
 #. Rename package from manimlib to manim
 #. Move all imports to :code:`__init__`, so :code:`from manim import *` replaces :code:`from manimlib.imports import *`
 #. Global dir variable handling has been removed. Instead :code:`initialize_directories`, if needed, overrides the values from the cfg files at runtime.
+#. Removed temp partial movie file from SceneFileWriter (ffmpeg directly renders partial movie files instead of temp files)
diff --git a/manim/scene/scene_file_writer.py b/manim/scene/scene_file_writer.py
index 0804b86d74..6e92fbc721 100644
--- a/manim/scene/scene_file_writer.py
+++ b/manim/scene/scene_file_writer.py
@@ -340,13 +340,7 @@ def open_movie_pipe(self):
         buffer.
         """
         file_path = self.partial_movie_files[self.renderer.num_plays]
-
-        # TODO #486 Why does ffmpeg need temp files ?
-        temp_file_path = (
-            os.path.splitext(file_path)[0] + "_temp" + config["movie_file_extension"]
-        )
         self.partial_movie_file_path = file_path
-        self.temp_partial_movie_file_path = temp_file_path
 
         fps = config["frame_rate"]
         height = config["pixel_height"]
@@ -373,21 +367,16 @@ def open_movie_pipe(self):
             command += ["-vcodec", "qtrle"]
         else:
             command += ["-vcodec", "libx264", "-pix_fmt", "yuv420p"]
-        command += [temp_file_path]
+        command += [file_path]
         self.writing_process = subprocess.Popen(command, stdin=subprocess.PIPE)
 
     def close_movie_pipe(self):
         """
-        Used internally by Manim to gracefully stop writing to FFMPEG's
-        input buffer, and move the temporary files into their permananant
-        locations
+        Used internally by Manim to gracefully stop writing to FFMPEG's input buffer
         """
         self.writing_process.stdin.close()
         self.writing_process.wait()
-        shutil.move(
-            self.temp_partial_movie_file_path,
-            self.partial_movie_file_path,
-        )
+
         logger.info(
             f"Animation {self.renderer.num_plays} : Partial movie file written in %(path)s",
             {"path": {self.partial_movie_file_path}},


Code review comments:
diff_hunk: @@ -207,3 +207,4 @@ Other Changes
 #. Rename package from manimlib to manim
 #. Move all imports to :code:`__init__`, so :code:`from manim import *` replaces :code:`from manimlib.imports import *`
 #. Global dir variable handling has been removed. Instead :code:`initialize_directories`, if needed, overrides the values from the cfg files at runtime.
+#. Removed temp partial movie file from SceneFileWriter (ffmpeg directly renders partial movie files instead of temp files)
path: docs/source/changelog.rst
text: @user1:
I believe this is at the bottom of the file - could you please put it at the top, under the appropriate version header?

@author:
Fixed