[FFmpeg-user] Reducing seek time when start time offset (-ss) is large
CMiller86 at gmail.com
Sat Aug 11 03:06:05 CEST 2012
Your solution to have a seek time before and after encoding is exactly what
I was looking for. It also very similar to the functionality Robert added
to ffmbc. When I tried to use your example and have a 0 start after
encoding, my clips audio and video were out of sync though. This was easily
fixed by having the pre-encoding seek 5 seconds before the start of my clip
and having the post-encoding seek start at 00:00:05. It looks like it's
working great and it's so much faster.
On Fri, Aug 10, 2012 at 6:27 PM, Nicolas George <
nicolas.george at normalesup.org> wrote:
> Le quartidi 24 thermidor, an CCXX, Robert Krüger a écrit :
> > I suggested this:
> > on the ffmbc list for the exact same problem (if I understand your
> > posting correctly). Not a pretty solution but for use cases like yours
> > (and mine) it does the job. I was going to make a patch against ffmpeg
> > before posting this here but have not had time yet to do it but I'll
> > try to do that in the next few days. I hope this is at least going to
> > get a discussion about this started because I think this may be a
> > practical problem many people have.
> Let me recap, and correct me if I am wrong:
> -ss before -i uses seeking, and is inaccurate since it seeks only to
> keyframes; -ss after -i uses skipping and is very slow, you want a new
> option that does most of the work by seeking and then skips from the last
> keyframe until the target time.
> I do not think it is necessary.
> The thing is -ss seeks with the "backwards" flag: if there is no keyframe
> exactly at the requested time, it will look for a keyframe before it, not
> after. On the other hand, the timestamps are adjusted according to the
> target time, not the found keyframe, which means that timestamps will
> usually begin slightly negative.
> Which leads to a solution:
> ffmpeg -ss time -i file -ss 0 output
> A few tests I ran some days ago shows it is not exactly equivalent to
> "ffmpeg -i file -ss time output", but only up to one or two frames. I must
> run some more test to find out why exactly.
> Nicolas George
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> -----END PGP SIGNATURE-----
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
More information about the ffmpeg-user