14:54
I am working on a Node.js application that uses ffmpeg to convert videos to mp3 files. I have installed ffmpeg full build (libmp3lame included), and I have configured the path to ffmpeg correctly in my application. However, when I try to convert a video to mp3, I get the error "Output format mp3 is not available.
ffmpeg(inputPath)
.outputOptions('-vn', '-ab', '128k', '-ar', '44100')
.toFormat('mp3')
.save(outputPath)
.on('error', (err) => console.error(`Error converting (...)
09:55
TL;DR
I'm trying to programmatically download a part of a YouTube video. The widely known procedure doesn't work for some videos and I'd like to overcome this situation.
Context
I'm trying to programmatically download a part of a YouTube video. As described in How to download portion of video with youtube-dl command?, you can achieve this by the following commands.
#Converts a human-readable URL to longer URLs for internal use.
~ $ youtube-dl --get-url (...)
07:45
What im trying to do in python is to convert a 4k mkv video to 1080p mp4 video using the ffmpeg library.
import subprocess
def convert_4k_to_1080p(input_file, output_file):
cmd = f'ffmpeg -i "input_file" -crf 18 -c:v libx264 -c:a aac -s 1920x1080 "output_file"'
subprocess.run(cmd, shell=True)
input_file = "c:/Users/Shaahid/Videos/Movies/Series/Arcane.S01E02.2021.2160p.UHD.WEB.AI.AV1.Opus.MULTi5-dAV1nci.mkv"
output_file = "c:/Users/Shaahid/Videos/Movies/Series/Test.mp4"
convert_4k_to_1080p(input_file, output_file)
however i (...)
03:01
How to get the http status code after call avformat_seek_file of ffmpeg to get a http url video?
I have a video source which is provided as a http url link, I want to get a snapshot of it , so I call avformat_seek_file to find a frame, but I find that it returns value is not < 0, even if the http call not return 200 or 206, so I want to know how to get the response of http calling in avformat_seek_file.