[MPlayer-users] Re: -ss switch broken in current 3-pass-mode of mencoder

Josef Wolf jw at raven.inka.de
Fri Sep 13 01:08:01 CEST 2002


Hello!

>> I have no idea what the exact problem is, but the problem disappears
> i have. decoded_frames is counted from zero, even if you used -ss.
> but the numbers in frameno.avi won't start at 0 if you used -ss.
> 
>> when I remove line 845 of mencoder.c which contains:
>> 
>>     if(demuxer2) demux_seek(demuxer2, d, 1);
>> 
>> Any comments?
> 
> test this patch, please:

Thanks for the quick response!

> Index: mencoder.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/mencoder.c,v
> retrieving revision 1.158
> diff -u -r1.158 mencoder.c
> --- mencoder.c  10 Sep 2002 23:19:20 -0000      1.158
> +++ mencoder.c  11 Sep 2002 23:18:06 -0000
> @@ -978,7 +978,10 @@
>             int len=ds_get_packet(demuxer2->video,(unsigned char**) &start);
>             if(len<0){ at_eof=1;break;}
>             if(len==0) --skip_flag; else  // duplicate
> -           if(len==4) next_frameno=start[0];
> +           if(len==4){
> +               if(next_frameno<0) decoded_frameno+=start[0];
> +               next_frameno=start[0];
> +           }
>         }
>      if(at_eof) break;
>         // if(skip_flag) printf("!!!!!!!!!!!!\n");

Hmmm, shouldn't this change be applied on line 993, too?


With this patch the second and third passes succeed _if_ the first
pass succeed. But whether the first pass succeed depends on the values
given to the -ss and the -endpos parameters.
For example:
  "mencoder -other_options_snipped -ss 1:48 -endpos 3:00" fails
  "mencoder -other_options_snipped -ss 1:48 -endpos 4:00" succeed

Here is the diff of the output from the first pass with the -v option.
I have snipped away everything irrelevant:

163,166c199,207
< 
< Video stream:    0.800 kbit/s  (100 bps)  size: 7196 bytes  71.960 secs  1800 frames
<
< Audio stream:  128.000 kbit/s  (15999 bps)  size: 1158912 bytes  72.432 secs
---
> Recommended video bitrate for 650MB CD: 41177
> Recommended video bitrate for 700MB CD: 44356
> Recommended video bitrate for 800MB CD: 50713
>
> Video stream:    0.800 kbit/s  (99 bps)  size: 13196 bytes  131.960 secs  3300 frames
>
> Audio stream:  128.000 kbit/s  (16000 bps)  size: 2118912 bytes  132.432 secs


Note that the vbitrate recommendations are missing when first pass
fails. Next come the diff of the second pass with the -v option.
Again, I snipped away irrelevant output. Note the difference in a.skip
and the "EOF reached". The line between "a.skip" and "EOF" is
identical, but might be of interest, so I included it into the diff by
hand.

387,388c427,428
< SEEK: i=4782 (max:4816) dpos=1150464 (wanted:1150719)
< SEEK: idx=4782  (a:4782 v:4816)  v.skip=12  a.skip=255/0.000
< XXX initial  v_pts=0.000  a_pos=8064 (0.504)
< ds_fill_buffer: EOF reached (stream: audio)
< ds_fill_buffer: EOF reached (stream: audio)
< ds_fill_buffer: EOF reached (stream: video)
< DEMUXER: freeing demuxer at 0x83c5ff0
---
> SEEK: i=6660 (max:6693) dpos=1601280 (wanted:1601280)
> SEEK: idx=6660  (a:6660 v:6693)  v.skip=12  a.skip=0/0.000
> XXX initial  v_pts=0.000  a_pos=8064 (0.504)
> *** [crop] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
> *** [crop] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytesms 0/5 D/B/S 0/1/0
> *** [scale] Exporting mp_image_t, 704x574x12bpp YUV planar, 606144 bytes
> *** [lavc] Allocating mp_image_t, 720x400x12bpp YUV planar, 432000 bytes
> *** [expand] Direct Rendering mp_image_t, 720x400x12bpp YUV planar, 432000 bytes
> *** [crop] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytesms 0/20 D/B/S 0/1/0
> ==> Found subtitle: 0 2%) 119fps Trem:  16min 559mb  A-V:0.000 [4244:128] A/Vms 0/37 D/B/S 0/1/0
> ==> Found subtitle: 1
> ds_fill_buffer: EOF reached (stream: audio)   636mb  A-V:0.000 [4377:128] A/Vms 0/38 D/B/S 0/1/0
> ds_fill_buffer: EOF reached (stream: video)   641mb  A-V:0.000 [4389:127] A/Vms 0/38 D/B/S 0/1/0
> DEMUXER: freeing demuxer at 0x83a05c0   19min 642mb  A-V:0.000 [4391:127] A/Vms 0/38 D/B/S 0/1/0
395,396c442,443
< DEMUXER: freeing sh_audio at 0x83e5050
< DEMUXER: freeing sh_audio at 0x83e4fb8
---
> DEMUXER: freeing sh_audio at 0x83bf618
> DEMUXER: freeing sh_audio at 0x83bf580
401c448
< Video stream:      nan kbit/s  (-2147483648 bps)  size: 0 bytes  0.000 secs  1801 frames
---
> Video stream: 4391.211 kbit/s  (548901 bps)  size: 17455066 bytes  31.800 secs  3300 frames
403c450
< Audio stream:  128.000 kbit/s  (16000 bps)  size: 6528 bytes  0.408 secs
---
> Audio stream:  128.000 kbit/s  (15999 bps)  size: 516480 bytes  32.280 secs

-- 
-- Josef Wolf -- jw at raven.inka.de --




More information about the MPlayer-users mailing list