Opened 4 years ago

Closed 4 years ago

#1402 closed defect (fixed)

ffplay: doesn't work on a tty console

Reported by: u ltd. Owned by: cus
Priority: normal Component: ffplay
Version: git-master Keywords: tty
Cc: cus@passwd.hu Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

How to reproduce

Invoke ffplay from non-graphical console (e.g., tty3 with empty DISPLAY environment variable)

% ffplay file.mp3
% ffplay http://url.com/file.mp3
% ffplay -nodisp file.mp3
% ffplay -nodisp http://url.com/file.mp3

What happens:

ffplay version N-40844-g0e82d31 Copyright (c) 2003-2012 the FFmpeg developers
  built on Jun  3 2012 13:43:28 with gcc 4.6.2
  configuration: --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --shlibdir=/usr/lib64 --disable-stripping --enable-pthreads --disable-shared --enable-avfilter --enable-static --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-nonfree --enable-postproc --enable-shared --enable-libdc1394 --enable-libtheora --enable-libschroedinger --enable-libvpx --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-x11grab --enable-ffplay --disable-outdev=sdl
  libavutil      51. 53.100 / 51. 53.100
  libavcodec     54. 21.101 / 54. 21.101
  libavformat    54.  5.100 / 54.  5.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 74.102 /  2. 74.102
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 12.100 /  0. 12.100
  libpostproc    52.  0.100 / 52.  0.100
Could not initialize SDL - Unable to open mouse
(Did you set the DISPLAY variable?)

What I would have expected of ffplay:
Playing file.mp3.


Additional information

% ffplay -version
ffplay version N-40844-g0e82d31
built on May 19 2012 15:26:37 with gcc 4.6.2
configuration: --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --shlibdir=/usr/lib64 --disable-stripping --enable-pthreads --disable-shared --enable-avfilter --enable-static --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-nonfree --enable-postproc --enable-shared --enable-libdc1394 --enable-libtheora --enable-libschroedinger --enable-libvpx --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-x11grab --enable-ffplay
libavutil      51. 53.100 / 51. 53.100
libavcodec     54. 21.101 / 54. 21.101
libavformat    54.  5.100 / 54.  5.100
libavdevice    53.  4.100 / 53.  4.100
libavfilter     2. 74.102 /  2. 74.102
libswscale      2.  1.100 /  2.  1.100
libswresample   0. 12.100 /  0. 12.100
libpostproc    52.  0.100 / 52.  0.100

Another version (same bug):

% ffplay -version
ffplay version 0.11
built on Jun  3 2012 15:12:12 with gcc 4.6.2
configuration: --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --shlibdir=/usr/lib64 --disable-stripping --enable-pthreads --disable-shared --enable-avfilter --enable-static --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-nonfree --enable-postproc --enable-shared --enable-libdc1394 --enable-libtheora --enable-libschroedinger --enable-libvpx --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-x11grab --enable-ffplay --disable-outdev=sdl
libavutil      51. 54.100 / 51. 53.100
libavcodec     54. 23.100 / 54. 21.101
libavformat    54.  6.100 / 54.  5.100
libavdevice    54.  0.100 / 53.  4.100
libavfilter     2. 77.100 /  2. 74.102
libswscale      2.  1.100 /  2.  1.100
libswresample   0. 15.100 /  0. 12.100
libpostproc    52.  0.100 / 52.  0.100

Attachments (2)

patchnodisplay.diff (464 bytes) - added by cehoyos 4 years ago.
0001-ffplay-use-dummy-video-driver-if-display-is-disabled.patch (1.1 KB) - added by cus 4 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by u ltd.

Comment 1: related to #1401

Comment 2: This happened in xterm on the graphical tty (tty7) in KDE4:

% unset DISPLAY
% ffplay ~/dnw.mp3 
ffplay version N-40844-g0e82d31 Copyright (c) 2003-2012 the FFmpeg developers
  built on May 19 2012 15:26:37 with gcc 4.6.2
  configuration: --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --shlibdir=/usr/lib64 --disable-stripping --enable-pthreads --disable-shared --enable-avfilter --enable-static --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-nonfree --enable-postproc --enable-shared --enable-libdc1394 --enable-libtheora --enable-libschroedinger --enable-libvpx --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-x11grab --enable-ffplay
  libavutil      51. 53.100 / 51. 53.100
  libavcodec     54. 21.101 / 54. 21.101
  libavformat    54.  5.100 / 54.  5.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 74.102 /  2. 74.102
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 12.100 /  0. 12.100
  libpostproc    52.  0.100 / 52.  0.100
Could not initialize SDL - Unable to open a console terminal
(Did you set the DISPLAY variable?)
% 

The interesting thing is that I don't see this text but I see the last non-graphical tty I visited.
Nevertheless I am on tty7 and all key presses go to KDE4 environment. I have to press Ctrl-Alt-F1 and Ctrl-Alt-F7 to get back the graphical view.
Please mind that this happens independent of the use of the -nodisp ffplay flag.

Comment 3: My system: OpenSUSE 12.1; Kernel 3.1.10-1.9-desktop

Changed 4 years ago by cehoyos

comment:2 Changed 4 years ago by cehoyos

  • Keywords console ffplay removed
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from 0.11 to git-master

Possible fix attached.

comment:3 Changed 4 years ago by u ltd.

Yes, patchnodisplay.diff solved this problem (only #1402).
When providing -nodisp, ffplay works even in no-DISPLAY consoles.

"Comment 2" (see above) remains still valid for commands like ffplay file.mp3 but may belong to #1401 rather then to this defect.

ffplay -nodisp file.mp3 now works fine everywhere.

comment:4 Changed 4 years ago by cus

  • Cc cus@passwd.hu added
  • Owner set to cus

I'd rather use a patch like the one I attached.

It uses the display_disable instead of video_disable (which involves the visualization with display enabled) and also keeps the status line in the display disabled case.

Can you try it as well?

comment:5 Changed 4 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed

Fixed by Marton Balint.

Note: See TracTickets for help on using tickets.