[FFmpeg-devel] ffmpeg.c uses large low-level code instead of avcodec_copy_context() etc. to init copied stream

Andrey Utkin andrey.krieger.utkin at gmail.com
Sun Jan 26 15:42:55 CET 2014


Hi.
While making some remuxing code, i have checked how ffmpeg CLI util
does it. It figured out that instead of simply copying properties by
API call avcodec_copy_context() which is featured in
doc/examples/remuxing.c, it goes long way of copying properties
manually (see transcode_init(), line 2296 in ffmpeg.c), besides
handling some special cases - AVI container, variable FPS, etc.
A link to this place in code:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=ffmpeg.c;h=aacf938c56c3c22ee6985e1979eecd8489a905c0;hb=HEAD#l2296

Should the mentioned code in ffmpeg.c be replaced with avcodec_copy_context()?


OFFTOP: Also i've noticed that in ffmpeg_opt.c, there are such places

if (!ost->stream_copy) {  // line 1264
...
} else {
...
}

if (ost->stream_copy) {
...
}

Another place:

if (!ost->stream_copy) {  // line 1398
...
}

if (ost->stream_copy) {
...
}

I think these blocks should be merged. If nobody claims to do such
patch, i'll prepare it by myself.

-- 
Andrey Utkin


More information about the ffmpeg-devel mailing list