# Write video with audio as well using opencv video writer function

**URL:** <https://forum.opencv.org/t/write-video-with-audio-as-well-using-opencv-video-writer-function/7701>\
**Category:** Python\
**Tags:** videoio, audio\
**Created:** [February 24, 2022, 7:21am UTC](https://forum.opencv.org/t/write-video-with-audio-as-well-using-opencv-video-writer-function/7701 "2022-02-24T07:21:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Hassan](https://forum.opencv.org/u/Hassan)\
**Post date:** [February 24, 2022, 7:21am UTC](https://forum.opencv.org/t/write-video-with-audio-as-well-using-opencv-video-writer-function/7701/1 "2022-02-24T07:21:27Z")

</div>

I am using opencv to write processed video via cv2.videoWriter function. But that video get write without sound. How can I write a video with its original audio as well.  
I am reading video using cv2.Videocapture(0), and writing it using cv2.videowriter function.  
Tried a lot but unable to to so but unable to do so.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [February 24, 2022, 7:36am UTC](https://forum.opencv.org/t/write-video-with-audio-as-well-using-opencv-video-writer-function/7701/2 "2022-02-24T07:36:37Z")

</div>

> [@Hassan](#):
>
> How can I write a video with its original audio as well.

you can’t, using VideoWriter, it only accepts images as input.  
try with ffmpeg / gstreamer instead
