Mpv: MPV won't play gif from a URL

Created on 23 Jun 2020  路  10Comments  路  Source: mpv-player/mpv

MPV version:

mpv 0.32.0 Copyright 漏 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.31.100
   libavcodec      58.54.100
   libavformat     58.29.100
   libswscale      5.5.100
   libavfilter     7.57.100
   libswresample   3.5.100
ffmpeg version: n4.2.3

Linux Distribution and Version:

Manjaro Linux, Kernel 5.6.16-1-MANJARO

mpv binary is from the arch community repo

Reproduction steps:

I just try to run

mpv --no-config "https://radar.weather.gov/lite/NTP/BOX_loop.gif"

Expected behavior:

I expect mpv to play this gif

Actual behavior

I get the following error messages

[ffmpeg] Cannot seek backward in linear streams!
[lavf] avformat_open_input() failed
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
[ffmpeg] Cannot seek backward in linear streams!
 (+) Video --vid=1 (gif 1.000fps)
[ffmpeg] Cannot seek backward in linear streams!

Log file

output.txt

I did my best to follow the template, if I missed something, I apologize.

linux

Most helpful comment

It works with e.-g. --stream-buffer-size=2m

This fixed it for me, thanks.

All 10 comments

I am having the exact same issue.
I try to run
mpv --no-osc --loop-file=inf https://radar.weather.gov/lite/N0R/LOT_loop.gif
and I get

[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s

repeated a bunch of times.

MPV version:

mpv 0.32.0 Copyright 漏 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.31.100
   libavcodec      58.54.100
   libavformat     58.29.100
   libswscale      5.5.100
   libavfilter     7.57.100
   libswresample   3.5.100
ffmpeg version: 4.2.2-1ubuntu1

Ubuntu 20.04 LTS
Linux kernel 5.4.0-37-generic

This worked just fine a few days ago, I didn't even update or change anything about my system. Just today, it gives me this error.

I am having the exact same issue.
I try to run
mpv --no-osc --loop-file=inf https://radar.weather.gov/lite/N0R/LOT_loop.gif
and I get

[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s
[ffmpeg] Cannot seek backward in linear streams!
V: 00:00:00 / 00:00:01 (0%) Cache: 0.0s

repeated a bunch of times.

MPV version:

mpv 0.32.0 Copyright 漏 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.31.100
   libavcodec      58.54.100
   libavformat     58.29.100
   libswscale      5.5.100
   libavfilter     7.57.100
   libswresample   3.5.100
ffmpeg version: 4.2.2-1ubuntu1

Ubuntu 20.04 LTS
Linux kernel 5.4.0-37-generic

This worked just fine a few days ago, I didn't even update or change anything about my system. Just today, it gives me this error.

Hello. Just tried this again; it seems to have fixed itself(?). Can you please try again when you get the chance?

I want to add to my reply above: The issue persists on suckless terminal and kitty. Works fine on Yakuake and Konsole.

What terminal you're using has no influence. What I'm suspecting is happening here is that the webserver's refusal to return a content-length header is making ffmpeg behave in a way that mpv isn't expecting.

Interestingly, forcing the format to gif with --demuxer-lavf-format=gif makes it fail, whereas forcing it to a format it actually does not recognise e.g. with --demuxer-lavf-format=penis successfully plays back the GIF.

@CounterPillow is right, the issue persists across all terminal emulators, when I try again. I am not sure why it was working on yakuake a few hours ago, but I agree, the emulator shouldn't make a difference...

I tried again it with --demuxer-lavf-format=penis and it opened the file but could not play back the gif. Next, I tried it with --demuxer-lavf-format=gif and it worked as expected (for now).
EDIT: sorry, I spoke too soon, still fails with --demuxer-lavf-format=gif

Hello. Just tried this again; it seems to have fixed itself(?). Can you please try again when you get the chance?

I tried again, I'm getting the same issue; still doesn't work for me.

This seems to fail because the ffmpeg gif demuxer wants to seek back to the start, but the http server does not support range requests (so ffmpeg's http code reports it as non-seekable). It works with e.-g. --stream-buffer-size=2m.

It works with e.-g. --stream-buffer-size=2m

This fixed it for me, thanks.

It works with e.-g. --stream-buffer-size=2m

This fixed it for me too. I still don't understand why it worked with Yakuake, but I guess I that'll just be a mystery.
Thank you @nswerhun. Closing the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

532910 picture 532910  路  3Comments

xanadupark picture xanadupark  路  3Comments

ww7 picture ww7  路  3Comments

lightonflux picture lightonflux  路  4Comments

paper9oll picture paper9oll  路  3Comments