Page MenuHomePhabricator

Quality degrading while editing videos
Open, HighPublic

Description

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 while removing the audio from the video.

Code needs to be changed some where here: https://github.com/wikimedia/labs-tools-video-cut-tool-worker/blob/master/utils.js

More info about the tool information and link's to repositories : https://phabricator.wikimedia.org/project/profile/4054/

Event Timeline

I guess currently we are using ffmpeg -i input.mp4 -an output.mp4by adding -c copy parameters we can copy the frames instead of going through a decode->filter->encode process.

So changing to ffmpeg -i input.mp4 -c copy -an output.mp4 will solve the quality loss issue? hopefully.

Change 643759 had a related patch set uploaded (by Diwanshu885; owner: Diwanshu885):
[labs/tools/video-cut-tool-worker@master] Add "-c" & "copy" parameters to solve the quality loss issue

https://gerrit.wikimedia.org/r/643759

Change 643759 merged by Gopavasanth:
[labs/tools/video-cut-tool-worker@master] Add "-c" & "copy" parameters to solve the quality loss issue

https://gerrit.wikimedia.org/r/643759

I don't want to re-open task this but take a look at this output, 180 rotation of Ping!-RKW6rjnYEkc.webm from commons. IMO, the issue is not resolved yet. I've rotated videos by 180 using solutions at https://stackoverflow.com/questions/3937387/rotating-videos-with-ffmpeg on my computer and the results don't appear to have any significant quality loss issues at all.

Gopavasanth removed Diwanshu885 as the assignee of this task.
Gopavasanth added a subscriber: Diwanshu885.

I don't want to re-open task this but take a look at this output, 180 rotation of Ping!-RKW6rjnYEkc.webm from commons. IMO, the issue is not resolved yet. I've rotated videos by 180 using solutions at https://stackoverflow.com/questions/3937387/rotating-videos-with-ffmpeg on my computer and the results don't appear to have any significant quality loss issues at all.

Thanks @Eatcha! lets open this task for the further updates then :)

Gopavasanth renamed this task from Quality degrading while removal audio from video to Quality degrading while editing videos.Mar 14 2021, 7:31 AM

I spent an hour now (tested locally) and played around with the videos and ffmpeg, I couldn't find any quality loss with the commands which we used in our tool. @Bharatkhatri351, @Sandyabhi, @SarthakKundra, or @Khr2003 any insights?

@Gopavasanth I just tried it on local machine and did not see any quality loss.