Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8801 closed defect (needs_more_info)

x11grab of screen/area produces mp4 file without streams

Reported by: John Rose Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: x11grab
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

'm using Ubuntu 18.04 with ffmpeg 3.4.6

I want to grab (video & sound) of the whole screen or grab (video & sound) of a region (e.g. window or area, in the screen) using ffmpeg. I found an example at https://wiki.ubuntu.com/ScreenCasts/ffmpeg:
ffmpeg -f x11grab -r 25 -s 1024x768 -i :0.0 -vcodec huffyuv screencast.avi
But it doesn't create an avi file and gives "Output file #0 does not contain any stream".
I adapted it slightly (i.e. for my monitor) but it didn't work:
ffmpeg -f x11grab -r 25 -s 1920x1080 -i :0.0 -f pulse -vcodec libx265 v.mp4
I've tried other variants e.g.:
ffmpeg -r 25 -video_size 1920x1080 -f x11grab -i :0.0 -f pulse -ac 2 -i default -vcodec libx265 -y /home/john/Temporary/v.mp4 >/home/john/Temporary/l.txt 2>&1
That creates a .mp4 file but but won't play (in vlc or video player) as it has unknown video codec & audio codec in its properties.

Summary of the bug:
How to reproduce:

% ffmpeg -i input ... output
ffmpeg version
built on ...

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (2)

l.txt (9.4 KB ) - added by John Rose 4 years ago.
Standard output & standard error
v.mp4 (256.0 KB ) - added by John Rose 4 years ago.
Created .mp4 file

Download all attachments as: .zip

Change History (8)

by John Rose, 4 years ago

Attachment: l.txt added

Standard output & standard error

by John Rose, 4 years ago

Attachment: v.mp4 added

Created .mp4 file

comment:1 by Carl Eugen Hoyos, 4 years ago

Component: ffmpegundetermined

Is your issue reproducible with current FFmpeg git head, the only version supported on this bug tracker?

comment:2 by John Rose, 4 years ago

Is your issue reproducible with current FFmpeg git head, the only version

supported on this bug tracker?

As I'm a Newbie to this mailing list, I'm not sure that I'm doing it properly.
I was asked the above question by email from trac@avcodec.org. I sent an email to ffmpeg-devel@ffmpeg.org as requested in the emai. But I don't know where it would now be shown.

As I stated in my defect report, I'm using ffmpeg 3.4.6. I don't know how to find out the version of ffmpeg on the current ffmpeg git head. Please advise me how to find that out and if it's different to the one I'm using how to change my ffmpeg version from that supplied by Ubuntu on Bionic (i.e. 18.04).

in reply to:  2 comment:3 by Carl Eugen Hoyos, 4 years ago

Resolution: needs_more_info
Status: newclosed

Replying to johnaaronrose:

As I stated in my defect report, I'm using ffmpeg 3.4.6.

Feel free to test your issue with current FFmpeg git head. If the issue is reproducible, please provide command line and complete, uncut console output here and reopen this ticket.
See https://johnvansickle.com/ffmpeg/ linked from https://ffmpeg.org/download.html

comment:4 by John Rose, 4 years ago

As I said before, please tell me how to download current FFmpeg git head or instructions on how to do it.
I've found instructions on how to compile FFmpeg for Ubuntu at https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

Last edited 4 years ago by John Rose (previous) (diff)

comment:5 by John Rose, 4 years ago

Apologies. I didn't notice the reference to https://johnvansickle.com/ffmpeg
I've now downloaded the amd64 source from there. I then tried following the instructions from As I said before, please tell me how to download current FFmpeg git head ot instructions on how to do it.
I've found instructions on how to compile FFmpeg for Ubuntu at https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
However, it failed on the installation of the various packages required for compilation of FFmpeg due to an unmet dependency:
john@JohnPC:~$ sudo apt-get update -qq && sudo apt-get -y install \

autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libfreetype6-dev \
libgnutls28-dev \
libsdl2-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
pkg-config \
texinfo \
wget \
yasm \
zlib1g-dev

[sudo] password for john:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'git' instead of 'git-core'
autoconf is already the newest version (2.69-11).
autoconf set to manually installed.
automake is already the newest version (1:1.15.1-3ubuntu2).
automake set to manually installed.
build-essential is already the newest version (12.4ubuntu1).
build-essential set to manually installed.
libfreetype6-dev is already the newest version (2.8.1-2ubuntu2).
libfreetype6-dev set to manually installed.
libtool is already the newest version (2.4.6-2).
pkg-config is already the newest version (0.29.1-0ubuntu2).
pkg-config set to manually installed.
zlib1g-dev is already the newest version (1:1.2.11.dfsg-0ubuntu2).
zlib1g-dev set to manually installed.
texinfo is already the newest version (6.5.0.dfsg.1-2).
texinfo set to manually installed.
cmake is already the newest version (3.10.2-1ubuntu2.18.04.1).
git is already the newest version (1:2.17.1-1ubuntu0.7).
libxcb-shm0-dev is already the newest version (1.13-2~ubuntu18.04).
libxcb-shm0-dev set to manually installed.
libxcb1-dev is already the newest version (1.13-2~ubuntu18.04).
libxcb1-dev set to manually installed.
wget is already the newest version (1.19.4-1ubuntu2.2).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.

libsdl2-dev : Depends: libsdl2-2.0-0 (= 2.0.8+dfsg1-1ubuntu1.18.04.4) but 2.0.9+dfsg1-1ubuntu1 is to be installed

E: Unable to correct problems, you have held broken packages.
What is the solution to that?

comment:6 by John Rose, 4 years ago

Solved by:
sudo apt-get install libsdl2-2.0-0/bionic

Note: See TracTickets for help on using tickets.