[FFmpeg-user] Does the fast and accurate seeking work on rtmps streams ( used for resuming download ) ?

Renato Santos renato.cron at gmail.com
Wed Mar 12 13:48:29 CET 2014


try

ffmpeg.exe -y -i "rtmps://xxx:443/vod/xx/mp4:xx/xx.mp4
swfUrl=xx playpath=mp4:xx.mp4" -r <FPS> -force_key_frames
'expr:gte(t,n_forced*<SECONDS OF EACH KEYFRAME>)' -codec:v <I'm using
libx264> -map 0 -profile baseline -level 3.0 -preset fast -pix_fmt yuv420p
 -f segment -segment_time <SECONDS OF VIDEOS> -segment_list
<segment_list_file csv> -reset_timestamps 1 -segment_time_delta 0.05
/usr/tmp/tmp/video%09d.mp4

I'm new too with ffmpeg, but as far as I've learned through the internet, I
think this is true:
-r XX
   is for framerate
-force_key_frames XXX
   is necessary because, if you don't do this, segment may not work
properly, the input is stream, so you don't know when a keyframe will come
and you segment by seconds, so.. you need to re-encode.
-codev:v XXX
is setting the output codec
-map 0
   say you use stream 0, in case there's audio and so
-profile baseline -level 3.0
   H264 options, make the video playable at iphone/old android devices
-preset fast -pix_fmt yuv420p
   H264 options too, but to make the cpu lower (but video size increases)
and convert the color format to yuv420p in case of input is differ that
that.
-f segment
   this is what make output been write into multiples files.
-reset_timestamps 1
   this make each output video have it own time (start at 0 secs)
-segment_time_delta 0.05
   i don't get this option yet, but I don't see difference with or without
it.
   If input fps is too high, and I set segment_tme to 20, sometime I get
videos with 20.5 seconds. I guess it related to this input. For me, it's
fine.





On Wed, Mar 12, 2014 at 12:30 AM, Han Jiang <oglops at gmail.com> wrote:

> thanks ! but i'm not sure what you mean, i'm very new to this. do you mean
> write images out , so according to the frame name, i know exactly where am
> i when download was interrupted ? then re-encode all the images?
>
> currently i'm using
>
> ffmpeg.exe -y -ss 00:29:00 -i "rtmps://xxx:443/vod/xx/mp4:xx/xx.mp4
> swfUrl=xx playpath=mp4:xx.mp4" -ss 00:01:00 -c copy
> /usr/tmp/tmp/xx.part.1.mp4
>
> i was hoping this will give me the exact start time of 00:30:00 using fast
> and accurate seeking,  i used -c copy ( i didn't want re-encoding here )
>
> what is the pros and cons of this versus the method you mentioned ? thanks
> !
>
>
> On Wed, Mar 12, 2014 at 11:08 AM, Renato Santos <renato.cron at gmail.com
> >wrote:
>
> > Can't you use segment output format and do a "never end" recoding process
> > that write a lot of precise duration files?
> >
> > The only thing is,, if you output in (dot)ts you may lose some frames,
> but
> > if you re_encode in something again (and force Keyframes) You can split
> the
> > stream easy
> > On Mar 12, 2014 12:05 AM, "Han Jiang" <oglops at gmail.com> wrote:
> >
> > > hi all i'm downloading some long videos from a rtmps url, it works
> > > perfectly but when network hiccups , download stopped before it
> finishes,
> > > basically i want to check the already downloaded unfinished .mp4 video
> > > length via ffprobe,  then pass -ss to the ffmpeg command line as the
> > > wiki<
> > >
> >
> http://trac.ffmpeg.org/wiki/Seeking%20with%20FFmpeg#Fastandaccurateseeking
> > > >suggested.
> > > save another file, at last concatenate these files.
> > >
> > > the problem is the fast and accurate seeking seems not working . i used
> > the
> > > latest windows static 64bit build from
> > > zeranoe<http://ffmpeg.zeranoe.com/builds/>
> > >
> > > fast seeking seems working : ( download starts immediately , seeking is
> > > indeed "fast")
> > >
> > > ffmpeg -ss 00:30:00 -i "rtmps://xxx option=xxx" out.mp4
> > >
> > >
> > > accurate seeking seems working too: ( download only start after 30min ,
> > > it's slow )
> > >
> > > ffmpeg -i "rtmps://xxx option=xxx" -ss 00:30:00 out.mp4
> > >
> > >
> > >
> > > but the hybrid fast and accurate seeking is not working
> > >
> > > ffmpeg -ss 00:29:00 -i "rtmps://xxx option=xxx" -ss 00:01:00 out.mp4
> > >
> > > This is suggested by the wiki page, but it seems has no effect
> > > (download still starts after 29min or 30min)
> > >
> > > am i missing something ?
> > > _______________________________________________
> > > ffmpeg-user mailing list
> > > ffmpeg-user at ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > >
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>



-- 
Saravá,
Renato CRON
http://www.renatocron.com/blog/
@renato_cron <http://twitter.com/#!/renato_cron>


More information about the ffmpeg-user mailing list