[Ffmpeg-devel] me_threshold?

Luca Abeni lucabe72
Wed Sep 28 12:13:36 CEST 2005


how can I set the motion estimation threshold?
If I try to use me_threshold I get a segfault:

luca at host3:~/src/ffmpeg$ gdb ffmpeg_g
GNU gdb 6.1.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-slackware-linux"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) r -y -me_threshold 100000 -s 352x288 blah.mpg
Starting program: /home/luca/src/ffmpeg/ffmpeg_g -y -me_threshold 100000 -s 352x288 blah.mpg
ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --enable-mp3lame 
  built on Sep 28 2005 01:25:45, gcc: 3.3.4
Input #0, video4linux, from '':
  Duration: N/A, bitrate: N/A
  Stream #0.0, 25.00 fps: Video: rawvideo, yuv420p, 352x288
Input #1, audio_device, from '':
  Duration: N/A, bitrate: N/A
  Stream #1.0: Audio: pcm_s16le, 44101 Hz, mono, 705 kb/s
Output #0, mpeg, to 'blah.mpg':
  Stream #0.0,   nan fps: Video: mpeg1video, yuv420p, 352x288, q=2-31, 200 kb/s
  Stream #0.1: Audio: mp2, 44100 Hz, mono, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #1.0 -> #0.1
Press [q] to stop encoding
[mpeg1video @ 0x8374890]AVFrame.motion_val not set!
[mpeg1video @ 0x8374890]AVFrame.mb_type not set!
[mpeg1video @ 0x8374890]AVFrame.ref_index not set!
[mpeg1video @ 0x8374890]AVFrame.motion_subsample_log2 doesn't match! (0!=3)

Program received signal SIGSEGV, Segmentation fault.
0x080c5745 in copy_picture_attributes (s=0x83e6e90, dst=0x83fcad0, src=0xbfffebe0) at mpegvideo.c:318
318             memcpy(dst->mb_type, src->mb_type, s->mb_stride * s->mb_height * sizeof(dst->mb_type[0]));
(gdb) bt
#0  0x080c5745 in copy_picture_attributes (s=0x83e6e90, dst=0x83fcad0, src=0xbfffebe0) at mpegvideo.c:318
#1  0x080b944c in load_input_picture (s=0x83e6e90, pic_arg=0xbfffebe0) at mpegvideo.c:2097
#2  0x080b2bda in MPV_encode_picture (avctx=0x83d2230, buf=0x40a99020 "", buf_size=405504, data=0xbfffebe0)
    at mpegvideo.c:2327
#3  0x080ad372 in avcodec_encode_video (avctx=0x83d2230, buf=0x40a99020 "", buf_size=405504, pict=0xbfffebe0)
    at utils.c:868
#4  0x0805d57f in do_video_out (s=0x83d11d0, ost=0x83de320, ist=0x83de250, in_picture=0xbffff030, frame_size=0xbfffeefc)
    at ffmpeg.c:956
#5  0x0805b441 in output_packet (ist=0x83de250, ist_index=0, ost_table=0x83d2500, nb_ostreams=2, pkt=0xbffff220)
    at ffmpeg.c:1337
#6  0x0805616f in av_encode (output_files=0x837aca0, nb_output_files=1, input_files=0x837aba0, nb_input_files=2, 
    stream_maps=0x837ad00, nb_stream_maps=0) at ffmpeg.c:2055
#7  0x08054fda in main (argc=0, argv=0xbffff7f4) at ffmpeg.c:4254
(gdb) disass $pc-32 $pc+32
Dump of assembler code from 0x80c5725 to 0x80c5765:
0x080c5725 <copy_picture_attributes+181>:       mov    0x8(%ebp),%edi
0x080c5728 <copy_picture_attributes+184>:       mov    0x8c(%edi),%ecx
0x080c572e <copy_picture_attributes+190>:       imul   0x90(%edi),%ecx
0x080c5735 <copy_picture_attributes+197>:       mov    0xc(%ebp),%eax
0x080c5738 <copy_picture_attributes+200>:       shl    $0x2,%ecx
0x080c573b <copy_picture_attributes+203>:       mov    0x68(%eax),%edi
0x080c573e <copy_picture_attributes+206>:       mov    0x68(%ebx),%esi
0x080c5741 <copy_picture_attributes+209>:       cld    
0x080c5742 <copy_picture_attributes+210>:       shr    $0x2,%ecx
0x080c5745 <copy_picture_attributes+213>:       repz movsl %ds:(%esi),%es:(%edi)
0x080c5747 <copy_picture_attributes+215>:       xor    %esi,%esi
0x080c5749 <copy_picture_attributes+217>:       mov    0x8(%ebp),%edx
0x080c574c <copy_picture_attributes+220>:       mov    0x8(%ebp),%edi
0x080c574f <copy_picture_attributes+223>:       mov    0x88(%edx),%eax
0x080c5755 <copy_picture_attributes+229>:       mov    0x8c(%edi),%edx
0x080c575b <copy_picture_attributes+235>:       shl    $0x4,%eax
0x080c575e <copy_picture_attributes+238>:       xor    %ecx,%ecx
0x080c5760 <copy_picture_attributes+240>:       shl    $0x4,%edx
0x080c5763 <copy_picture_attributes+243>:       mov    0x6c(%ebx),%cl
End of assembler dump.

In the example I used mpeg1video, but it happens also with mpeg4.

Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !

More information about the ffmpeg-devel mailing list