user892134
user892134

Reputation: 3214

downloading mp4 video with ffmpeg produces error

I want to download a mp4 video from a url using ffmpeg.

Here is my command:

/usr/bin/ffmpeg -i 'https://hw16.cdn.asset.aparat.com/aparat-video/249306bba122103d1be6c98f53c4ce5e14166523-720p__77667.mp4' '/home/example/public_html/test/mycron/videos/5c8e7ec5c722b.mp4'

I attempted but get this error Error opening filters!

I tried this command also: /usr/bin/ffmpeg -i 'https://hw16.cdn.asset.aparat.com/aparat-video/249306bba122103d1be6c98f53c4ce5e14166523-720p__77667.mp4' -c:v libx264 -c:a copy '/home/example/public_html/test/mycron/videos/5c8e7ec5c722b.mp4'

And get this error: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

how do i solve?

Upvotes: 1

Views: 2155

Answers (1)

datenwolf
datenwolf

Reputation: 162327

If you want to just download a video, then ffmpeg is overkill. Just use wget or curl.

You'd use ffmpeg if you wanted to transcode/-plex the video into a different codec/file-format during download. And for that you'd give a set of reasonable codec/bitrate parameters, i.e. at least -c:v, -b:v, -c:a, -b:a and -f parameters (see the ffmpeg manual for their meaning).

If you want to download a stream URL (rtmp or similar), then rtmpdump is the right tool; or youtube-dl if it's from a popular streaming site (it supports YouTube, Vimeo, MyVideo, … effectively every streaming site out there).

Upvotes: 2

Related Questions