FFmpeg Cookbook
JA

Shrink a video for LINE messaging

Make a phone video or screen recording smaller so it is easier to send on LINE. Cut the parts you don't need, lower the resolution, and convert it to H.264 MP4. Everything runs in your browser, so you don't upload the video anywhere.

No files are sent to any server

Open the video compressor

Opens with Standard quality (CRF 23) and 720p selected. You can change both in the tool.

Video compressor →

What to check before sending on LINE

Compressing doesn't change your original video. The compressed video downloads as a separate file.

The basics of making a video lighter

The tool you'll use

Use the video compressor. It converts the video to H.264 MP4 and lets you choose the resolution and the quality (High, Standard or Light). Switch to Target Size (MB) to aim for a file size you choose. Everything runs in your browser. It accepts videos up to 500 MB. For a long video, cut it down with the trim tool first, then compress it.

The FFmpeg command

With FFmpeg, this command converts a video to a 720p MP4.

ffmpeg -i input.mp4 -vf scale=-2:720 -c:v libx264 -crf 28 -pix_fmt yuv420p -c:a aac -b:a 96k -movflags +faststart output.mp4

scale=-2:720 sets the height to 720 and picks an even width that keeps the shape of the picture. (With this command, an odd width or height makes the H.264 encoder fail.) -crf 28 sets the quality: a higher number gives a smaller file and lower quality. -pix_fmt yuv420p makes an 8-bit video that almost every device can play. Without it, an iPhone HDR video stays 10-bit and becomes H.264 "High 10", which many devices can't play. -movflags +faststart puts the playback information at the start of the file, so the video can start playing while it downloads. -c:a aac -b:a 96k makes the audio 96 kbps AAC. For an even smaller file, use -vf scale=-2:480 or raise -crf to about 30.

For a vertical (9:16) video, scale=-2:720 makes it only 406 pixels wide. Use scale=720:-2 to make it 720 wide instead.

Steps

  1. If there are parts you don't need, cut them first with the trim tool.
  2. Click "Video compressor" above. The tool opens with Standard quality and 720p selected.
  3. Choose the video file.
  4. For a smaller file, choose Light quality or lower the resolution to 480p.
  5. Click the compress button (for example "Compress at CRF 23"). When it's done, compare it with the original, then download it.

If your phone struggles to process the file

On a phone, a video over 200 MB can use up the memory and crash the browser tab. Process large videos in a desktop browser.

If processing takes a long time, trim the video first so there is less to process.

FAQ

Q. I made the video smaller, but it still won't send. What else can I check?

A. LINE's help says photos and videos can fail to send when the connection is unstable for a while. It suggests trying again where the signal is good, or switching between Wi-Fi and mobile data. Also check in your phone's settings that LINE is allowed to access your photos.

Q. Can my iPhone record in H.264 from the start?

A. Yes. Open Settings, tap Camera, tap Formats, then tap Most Compatible. Videos you record after that are saved as H.264. Choose High Efficiency to go back to HEVC.

Q. Will compressing reduce the quality?

A. Yes. Compressing re-encodes the video, so some quality is always lost. To keep more quality, cut the parts you don't need first. A shorter video needs less compression to reach the same file size.

Related tools