You can also use other videoWriter fourccs' which change the encoding methods, i.e, it can solve your file not supported errors. Just replace 'mp4v' with the fourcc you want, you can get a list of the available fourccs by putting -1 in place of 'video_fourcc' in videoWritter(). opencv documentation: docs.opencv.org/4.x/dd/d9e/classcv_1_1VideoWriter.html to get a full list of all the fourccs you can get them from the links provided in the documentation, you can get what fourccs works for you from the 3 websites provided.
I extracted frame from .mp4 video that output frame are so many, but when I convert this extracted frame to get original video, some image frames intercepted between another frames in the combining video. how to solve this problem??
this code adds the images one by one from the starting of the list. so, the intervened frames maybe are in the wrong place in the list. try renaming the frames serialy and sort the list accordingly it may help
Basically add the image multiple times for eg if you want a img to be there for 2 secs and your frame rate is 24 fps add the img 48 times consecutively, you can use a for loop for this
In your video you have 3 different groups of image sequences that have to be converted into 3 different video files. Have you developed a way to convert the 3 different groups of image sequences into 3 separate videos by only running the code once? Or did you have to run the code 3 separate times for each project?
i ran it 3 separate times as I don't use it much but you can put the code in a function and run it in a for loop, giving the separate image sequences as a input for the function in each iteration of the code.
For example if you want to add a transition image after the 10th frame, you can check which frame it is currently writing to the video every time a new frame is written and when it hits the 10th frame it will add the transition image.This can be done by adding this code at the end of the last for loop. if(i+1==10): video.write(cv2.imread(transition image path)
Some video players do not support the videos outputed with this method, vlc media player is compatible. I'm working on a solution for this issue. But one work around would be to convert the video using vlc, you can see other videos on how to convert.
It depends on which codecs you have on your PC, you can try putting -1 in the videowriter fourcc to get which codecs you have on your PC. You can try those codes one by one and see which one works the best. answers.opencv.org/question/100967/codecs-list/
You can also use other videoWriter fourccs' which change the encoding methods, i.e, it can solve your file not supported errors. Just replace 'mp4v' with the fourcc you want, you can get a list of the available fourccs by putting -1 in place of 'video_fourcc' in videoWritter().
opencv documentation: docs.opencv.org/4.x/dd/d9e/classcv_1_1VideoWriter.html
to get a full list of all the fourccs you can get them from the links provided in the documentation, you can get what fourccs works for you from the 3 websites provided.
THANK YOU! This helps so much
Exactly what I was looking for. Thank you very much
Thanks bro didn't help me but since am ur friend from last 10 years I need to support eh xd
size = list(frame.shape)
AttributeError: 'NoneType' object has no attribute 'shape'
PS C:\Users\Genee\OneDrive\Fotos\Saved Pictures>
There must be some errors associated with the frame variable, please do check, sorry for late reply🥴😁
Thanks bro. ❤
I extracted frame from .mp4 video that output frame are so many, but when I convert this extracted frame to get original video, some image frames intercepted between another frames in the combining video. how to solve this problem??
this code adds the images one by one from the starting of the list. so, the intervened frames maybe are in the wrong place in the list. try renaming the frames serialy and sort the list accordingly it may help
How can I add different time for each frame, for eg. img1 will run for 2 second, img2 will run for 3 second in video, etc.
Basically add the image multiple times for eg if you want a img to be there for 2 secs and your frame rate is 24 fps add the img 48 times consecutively, you can use a for loop for this
In your video you have 3 different groups of image sequences that have to be converted into 3 different video files.
Have you developed a way to convert the 3 different groups of image sequences into 3 separate videos by only running the code once?
Or did you have to run the code 3 separate times for each project?
i ran it 3 separate times as I don't use it much
but you can put the code in a function and run it in a for loop, giving the separate image sequences as a input for the function in each iteration of the code.
thanks for the tutorial.
I would never use this in my life but for someone who wants to 👍
Thank you so much
Epic!
Bro how to add transition image?
For example if you want to add a transition image after the 10th frame, you can check which frame it is currently writing to the video every time a new frame is written and when it hits the 10th frame it will add the transition image.This can be done by adding this code at the end of the last for loop.
if(i+1==10):
video.write(cv2.imread(transition image path)
Bro it shows error file isn't playable because the file type is unsupported 😭 everything worked till the last moment
Some video players do not support the videos outputed with this method, vlc media player is compatible. I'm working on a solution for this issue. But one work around would be to convert the video using vlc, you can see other videos on how to convert.
@@frames123 ok I will try it out, thank you
Bro even vlc media player doesn't work, it just shows a blank screen even when I click the play button
@@alexandercharles3064 Same for me in VLC
It depends on which codecs you have on your PC, you can try putting -1 in the videowriter fourcc to get which codecs you have on your PC. You can try those codes one by one and see which one works the best.
answers.opencv.org/question/100967/codecs-list/
thanks, i wanna to make a console yt for urself using this lib and ascii
code?
will be available in a while, please have patience for the mean time, sorry for the inconvenience🥴
the code is now availbe, so sorry for such a long wait~~~😔😅