In any case it is very stupid to decode something encoded with lossy codec and encode it again with the same lossy codec, also compare how much CPU cycles takes unnecessary transcoding
vs. simple extracting on for example 2 hour video.