Guides
Home

Edge Usage Guide

After the container has started and the models are optimized, you can interact with the running container to execute the pipeline using docker exec.

Processing a Single Video File

You can redact a single video file by executing the following command inside the container:

docker exec <docker_container_id> /bin/bash -c "python3 /root/redact-edge/gst-bai-ds/tools/run_pipeline.py --input_type video --input_source <video_path> --output_type video --output_target <output_path>"



Explanation of Parameters:

  • <docker_container_id>: This is the ID or name of the running Docker container. You can find the container ID by running docker ps.
  • <video_path>: The path to the input video file that you want to process. This path must be within the mounted /input directory inside the container.
  • <output_path>: The path to where the output video file will be saved. This path must be within the mounted /output directory inside the container.

Example Usage:

If you have a video file located at /input/sample_video.mp4 inside the container and want to save the processed video to /output/processed_video.mp4, you would run the following command:

docker exec <docker_container_id> /bin/bash -c "python3 /root/redact-edge/gst-bai-ds/tools/run_pipeline.py --input_type video --input_source /input/sample_video.mp4 --output_type video --output_target /output/processed_video.mp4"



Processing a Folder of Videos

In addition to processing individual video files, you can also process an entire folder of videos by executing the following command inside the container:

docker exec <docker_container_id> /bin/bash -c "python3 /root/redact-edge/gst-bai-ds/tools/redact_folder.py -i <input_video_folder> \ -o <output_folder>"


Explanation of Parameters:

  • <docker_container_id>: This is the ID or name of the running Docker container. You can get the container ID by running docker ps.
  • <input_video_folder>: The input folder containing the videos you want to process. This folder must be mounted within the container and should point to the location where your input videos are stored.
  • <output_folder>: The output folder where the processed videos will be saved. This folder must also be mounted within the container, and the processed files will be saved there.

Example Usage:

If your folder of videos is located at /home/user/data/input/ on your host machine, and you want to save the processed videos to /home/user/data/output/, you would run the following command:

docker exec <docker_container_id> /bin/bash -c "python3 /root/redact-edge/gst-bai-ds/tools/redact_folder.py -i /input/ -o /output/"

In this example, the input folder (/home/user/data/input/) is mounted to /input/ inside the container, and all videos in that folder will be processed. The processed videos will be saved in the /output/ directory, which is mounted to /home/user/data/output/ on the host machine.



Troubleshooting

If you encounter issues with Redact-Edge, you can enable detailed debugging information to diagnose the problem. To get more information, run with the GST_DEBUG environment variable set. This will provide verbose logs, which can help you identify issues with elements, linking, and configuration.

  • Run the script with GST_DEBUG set to a higher level:
    • GST_DEBUG=3 python3 /root/redact-edge/gst-bai-ds/tools/run_pipeline.py ...
    • GST_DEBUG=3 sets the debug level to capture warnings, errors, and detailed messages. You can increase this to 4 or 5 for even more granular information.