Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Can we compress an online video with an http url using ffmpeg directly?

If possible please give me a command that can compress online video directly & save on my PC.

I am using Ubuntu.

share|improve this question
add comment

1 Answer 1

You can give http/rtsp/rtmp input to ffmpeg and it would compress it. But the catch is you need the actual video url.

For sites like youtube, dailymotion, the webpage address is different from the video address.

So you need a helper program like youtube-dl or Movgrab which can provide the video url as well as download the video.

Then you can use ffmpeg to compress it like this:

ffmpeg -i INPUT_URL_FROM_ABOVE_STEP -acodec libfaac -ab 128k -s WIDTHxHEIGHT \
  -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma \
  -partitions +parti4x4+partp8x8+partb8x8 -me umh -subq 5 -trellis 1 -refs 1 \
  -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 \
  -bt BIT_RATE -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' \
  -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect WIDTH:HEIGHT OUTPUT.mp4
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.