[Ffmpeg-user] Re: direct stream copy with ffmpeg

The Wanderer inverseparadox at comcast.net
Wed Jun 8 18:22:27 CEST 2005


Venci Vatashki wrote:

>> It certainly should be - and it is equally certainly there in the
>> man page, at least on my end. What version are you using?
> 
> I'm using ffmpeg from cvs two days old :)

And currently I'm using CVS from yesterday evening. At the time I was
using CVS from a few weeks back, but the man page mentions -vcodec copy
in any case.

>> And "direct stream copy" means at least for VirtualDub not the
>> whole stream but no compression/decompression for that stream
>> 
>> I don't know how it would be even possible to modify a compressed
>> stream to produce a known net effect without decompressing that
>> stream - and if you decompress and want to wind up with compressed
>> data, you obviously need to recompress it.
> 
> Let we have a divx avi video.Direct stream copy is divx frame is
> taken from the source video and put in the output file.
> 
> Recompression means to take that divx frame decompress it with divx
> to get the raw bitmap and then use again codec to compress it.This is
> very CPU intensive compared to the first way.And there is loss of
> quality

Yes, I know all of that - although I'm not sure you're right about the
"frame" part, I'm not sure it's possible to reliably obtain a 'frame'
without reference to the codec used.

> I didnt find stream copy in FFmpeg,but in mencoder.
> 
> The syntax is  mencoder movie.avi -oac copy  -ovc copy -endpos 
> 00:01:00 -o preview.avi
> 
> That way I capture only one minute from the movie with the same
> quality.

Yes, I know all of that. This is an exact bit-for-bit copy of the video
and audio streams, demuxed from one AVI and muxed into another. It also
does not change the streams in any way - otherwise it could not be an
exact bit-for-bit copy.

The FFmpeg syntax, according to the man page, would be

ffmpeg -t 00:01:00 -i movie.avi -vcodec copy -acodec copy preview.avi

and I've now tested that and it works just fine on my machine. Are you
*sure* you read the man page?

>> "Direct stream copy", in MPlayer and I believe in FFmpeg, appears
>> to mean "byte-for-byte duplication of the input stream".
> 
> I think that copying is done frame by frame.That way you can crop
> video, but for example resize and etc. you have to do full processing
> to the video

Maybe, potentially, you're right (although I still don't know how it
would be possible, from the technical side), but unless I'm very much
mistaken (in which case someone else would probably have spoken up by
now), neither FFmpeg nor MEncoder does that. By every understanding I've
acquired on the subject since joining the relevant mailing lists Some
Time Back, "copy" to them means "do not modify" - and specifically
"stream copy" means "duplicate the stream without modification" (this
also crops up in things like MPlayer's -dumpstream, for instance).
Therefore, as I said at the beginning, the answer to your question is
"no".

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

A government exists to serve its citizens, not to control them.




More information about the ffmpeg-user mailing list