The DeFFcode's FFdecoder API supports -stream_loop FFmpeg parameter using the -ffprefixes attribute by way of its dictionary parameter for decoding infinite looping video frames using just a single video source. But presently, it fails to identify the given looping source and treat them as one regular video with finite duration. This create unwanted problem where video frames are decoded upto a certain duration only once like a regular video file, and then exits automatically without going for another loop, thus defeating the very purpose.
Issue Checklist
[X] I have searched open or closed issues for my problem and found nothing related or helpful.
[X] I have read the Documentation and found nothing related to my problem.
Being able to identify the given looping source and not as regular video file, and API should not exit automatically..
Actual behaviour
It identify the given source as regular video file with finite duration, and it exits automatically without going for another loop.
Steps to reproduce
Run this python given below code in Python Code section and you will see FFdecoder API exiting automatically after given video source duration is over. Also if you check the metadata extracted something similar as follows:
The approx_video_nframes value is 630 which exact value of frames in one regular video file.
Terminal log output
No response
Python Code(Optional)
# import the necessary packages
from deffcode import FFdecoder
import cv2
# define `-stream_loop 3` for looping 3 times
ffparams = {"-ffprefixes":["-stream_loop", "3"]}
# initialize and formulate the decoder with suitable source
decoder = FFdecoder("foo.mp4", frame_format="bgr24", verbose=True, **ffparams).formulate()
# grab the BGR24 frame from the decoder
for frame in decoder.generateFrame():
# check if frame is None
if frame is None:
break
# {do something with the frame here}
# Show output window
cv2.imshow("Output", frame)
# check for 'q' key if pressed
key = cv2.waitKey(1) & 0xFF
if key == ord("q"):
break
# close output window
cv2.destroyAllWindows()
# terminate the decoder
decoder.terminate()
Description
The DeFFcode's FFdecoder API supports
-stream_loop
FFmpeg parameter using the-ffprefixes
attribute by way of its dictionary parameter for decoding infinite looping video frames using just a single video source. But presently, it fails to identify the given looping source and treat them as one regular video with finite duration. This create unwanted problem where video frames are decoded upto a certain duration only once like a regular video file, and then exits automatically without going for another loop, thus defeating the very purpose.Issue Checklist
Expected behaviour
Being able to identify the given looping source and not as regular video file, and API should not exit automatically..
Actual behaviour
It identify the given source as regular video file with finite duration, and it exits automatically without going for another loop.
Steps to reproduce
Run this python given below code in Python Code section and you will see FFdecoder API exiting automatically after given video source duration is over. Also if you check the metadata extracted something similar as follows:
The
approx_video_nframes
value is630
which exact value of frames in one regular video file.Terminal log output
No response
Python Code(Optional)
DeFFcode Version
0.2.3
Python version
3.7
Operating System version
all
Any other Relevant Information?
No response