Segment-and-Track-Anything
Segment-and-Track-Anything copied to clipboard
ffmpeg.error
How can I solve the problem of not being able to save the corresponding MP4?
Hi, in the demo.ipynb, by default the output_video has the same format as the input video, i.e. 'output_video': './assets/pl_seg.mp4', since the default fourcc is obtained from the source video. If you want a pl_seg.avi format output, i.e. 'output_video': './assets/pl_seg.avi', please go to "Save results for visualization" part, and change the line "fourcc = int(cap.get(cv2.CAP_PROP_FOURCC))" to: "fourcc = cv2.VideoWriter_fourcc(*"XVID")" or "fourcc = cv2.VideoWriter_fourcc(*"MJPG")"
Besides, we have updated the demo.ipynb, please try the new version to save the video. It supports different formats between input and output, e.g. mp4 input and avi output.
Hi, in the demo.ipynb, by default the output_video has the same format as the input video, i.e. 'output_video': './assets/pl_seg.mp4', since the default fourcc is obtained from the source video. If you want a pl_seg.avi format output, i.e. 'output_video': './assets/pl_seg.avi', please go to "Save results for visualization" part, and change the line "fourcc = int(cap.get(cv2.CAP_PROP_FOURCC))" to: "fourcc = cv2.VideoWriter_fourcc("XVID")" or "fourcc = cv2.VideoWriter_fourcc("MJPG")"
Besides, we have updated the demo.ipynb, please try the new version to save the video. It supports different formats between input and output, e.g. mp4 input and avi output.
Thank you for your reply. There may be a problem with my screenshot. At that time, I tried MP4 output and reported that error. I tried a new demo. pynb. Thank you again for your reply
Hi, in the demo.ipynb, by default the output_video has the same format as the input video, i.e. 'output_video': './assets/pl_seg.mp4', since the default fourcc is obtained from the source video. If you want a pl_seg.avi format output, i.e. 'output_video': './assets/pl_seg.avi', please go to "Save results for visualization" part, and change the line "fourcc = int(cap.get(cv2.CAP_PROP_FOURCC))" to: "fourcc = cv2.VideoWriter_fourcc("XVID")" or "fourcc = cv2.VideoWriter_fourcc("MJPG")"
Besides, we have updated the demo.ipynb, please try the new version to save the video. It supports different formats between input and output, e.g. mp4 input and avi output.
How can I extract one specific people from the video
Hi, in the demo.ipynb, by default the output_video has the same format as the input video, i.e. 'output_video': './assets/pl_seg.mp4', since the default fourcc is obtained from the source video. If you want a pl_seg.avi format output, i.e. 'output_video': './assets/pl_seg.avi', please go to "Save results for visualization" part, and change the line "fourcc = int(cap.get(cv2.CAP_PROP_FOURCC))" to: "fourcc = cv2.VideoWriter_fourcc("XVID")" or "fourcc = cv2.VideoWriter_fourcc("MJPG")" Besides, we have updated the demo.ipynb, please try the new version to save the video. It supports different formats between input and output, e.g. mp4 input and avi output.
How can I extract one specific people from the video
The 1.0 version has been released, which supports interactive segmentation via WebUI, please have a check.
Thank you for your hard work, but the issue with saving MP4 that was previously fixed in demo.ipynb has reappeared in APP.PY. You can take a look.
This cause https://github.com/opencv/opencv-python/issues/100#issuecomment-394159998
Check: https://pypi.org/project/ffmpegcv/
This cause opencv/opencv-python#100 (comment)
Check: https://pypi.org/project/ffmpegcv/
This cause opencv/opencv-python#100 (comment)
Check: https://pypi.org/project/ffmpegcv/
I use the same virtual environment and can generate corresponding MP4 files using demo.ipynb, but cannot generate corresponding MP4 files using app.py. I am not sure if it is a problem with my own environment or something. Could you please confirm again? Thank you for your hard work.
Hi, in the demo.ipynb, by default the output_video has the same format as the input video, i.e. 'output_video': './assets/pl_seg.mp4', since the default fourcc is obtained from the source video. If you want a pl_seg.avi format output, i.e. 'output_video': './assets/pl_seg.avi', please go to "Save results for visualization" part, and change the line "fourcc = int(cap.get(cv2.CAP_PROP_FOURCC))" to: "fourcc = cv2.VideoWriter_fourcc("XVID")" or "fourcc = cv2.VideoWriter_fourcc("MJPG")" Besides, we have updated the demo.ipynb, please try the new version to save the video. It supports different formats between input and output, e.g. mp4 input and avi output.
How can I extract one specific people from the video
The 1.0 version has been released, which supports interactive segmentation via WebUI, please have a check.
I use the same virtual environment and can generate corresponding MP4 files using demo.ipynb, but cannot generate corresponding MP4 files using app.py. I am not sure if it is a problem with my own environment or something. Could you please confirm again? Thank you for your hard work.
The code of app.py partially relies on demo.ipynb, so the problem is probably the same as that in the old demo.ipynb. We are fixing it and the updated version will be released soon.
app.py 的代码部分依赖于demo.ipynb,所以问题可能与旧的demo.ipynb相同。我们正在修复它,更新版本将很快发布。
app.py 的代码部分依赖于demo.ipynb,所以问题可能与旧的demo.ipynb相同。我们正在修复它,更新版本将很快发布。
Thank you for your reply. Your work has brought us a very good experience. Thank you very much
Hi, the app.py has been updated, please have a try and check whether the video can be saved successfuly.
Hi, the app.py has been updated, please have a try and check whether the video can be saved successfuly.
We can achieve the effect of demo1 now. Thank you very much. What method is there to keep only the selected part and output the video without retaining the rest? In other words, it is like the movie's green cloth, only retaining the main body and removing the background.
@yoxu515 Are you sure that it is going to work with this codec? Also using your default Swan example I see a warning on gradio related to the browser supported codec:
components.py:2203: UserWarning: Video does not have browser-compatible container or codec. Converting to mp4
Then the zip is visible in the UX but not the output video.
@yoxu515 Are you sure that it is going to work with this codec? Also using your default Swan example I see a warning on gradio related to the browser supported codec:
components.py:2203: UserWarning: Video does not have browser-compatible container or codec. Converting to mp4
Then the zip is visible in the UX but not the output video.
Thank you for your reminder that there may be some incompatibilities, and we will follow up with improvements. In the current version, you can refresh by clicking the 'output-video' component, and the display will be updated.
In the current version, you can refresh by clicking the 'output-video' component, and the display will be updated.
Really? I don't see any effect.
In the current version, you can refresh by clicking the 'output-video' component, and the display will be updated.
Really? I don't see any effect.
Maybe you need to click on the bottom left corner of the 'output-video' component, which is the play button.
There is any interactive area when done
There is any interactive area when done
Yes, you can hover your mouse over the bottom left corner of the 'output-video' component, and you will notice that it is a clickable area.
I've tested on multiple browsers and I don't see any sensible left corner.
I've tested on multiple browsers and I don't see any sensible left corner.
The play button is located in the red box.
I've tested on multiple browsers and I don't see any sensible left corner.
After clicking, the output video will be displayed.
It works but only in the case the input video is already in a "compatible" codec for the 'opencv-python ' pip