Opened 12 years ago

Closed 12 years ago

#1402 closed defect (fixed)

ffplay: doesn't work on a tty console

Reported by: John Owned by: Marton Balint
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 Carl Eugen Hoyos 12 years ago.
0001-ffplay-use-dummy-video-driver-if-display-is-disabled.patch (1.1 KB ) - added by Marton Balint 12 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by John, 12 years ago

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

by Carl Eugen Hoyos, 12 years ago

Attachment: patchnodisplay.diff added

comment:2 by Carl Eugen Hoyos, 12 years ago

Keywords: console ffplay removed
Reproduced by developer: set
Status: newopen
Version: 0.11git-master

Possible fix attached.

comment:3 by John, 12 years ago

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 by Marton Balint, 12 years ago

Cc: cus@passwd.hu added
Owner: set to Marton Balint

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 by Carl Eugen Hoyos, 12 years ago

Resolution: fixed
Status: openclosed

Fixed by Marton Balint.

Note: See TracTickets for help on using tickets.