Opened 4 years ago

Closed 4 years ago

#4750 closed defect (worksforme)

ffplay (ffmpeg) MJpeg Stream silently stops streaming

Reported by: chrisjenx Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: mjpeg
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When streaming some Mjpeg sources ffmpeg (ffplay) may read an EOF as end of stream, when actually it's just the end of a frame.

When playing a stream in ffplay, it will play for some time (a minute or so) then the video will stop but ffplay goes on even though the video has stopped.

How to reproduce:

Run the following command, it will play the stream.

fplay -f mjpeg -i http://204.239.12.142/mjpg/video.mjpg
ffplay version 2.7.1 Copyright (c) 2003-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-ffplay --enable-vda
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mjpeg, from 'http://204.239.12.142/mjpg/video.mjpg':0/0
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 480x360, 25 tbr, 1200k tbn, 25 tbc

After ~150 seconds, ffplay will continue, but the video output will stop.

I can reproduce it with the above stream every time.

Change History (3)

comment:1 Changed 4 years ago by cehoyos

  • Component changed from ffplay to undetermined
  • Version changed from 2.7 to unspecified

Please test current FFmpeg git head except if you want to report a regression.

I ran several tests and the connection always stopped after exactly five minutes (with different applications). Is there an application that plays this stream for longer than five minutes?

comment:2 follow-up: Changed 4 years ago by chrisjenx

Ran against the latest git head. VLC does stop too. But that closes the video as the stream closes.

ffplay seems to continue counting in the console (like there is an output), but the video just remains on the last frame.

I guess on the last frame it should close the output and terminate?

ffplay -f mjpeg -i http://204.239.12.142/mjpg/video.mjpg
ffplay version git-2015-08-02-0508657 Copyright (c) 2003-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --enable-opencl --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-ffplay --enable-vda
  libavutil      54. 30.100 / 54. 30.100
  libavcodec     56. 56.101 / 56. 56.101
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 32.100 /  5. 32.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mjpeg, from 'http://204.239.12.142/mjpg/video.mjpg':0/0
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 480x360, 25 tbr, 1200k tbn, 25 tbc
[swscaler @ 0x7fe58a826200] deprecated pixel format used, make sure you did set range correctly

comment:3 in reply to: ↑ 2 Changed 4 years ago by cehoyos

  • Resolution set to worksforme
  • Status changed from new to closed

Replying to chrisjenx:

I guess on the last frame it should close the output and terminate?

No, but you can use -autoexit if you need this behaviour.

ffplay -f mjpeg -i http://204.239.12.142/mjpg/video.mjpg

Note that -f mjpeg is not necessary.

Note: See TracTickets for help on using tickets.