Search before asking
Bug
The process_video function currently does not record or preserve the audio stream from the source_path. While it correctly processes and renders the video frames, it completely disregards the audio component, resulting in an output video that has no sound.
Environment
No response
Minimal Reproducible Example
import supervision as sv
from supervision.assets import VideoAssets, download_assets
from ultralytics import YOLO
model = YOLO('yolo11n.pt')
trace_annotator = sv.TraceAnnotator(thickness=4, color=sv.Color.BLUE)
vid_path = VideoAssets.BASKETBALL.value #"original.mp4"
download_assets(VideoAssets.BASKETBALL.value)
video_info = sv.VideoInfo.from_video_path(video_path=vid_path)
frames_generator = sv.get_video_frames_generator(source_path=vid_path)
tracker = sv.ByteTrack()
def callback(frame, i):
result = model(frame, verbose=False)[0]
detections = sv.Detections.from_ultralytics(result)
detections = tracker.update_with_detections(detections)
annotated_frame = trace_annotator.annotate(
scene=frame.copy(),
detections=detections)
return annotated_frame
sv.process_video(
source_path=vid_path,
target_path='output-annotator-1.mp4',
callback=callback,
show_progress=True
)
Additional
No response
Are you willing to submit a PR?
Search before asking
Bug
The
process_videofunction currently does not record or preserve the audio stream from thesource_path. While it correctly processes and renders the video frames, it completely disregards the audio component, resulting in an output video that has no sound.Environment
No response
Minimal Reproducible Example
Additional
No response
Are you willing to submit a PR?