[FFmpeg-devel] [PATCH] Add example transcoding.c

Nicolas George george at nsup.org
Tue Feb 18 10:02:59 CET 2014


Le decadi 30 pluviôse, an CCXXII, Andrey Utkin a écrit :
> Besides comments, _testing_ is appreciated.
> I have tested it under valgrind with file with mpeg4 video and mp2 audio,
> generated with:
> ffmpeg  -f lavfi -i testsrc  -f lavfi -i aevalsrc=0 -map 0 -map 1 -vcodec mpeg4 -acodec mp2 -f mpegts ~/testmp4_long.ts -y
> With this file it works without leaks, except for 
> ==20556== 40 bytes in 1 blocks are still reachable in loss record 1 of 1
> ==20556==    at 0x4C2A018: memalign (vg_replace_malloc.c:727)
> ==20556==    by 0x4C2A0A7: posix_memalign (vg_replace_malloc.c:876)
> ==20556==    by 0xCE7A29: av_malloc (mem.c:94)
> ==20556==    by 0xA294F9: default_lockmgr_cb (utils.c:78)
> ==20556==    by 0xA3007B: ff_lock_avcodec (utils.c:3292)
> ==20556==    by 0xA30288: avcodec_open2 (utils.c:1190)
> ==20556==    by 0x5C59B1: avformat_find_stream_info (utils.c:2989)
> ==20556==    by 0x465533: main (transcoding.c:62)
> 
> anybody knows is this curable?

What would need to be cured?

> Haven't tried with subtitles yet.
> This example doesn't work with h264 reencoding, because i libx264 refuses
> to work because of "broken settings". I gave up investigating what is
> wrong with that. Apparently this has something to do with
> avcodec_copy_context() (which i used to init encoders' avctxs, too),
> because libx264 behaves well if you manually setup all AVCodecContext
> fields from scratch.

Then you probably should not be using avcodec_copy_context() at all.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140218/9761c3e0/attachment.asc>


More information about the ffmpeg-devel mailing list