ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

Output video has no sound (saved the video using ffmpeg python?

Open ayush431 opened this issue 3 years ago • 2 comments

Here is my code - ffmpeg.input(video).filter('fps', fps=30, round='up').filter('scale', w=512, h=512).output('train1.mp4').run()

ayush431 avatar Jun 02 '22 05:06 ayush431

hello how are you, I had the same problem when I resized the video. but instead of using ".filter" for scaling add it in ".output" vf="scale=320:-1"

In your case I think it would look like this: ffmpeg.input(video).filter('fps', fps=30, round='up').output('train1.mp4', vf='scale=512:512').run()

keinc0de avatar Jun 06 '22 14:06 keinc0de

environment google colab

code

!wget -c http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
pip install -U ffmpeg-python
import ffmpeg
import IPython
(
    ffmpeg
    .input('BigBuckBunny.mp4')
    .trim(duration = 3)
    .output('trim_duration.mp4')
    .run()
)
IPython.display.Video('trim_duration.mp4', embed = True)

result no sound on video output

expected result video output have sound

best regards

sugizo avatar Feb 20 '24 21:02 sugizo