User feedback on the commons talk page:
https://commons.wikimedia.org/wiki/Commons_talk:VideoCutTool#Quality_degradation_-_Removal_audio
If you compare the current version with the oldest version of File:BORDEAUX CORONAVIRUS - 24H AVANT LE CONFINEMENT.webm at https://commons.wikimedia.org/wiki/File:BORDEAUX_CORONAVIRUS_-_24H_AVANT_LE_CONFINEMENT.webm#filehistory , there is a significant difference in quality of the video. Higher Compression factor ? or is there an error on my side. -- Eatcha (talk) 07:22, 30 March 2020 (UTC)
I think we could solve this by changing some params in ffmpeg.
Currently these are the ffmpeg commands that are being used in the tool.
Downloading video to the server:
ffmpeg -y -i <url> -vcodec copy -acodec copy videoDownloadPath
Trimming video:
ffmpeg -i <URL> -ss <FROM_TIME> -to <TO_TIME> -async 1 - strict 2 <outputfile>
Removing audio from video:
ffmpeg <videoURL> -an <outputvideo>
If video is not Commons supported video format, converting video format using
ffmpeg -i <VIDEO_URL> -c:v libvpx-vp9 -crf 30 -b:v 0 -b:a 128k -c:a libopus <outputfile>
Cropping video:
ffmpeg -i <videourl> -filter:v crop=${width / 100}*in_w:${height / 100}*in_h:${x / 100}*in_w:${y / 100}*in_h <outputvideo>
Please try to analyse the videos playing with these commands and share your thoughts here so we can modify the commands that are leading to the quality loss. For more info, most of the this code is in: https://github.com/gopavasanth/video-cut-tool/blob/master/server/utils.js