最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ffmpeg unable to get durationbitrate of remote gif - Stack Overflow

programmeradmin2浏览0评论

I'm trying to get the duration of a gif.

The command ffmpeg -i /emote/01F6MZGCNG000255K4X1K7NTHR/4x.gif

gives Duration: N/A, start: 0.000000, bitrate: N/A

However if i download the file and pass it in ffmpeg -i 4x.gif

it gives: Duration: 00:00:07.92, start: 0.000000, bitrate: 1225 kb/s

The issue seems limited only to gifs on 7tv site.

  • It works for other sites. (example: ffmpeg -i .gif).
  • It also works for other encodings of that image (exmaple ffmpeg -i /emote/01F6MZGCNG000255K4X1K7NTHR/4x.avif)

Here is the HTTP response header from 7tv site of that gif:

HTTP/2 200 
content-type: image/gif
content-length: 1213725
x-7tv-cache-hits: 37527
x-7tv-cache: hit
age: 228365
cache-control: public, max-age=604800, s-maxage=86400, immutable
alt-svc: h3=":443"; ma=2592000
x-7tv-cdn-pod: cdn-ssprq
x-7tv-cdn-node: cdn-1
server: SevenTV
vary: origin, access-control-request-method, access-control-request-headers
access-control-allow-origin: *
access-control-expose-headers: *
date: Sun, 16 Feb 2025 20:47:28 GMT

Can someone help me understand? Something spcecific to this site is causing ffmpeg to behave differently?

I'm trying to get the duration of a gif.

The command ffmpeg -i https://cdn.7tv.app/emote/01F6MZGCNG000255K4X1K7NTHR/4x.gif

gives Duration: N/A, start: 0.000000, bitrate: N/A

However if i download the file and pass it in ffmpeg -i 4x.gif

it gives: Duration: 00:00:07.92, start: 0.000000, bitrate: 1225 kb/s

The issue seems limited only to gifs on 7tv site.

  • It works for other sites. (example: ffmpeg -i https://c.tenor/ULCY5B996-oAAAAd/tenor.gif).
  • It also works for other encodings of that image (exmaple ffmpeg -i https://cdn.7tv.app/emote/01F6MZGCNG000255K4X1K7NTHR/4x.avif)

Here is the HTTP response header from 7tv site of that gif:

HTTP/2 200 
content-type: image/gif
content-length: 1213725
x-7tv-cache-hits: 37527
x-7tv-cache: hit
age: 228365
cache-control: public, max-age=604800, s-maxage=86400, immutable
alt-svc: h3=":443"; ma=2592000
x-7tv-cdn-pod: cdn-ssprq
x-7tv-cdn-node: cdn-1
server: SevenTV
vary: origin, access-control-request-method, access-control-request-headers
access-control-allow-origin: *
access-control-expose-headers: *
date: Sun, 16 Feb 2025 20:47:28 GMT

Can someone help me understand? Something spcecific to this site is causing ffmpeg to behave differently?

Share Improve this question asked Feb 16 at 21:06 Peter XiaPeter Xia 112 bronze badges New contributor Peter Xia is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 0

Looks like a seek failed with the GIF on the 7tv site.

Allowing ffmpeg to cache the file will get you the duration.

ffmpeg -i cache:https://cdn.7tv.app/emote/01F6MZGCNG000255K4X1K7NTHR/4x.gif

发布评论

评论列表(0)

  1. 暂无评论