ffmpeg-python
ffmpeg-python copied to clipboard
Output video has no sound (saved the video using ffmpeg python?
Here is my code - ffmpeg.input(video).filter('fps', fps=30, round='up').filter('scale', w=512, h=512).output('train1.mp4').run()
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()
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