You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, I apologize for my poor English. I'm not very fluent, and I hope my question isn't too naive. I don't know much about how RIFE really works.
Let's say I want to interpolate a video that uses the H.264 codec. After the interpolation process, the video ends up using the MPEG-4 codec. This not only changes the codec from H.264 but also affects the bitrate and quality. I was wondering if it's possible to choose a different codec instead of MPEG, as well as adjust output parameters like CRF, etc. (By the way, I'm using Practical RIFE on Google Colab.)
The text was updated successfully, but these errors were encountered:
Hikari2w2
changed the title
How to avoid RIFE AI Re-encode videos to MPEG4 codec
avoid RIFE from Reencoding output to MPEG4 codec
Jun 7, 2024
Hikari2w2
changed the title
avoid RIFE from Reencoding output to MPEG4 codec
How to avoid RIFE from Re-encoding output to MPEG4 codec
Jun 7, 2024
Hikari2w2
changed the title
How to avoid RIFE from Re-encoding output to MPEG4 codec
How to avoid RIFE from Re-encoding output to MPEG codec
Jun 8, 2024
Just based on reading the documentation, it would appear that inference_video.py uses cv2 to write the frames to the video. There are a few things I've seen: cv2.VideoWriter_fourcc(*'avc1'), this would need to be installed using apt instead of pip --> pip uninstall opencv-python sudo apt install build-essential cmake git python3-dev python3-numpy \ libavcodec-dev libavformat-dev libswscale-dev \ libgstreamer-plugins-base1.0-dev \ libgstreamer1.0-dev libgtk-3-dev \ libpng-dev libjpeg-dev libopenexr-dev libtiff-dev libwebp-dev \ libopencv-dev x264 libx264-dev libssl-dev ffmpeg python -m pip install --no-binary opencv-python opencv-python
From here you can change the line 116 in inference_video.py from fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v') to cv2.VideoWriter_fourcc(*'avc1'). As for crf options, I haven't found a solid solution for that yet, but this is a good start and hopefully is helpful!
First off, I apologize for my poor English. I'm not very fluent, and I hope my question isn't too naive. I don't know much about how RIFE really works.
Let's say I want to interpolate a video that uses the H.264 codec. After the interpolation process, the video ends up using the MPEG-4 codec. This not only changes the codec from H.264 but also affects the bitrate and quality. I was wondering if it's possible to choose a different codec instead of MPEG, as well as adjust output parameters like CRF, etc. (By the way, I'm using Practical RIFE on Google Colab.)
This is the command I'm currently using
!python3 inference_video.py --multi=3 --video=video.mp4
The text was updated successfully, but these errors were encountered: