RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
232 stars 28 forks source link

[Unity/Windows] When reverse play a video, the progress bar is playing, but the display rate drop 0, and the texture is not update in UIs #1948

Closed yeeneng closed 1 month ago

yeeneng commented 1 month ago

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Describe the issue A clear and concise description of what the issue is.

Your Setup (please complete the following information):

To Reproduce

  1. Setup basic media player and a raw image as displayGUI.
  2. Play a video normally to any frame, then reverse.
  3. The raw image show the normal mode fine and perfect, but when reverse, the raw image texture didnt update/play, stuck at the beginning frame of reverse.

Logs If applicable, add error logs to help explain your problem. -Didnt popup red errors....

Screenshots If applicable, add screenshots to help explain your problem. when normal play video when reversing video

Videos If applicable, add a copy of your video or the URL https://drive.google.com/file/d/1JivBCsC9RX8a2X4NsRQ1i5XlZYUOGTw2/view?usp=sharing

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us unitysupport@renderheads.com

Chris-RH commented 1 month ago

AVPro Video version 1 has been depreciated and is no longer being supported. The issue is that when encoding videos, they are designed for forward prediction so are never going to be as good going in reverse. What you could try is to re-encode your video with something like this:

ffmpeg -i input.mp4 -c:v libx264 -g 12 -bf 2 -c:a copy output.mp4

The -g specifies how often to insert an i-frame, the -bf says how many b-frames to insert between p-frames. b-frames are important for reverse playback as they work in both directions, p-frames are only forward.