Captura icon indicating copy to clipboard operation
Captura copied to clipboard

Trim tool FFmpeg error on Windows (Unknown decoder 'copy')

Open HDPLocust opened this issue 5 years ago • 3 comments

I found a bug in order of args in trim tool:

ARGS:
-------------
-ss 00:00:00.0000000 -to 00:01:00.0000000 -acodec copy -i "C:\rec.webm"  "C:\trimmed_rec.webm"

OUTPUT:
-------------
ffmpeg version N-93880-gc3458f06f4 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.3.1 (GCC) 20190414
... bla-bla
Unknown decoder 'copy'

By little bit of googling, I found the solution lists.ffmpeg.org/why_this_ffmpeg_shell_command_is_wrong:

So, this is okay:
ffmpeg -i input -c:v copy output
This is not okay:
ffmpeg -c:v copy -i input output

So it's true, direct command like this works fine: ffmpeg -i "C:\rec.webm" -ss 00:00:00.0000000 -to 00:01:00.0000000 -acodec copy "C:\trimmed_rec.webm"

Desktop:

  • OS: Windows 10 x64 v1803
  • RAM: 8GB
  • CPU: i5 2.6GHz
  • Graphic Card: GTX760 2GB

HDPLocust avatar May 18 '19 04:05 HDPLocust

Also you can add -vcodec copy to keep quality.

HDPLocust avatar May 18 '19 15:05 HDPLocust

I can confirm that the Unknown decoder 'copy' error is happening.

But, the trimming is not precise if -vcodec copy and -acodec copy are used. For e.g. when trimming from 10s to 15s, I got 12s to 15s for a 30 fps 51s video.

But, if I don't use them, quality changes. I currently don't know a perfect way for trimming videos using FFmpeg. The answers on stackoverflow.com are also pretty old.

I would really like help with this.

MathewSachin avatar May 18 '19 18:05 MathewSachin

ffmpeg -ss 00:00:07.2630000 -to 00:00:31 -i input.mp4 -c copy output.mp4 works for me in console only. the trim tools not work, maybe the verison of ffmpeg cause the exception.

lomatus avatar Apr 23 '20 04:04 lomatus