Skip to content

Tips: To convert video to be recognizable and playable in weixin wechat

suntong edited this page Aug 21, 2023 · 13 revisions

ffcvt now able to convert video to be recognizable and playable in weixin/wechat

I found that the .mp4 file downloaded from youtube cannot be recognizable and playable in weixin/wechat.
But now, that is history, with the introduction of the -t wx option as the convertion type.

UPDATE:

With Release v1.12.0, it is now able to have specific CRF environment variable for libx26? types, which is what the wx type bases on. I.E., to override the default CRF setting, use:

export FFCVT_CRF4=33.8

Or whatever you like (the greater the value is, the less video quality retained, thus the less space the result file will take).

How to use

Download it here, make sure it is v1.7.0 or newer.

  • If you don't have a Linux system to use ffcvt, here is how to installed the ffmpeg it needs under Windows, in just 15 easy steps, taken from wikihow, provided that you know how to figure out the rest of the missing dots, as all the documents here are written for Linux/MacOS.
    • Else install WSL and free yourself from the bondage of Microsoft, and embrace an open world.
    • There is WSL and there is WSL 2. If you don't know the exact differences between them, then I suggest to install the original WSL. That's what I did, and
    • All the recent demos are run from within my Debian WSL -- If you don't know whether to choose Debian or Ubuntu, then I suggest to choose Debian.
  • Also, refer to other howtos in this wiki for how to use ffcvt, e.g., YouTube encoding by using the -t youtube option as the convertion type.

Real-life example:

export FFCVT_O='-speed 2 -af volume=3.2'

$ nice ffcvt -nc -t wx -f LaunchATrashCanWithLiquidNitrogen.mkv

== Transcoding: LaunchATrashCanWithLiquidNitrogen.mkv
] ffmpeg -i LaunchATrashCanWithLiquidNitrogen.mkv -speed 2 -af volume=3.2 -c:v libx264 -x264-params crf=33 -c:a aac -b:a 48k -q:a 3 LaunchATrashCanWithLiquidNitrogen_.m4v

Done.
Org Size: 37666 KB
New Size: 15121 KB
Saved:    59% with 22545 KB
Time: 40.7739939s at 2021-09-09 18:14:33


Transcoding completed in 40.7749958s
Org Size: 36 MB
New Size: 14 MB
Saved:    59%

As we can see from the following screenshot,

image

Videos over 5 minutes can be sent (the 05:08pm one, the one having the conversion log as shown above, from the source here), and another one, the 06:06pm one (source is here), the length is almost 20 minutes!

However, it turns out that, the above 18:51 video of 22.43M in size is luckiest maximum that I got, as you can see that a shorter but slightly bigger video file was failed to be sent, let alone the previous longer and bigger files (the failed second last was: 0:18:10, 25.4M, 25410735).

image

Ref:

How to Install FFmpeg on Windows

Written by Jack Lloyd
Last Updated: May 23, 2021

FFmpeg is an open-source media tool you can use to convert any video format into the one you need. The tool is command-line only, which means it doesn't have a graphical, clickable interface. If you're used to installing regular graphical Windows programs, installing FFmpeg may seem complicated at first—but don't worry, it's actually pretty easy! This wikiHow teaches you the simplest way to install FFmpeg on your Windows PC.

Steps

Image titled Install FFmpeg on Windows Step 1

Go to https://ffmpeg.org/download.html. This brings you to a page containing the latest FFmpeg install packages and binary files.

  • If you don't have an app that can decompress files ending with the .7z file extension, such as WinRAR or 7Zip, you must install one before you can continue.

  1. Image titled Install FFmpeg on Windows Step 2

Click the Windows logo. It's the blue square with a white window inside.


  1. Image titled Install FFmpeg on Windows Step 3

Click Windows builds from gyan.dev. This takes you to a page that contains FFmpeg builds specifically for Windows that contains all of the hardware libraries you could possibly need.

  • If you prefer, you could click Windows builds by BtbN instead, which is another Windows build of FFmpeg. There are a variety of builds available from different websites---the official FFmpeg website may add more as they become available.

  1. Image titled Install FFmpeg on Windows Step 4

Scroll down to the "git" section. It's about halfway down the page between the set of green boxes and the "release" sections.


  1. Image titled Install FFmpeg on Windows Step 5

Click the link to download ffmpeg-git-full.7z. The full text of the link is https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z. This link downloads the latest FFmpeg files to your PC in a compressed format.


  1. Image titled Install FFmpeg on Windows Step 6

Extract the downloaded file. Here's how:

  • Right-click the Windows/Start button and select File Explorer.
  • Click the Downloads folder in the left panel (you may have to click This PC first to find it).
  • Right-click ffmpeg-*-git-*full_build.7z (the file name will vary depending on the current release).
  • Select Extract Here and wait for the files to extract. This creates a new folder with the same name as the .7z file.

  1. Image titled Install FFmpeg on Windows Step 7

Rename the extracted folder to FFmpeg. To do this, just right-click the folder, type FFmpeg, and press the Enter key.


  1. Image titled Install FFmpeg on Windows Step 8

Click the FFmpeg folder once and press Control+X. This "cuts" the folder from the Downloads folder so you can paste it into the root of your hard drive.


  1. Image titled Install FFmpeg on Windows Step 9

Click This PC in File Explorer. It's the computer icon in the left panel.


  1. Image titled Install FFmpeg on Windows Step 10

Double-click your hard drive. It's usually called "Windows (C:)" or "Local Disk (C:)" but the name and drive letter may vary.


  1. Image titled Install FFmpeg on Windows Step 11

Right-click a blank area of the right panel and select Paste. This moves the folder to the root of your hard drive.


  1. Image titled Install FFmpeg on Windows Step 12

Open the system environment variables control panel. Here's how:

  • Press Windows key + S to open the search bar.
  • Type system variables into the search bar.
  • Click Edit the system environment variables in the search results.
  • Click the Environment variables button in the bottom-right area of the window.

  1. Image titled Install FFmpeg on Windows Step 13

Select the Path variable under "User variables for (your name)" and click Edit. A list of paths will appear.


  1. Image titled Install FFmpeg on Windows Step 14

Add the FFmpeg binary directory to the path. This will allow you to easily run FFmpeg commands at the command prompt without having to type out the full path to FFmpeg. Here's how:

  • Click the New button to open a new blank line below the bottom-most path.
  • Type C:\ffmpeg\bin. Or, if you placed the FFmpeg folder on a different drive or in a different folder, replace this path with that location instead (remember to leave \bin at the end).
  • Click OK. Now you'll see the FFmpeg path and the end of the "Path" variable in the upper portion of the window.

  1. Image titled Install FFmpeg on Windows Step 15

Click OK to save your changes. You've now installed FFmpeg and set the proper environment variables. To confirm that FFmpeg is working, open the command prompt and run this command to see the version number:

ffmpeg -version