Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

will we cache the "ffmpeg.LoadAVContext" metadata to reduce the seek option's time cost? #73

Open
t00350320 opened this issue Sep 1, 2023 · 1 comment

Comments

@t00350320
Copy link

hi,
we tested a mp4 seek with a remote url , here is the time cost

func (p *Processor) Process
##000test,Process,time 1693557521532
##001test,Process,time 1693557521534
av, err := ffmpeg.LoadAVContext(rs, size)
##002test,Process,LoadAVContext time 1693557524155
meta := av.Metadata()
##002test,Process,Metadata time 1693557524156
case "seek":
##003test,Process,seek time 1693557524440
##003test,Process,out time 1693557524453

so, we find the LoadAVContext cost =1693557524155 - 1693557521534 = 2621ms / total 2921ms
will we cache the LoadAVContext data in process for next seek request?
thank you very much!!!

@t00350320
Copy link
Author

by the way,
a seek request "http://localhost:8000/unsafe/filters:frame(1m)/http://$url/mps-test-south2-input/16-test.mp4" will download the full mp4 file?
the package captured info here,

GET /mps-test-south2-input/16-test.mp4 HTTP/1.1
Host: xxx
User-Agent: imagor/1.4.7
Accept: */*
Accept-Encoding: gzip

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 04 Sep 2023 06:38:42 GMT
Content-Type: application/octet-stream
Content-Length: 11734872
Connection: keep-alive
Accept-Ranges: bytes
Content-Transfer-Encoding: binary
ETag: "xxx"
Last-Modified: Wed, 07 Jun 2023 07:07:57 GMT
Vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers


... ftypisom....isomiso2avc1mp41....free....mdat..........E....H..,. .#..x264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00......e...o.....K.".\j.)7..z.x.zE......].0.......	[email protected].].<..j.P"....oI#[....|.|.a.3....
jG.^....j.$g.D-W..A...u...L..:Y..7oU).....Up....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant