[MPlayer-users] Precise seeking / video cutting

Sam Wong sam at hellosam.net
Tue Apr 10 14:47:14 CEST 2007


The Wanderer wrote:

> Sam Wong wrote:
>
>> On 4/10/07, Sam Wong <sam at hellosam.net> wrote:
>>
>>> On 4/10/07, Saurabh Singhvi <saurabhsinghvi at gmail.com> wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> IIRC, there is an option (you'll have to do man mplayer) which
>>>> allows for exact frame usage. I think if you search for exact in
>>>> the man page, you should probably find it.
>>>>
>>>> sorry that I don't remember the exact option.
>>>
>>>
>>> Do you mean -idx (or -forceidx)? I tried both but no luck.  More
>>> input is welcome and very apperciated.
>>>
>> Sorry I have mistaken -hr-edl-seek. I didn't feed the mencoder the
>> EDL at all LOL. Sorry about that.
>>
>> But with -hr-edl-seek, all it does is to decoding from the very
>> beginning (just like 'transcode -x mplayer') which is very slow. It
>> would be great if the encoding is started from the previous I-Frame
>> instead. Was there such a feature? If not, may be I should turn to
>> the dev list to see if it's too hard to add...
>
>
> Unless I'm very much mistaken, there is no such feature.
>
> It would indeed be very nice, since it would allow seeking to any frame
> for *any* purpose (not just for transcoding).
>
> Unfortunately, although the basic technique is fairly simple, it does
> not appear remotely easy to implement. (I suggested it years ago, and
> tried it myself once; I know something whereof I speak...)
>
oh. After an intensive google work...I found that this question has been 
asked for at least more than five years...=(

I would like to know if the current implement will seek to the next 
keyframe (always in the future relative to the specified -ss time), or 
previous keyframe (in the past of the specified time), or the nearest 
keyframe?

And if it's possible to get the exact timestamp of where the it has been 
actually seeked to? If so...
Then I could at least write a script to get the job done:
0. let TRY_SS = MY_SS (The start time setting that I would like to use)
1. mencode -ss TRY_SS -frames 1. see where it lands (let the reported 
value as ACTUAL_SS)
2. repeat 1 with smaller TRY_SS if ACTUAL_SS > MY_SS lands at sometime 
in the future. (This step could be skipped if the seek always seek to 
previous keyframe)
3. use -ss TRY_SS, on mencode to transcode the video to some more 
seeking friendly format. Of course I have to enlarge the -endpos by 
(MY_SS-ACTUAL_SS) then.
4. use -ss (MY_SS-ACTUAL_SS) on the newly encoded seeknig-friendly 
video...and transcode to the real destination format.




More information about the MPlayer-users mailing list