Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
1
answers
3502
views
error ffmpeg Cannot open display :0.0+0,0, error 1. :0.0+0,0: Input/output error
Hello I get this error when i want to capture my screen on linux with ffmpeg ubuntu 16:04 : the command i'am using : $ ffmpeg -f x11grab -r 15 -s 1920x1080 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0 ffmpeg version 4.1.1-0york1~16.04 Copyright (c) 2000-2019 the FFmpe...
Hello I get this error when i want to capture my screen on linux with ffmpeg ubuntu 16:04 :
the command i'am using :
$ ffmpeg -f x11grab -r 15 -s 1920x1080 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0
ffmpeg version 4.1.1-0york1~16.04 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
configuration: --prefix=/usr --extra-version='0york1~16.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-nonfree --enable-libfdk-aac --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[x11grab @ 0x5611f156e540] Cannot open display :0.0+0,0, error 1.
:0.0+0,0: Input/output error
cleanguy
(21 rep)
Mar 15, 2019, 03:30 PM
• Last activity: Aug 5, 2025, 03:09 PM
0
votes
2
answers
50
views
transcode movies efficiently when 2 GPUs are available
I have a Kodi video library where each movie is in its own folder because I had to place `.nfo` files with links to TMDB in each folder to ensure correct identification. The movies are in their original Blu-ray resolution, stored on a drive shared over Samba on a gigabit LAN. I need to transcode all...
I have a Kodi video library where each movie is in its own folder because I had to place
.nfo
files with links to TMDB in each folder to ensure correct identification. The movies are in their original Blu-ray resolution, stored on a drive shared over Samba on a gigabit LAN.
I need to transcode all these files with FFmpeg to max. 1334×750 px.
Setup: Intel Core i-7 3930K, 2 x NVIDIA GTX 980 6 GB GPU, KDE on Debian Testing, custom FFmpeg compiled with h264_nvenc
enabled. Although the GPUs are connected with an SLI bridge, they're not in SLI mode due to NVIDIA's Linux driver limitation (v550.163.01). GPU 0 is used by the system, GPU 1 is idle.
How to do it efficiently?
likewise
(680 rep)
Aug 4, 2025, 05:21 PM
• Last activity: Aug 5, 2025, 09:29 AM
0
votes
0
answers
14
views
Why must I use scale_vaapi with kmsgrab, but hwupload with x11grab when using vaapi with ffmpeg?
I am wondering why, when using vaapi with ffmpeg, if I use x11grab I must use `-vf format=nv12,hwupload` but with kmsgrab I must use `-vf scale_vaapi=format=nv12` instead. In particular I want to know 2 things. - Why is it this way? - Is there any way to use normal filters (like `eq=brightness=50` o...
I am wondering why, when using vaapi with ffmpeg, if I use x11grab I must use
-vf format=nv12,hwupload
but with kmsgrab I must use -vf scale_vaapi=format=nv12
instead.
In particular I want to know 2 things.
- Why is it this way?
- Is there any way to use normal filters (like eq=brightness=50
or zscale
) with vaapi when using kmsgrab?
Because the dilemma that's causing me to ask these questions is that I need to do some color corrections and filters seem like the best way to do that, but I'm unable to use filters when I'm using kmsgrab
because scale_vaapi
breaks other filters, and I even tried using some obscure filters like procamp_vaapi
which shuold allow me to do the same things as eq
, but I couldn't get it to work.
my kmsgrab command:
ffmpeg -y -device /dev/dri/card1 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=format=nv12' -c:v h264_vaapi -qp 24 output.mkv
Cestarian
(2438 rep)
Aug 4, 2025, 11:45 AM
36
votes
7
answers
35708
views
How to get near-perfect screen recording quality?
Someone suggested I direct a copy of the unmodified X display to a file and afterwards convert that file to a general purpose video file. What commands would I use to do this on a Kubuntu system? (Edit: He said something about attaching a display port to a file.) If not possible, what is my best opt...
Someone suggested I direct a copy of the unmodified X display to a file and afterwards convert that file to a general purpose video file. What commands would I use to do this on a Kubuntu system? (Edit: He said something about attaching a display port to a file.) If not possible, what is my best option for an excellent quality screen recording that does not depend on fast hardware?
*Background:* I tried using avconv with -f x11grab and some GUI programs. However, no matter what I try, the resulting video either has artifacts/ blurriness or is choppy (missing frames). This is probably due to CPU/ memory constraints.
*Goals:*
- Video quality must not be noticeably different from seeing the session directly on a screen, because the purpose is to demonstrate an animated application.
- The final video must be in a common format that can be sent to Windows users and used on the web. I think H.264 MP4 should work.
- The solution should not presume much prior knowledge. I am familiar with the command line and basic Linux commands, but I am still learning Linux and do not know much about video codecs.
*What I already tried:*
- Best command so far:
ffmpeg -f x11grab -s xga -r 30 -i :0.0 -qscale 0.1 -vcodec huffyuv grab.avi
, then convert to mp4 with ffmpeg -i grab.avi -sameq -vcodec mpeg4 grab.mp4
.
- The picture quality is great, but on my test sytem it lags the computer. On a faster target system it does not lag, but frames are obviously skipped, making the video not very *smooth*.
- I am still trying to figure out how to save the grab.avi file to SHM to see if that helps.
- Using Istanbul and RecordMyDesktop GUI recorders
- Simple command: avconv -f x11grab -s xga -r 25 -i :0.0 simple.mpg
using avconv version 0.8.3-4:0.8.3-0ubuntu0.12.04.1
- Adding -codec:copy
(fails with: Requested output format 'x11grab' is not a suitable output format
)
- Adding -same_quant
(results in great quality, but is very choppy/ missing many frames)
- Adding -vpre lossless_ultrafast
(fails with: Unrecognized option 'vpre'
, Failed to set value 'lossless_ultrafast' for option 'vpre'
)
- Adding various values of -qscale
- Adding various values of -b
- Adding -vcodec h264
(outputs repeatedly: Error while decoding stream #0:0
, [h264 @ 0x8300980] no frame!
)
- Note: h264 is listed in avconv -formats
output as DE h264 raw H.264 video format
Oleg Pryadko
(2500 rep)
Apr 25, 2013, 04:04 AM
• Last activity: Aug 4, 2025, 10:02 AM
0
votes
1
answers
40
views
Is it possible to record audio on a wayland desktop with ffmpeg?
I've figured out [a way][1] to capture video on wayland (hyprland) with ffmpeg, but that method does not cover audio. Most people on wayland will be using pipewire, pipewire has a compatibility layer for pulseaudio called pipewire-pulse which allows most audio designed for pulseaudio to be played or...
I've figured out a way to capture video on wayland (hyprland) with ffmpeg, but that method does not cover audio.
Most people on wayland will be using pipewire, pipewire has a compatibility layer for pulseaudio called pipewire-pulse which allows most audio designed for pulseaudio to be played or recorded through pipewire.
But in ffmpeg's case it doesn't seem to work.
ffmpeg -device /dev/dri/card1 -vaapi_device /dev/dri/renderD129 -f pulse -ac 2 -i easyeffects_sink.monitor -c:a libopus -framerate 60 -f kmsgrab -i - -c:v h264_vaapi -rc_mode QVBR -q:v 10 -maxrate 327680 -b 81920 -pix_fmt vaapi -vf hwmap=derive_device=vaapi,scale_vaapi=format=nv12:out_range=full out.mp4
The above command fails with
Option device not found.
Error opening input file easyeffects_sink.monitor.
Error opening input files: Option not found
But if I remove this part:
-f pulse -ac 2 -i easyeffects_sink.monitor -c:a libopus
It will work relatively fine. and if I am on x11 instead of wayland, using x11grab instead of kmsgrab
ffmpeg -vaapi_device /dev/dri/renderD129 -f pulse -ac 2 -i easyeffects_sink.monitor -c:a libopus -video_size 2560x1600 -framerate 60 -f x11grab -i :1.0 -c:v h264_vaapi -rc_mode QVBR -q:v 10 -maxrate 327680 -b 81920 -pix_fmt vaapi -vf format=nv12,hwupload out.mp4
That command works perfectly fine even if it uses the exact same options that didn't work on kmsgrab.
Which leaves me with the question of whether ffmpeg is capable of capturing audio from a wayland environment at all.
Cestarian
(2438 rep)
Aug 3, 2025, 10:28 PM
• Last activity: Aug 4, 2025, 08:28 AM
4
votes
1
answers
5264
views
How to record v4l webcam with ffmpeg? Cannot find a proper format for codec 'none'
Goal is to capture video from my old usb webcam (device 0733:0430). Trying to save video gives this error. (I've tried both ffmpeg and avconv.) Command `ffmpeg -f v4l2 -i /dev/video2 -s 160x120 tmp.mkv` [video4linux2,v4l2 @ 0x815280] Time per frame unknown [video4linux2,v4l2 @ 0x815280] Cannot find...
Goal is to capture video from my old usb webcam (device 0733:0430). Trying to save video gives this error. (I've tried both ffmpeg and avconv.)
Command
ffmpeg -f v4l2 -i /dev/video2 -s 160x120 tmp.mkv
[video4linux2,v4l2 @ 0x815280] Time per frame unknown
[video4linux2,v4l2 @ 0x815280] Cannot find a proper format for codec 'none' (id 0), pixel format 'none' (id -1)
Assertion *codec_id != AV_CODEC_ID_NONE failed at /build/buildd/ffmpeg-2.3/libavdevice/v4l2.c:802
I know it can work on Linux, because I had it running a few years ago. How to get it to work now?
----
**Below is information about the device.**
Device dmesg output
[53008.270283] usb 2-1.2: new full-speed USB device number 4 using ehci-pci
[53008.363405] usb 2-1.2: New USB device found, idVendor=0733, idProduct=0430
[53008.363416] usb 2-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[53008.779745] gspca_main: v2.14.0 registered
[53008.809496] gspca_main: spca505-2.14.0 probing 0733:0430
[53008.812508] usbcore: registered new interface driver spca505
ffmpeg -list_formats 1 -f v4l2 -i /dev/video2
[video4linux2,v4l2 @ 0xbed5e0] Raw : Unsupported : S505 : 160x120 176x144 320x240 352x288
v4l-info /dev/video2
### v4l2 device info [/dev/video2] ###
general info
VIDIOC_QUERYCAP
driver : "spca505"
card : "USB Camera (0733:0430)"
bus_info : "usb-0000:00:1d.0-1.2"
version : 3.13.11
capabilities : 0x85000001 [VIDEO_CAPTURE,READWRITE,STREAMING,(null)]
standards
inputs
VIDIOC_ENUMINPUT(0)
index : 0
name : "spca505"
type : CAMERA
audioset : 0
tuner : 0
std : 0x0 []
status : 0x0 []
video capture
VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
index : 0
type : VIDEO_CAPTURE
flags : 0
description : "S505"
pixelformat : 0x35303553 [S505]
VIDIOC_G_FMT(VIDEO_CAPTURE)
type : VIDEO_CAPTURE
fmt.pix.width : 160
fmt.pix.height : 120
fmt.pix.pixelformat : 0x35303553 [S505]
fmt.pix.field : NONE
fmt.pix.bytesperline : 160
fmt.pix.sizeimage : 28800
fmt.pix.colorspace : SRGB
fmt.pix.priv : 0
controls
VIDIOC_QUERYCTRL(BASE+0)
id : 9963776
type : INTEGER
name : "Brightness"
minimum : 0
maximum : 255
step : 1
default_value : 127
flags : 32
Rucent88
(1910 rep)
Aug 9, 2014, 12:02 PM
• Last activity: Aug 3, 2025, 10:10 PM
0
votes
2
answers
38
views
How to merge Audio and Video file into one
all. Hope you guys are doing well. I have downloaded a 28min mp4 from a site but its audio and video got downloaded into 2 separate mp4 file both of 28min. Now how can I merge them? Thanks in advance Attaching ffprobe info for those file below [![enter image description here][1]][1] [

A. Bhowmick
(23 rep)
Aug 2, 2025, 08:29 AM
• Last activity: Aug 2, 2025, 06:10 PM
6
votes
1
answers
824
views
Can ffmpeg record screen on wayland?
Is it possible to record the screen with ffmpeg on wayland using the Hyprland compositor? I've read some posts that imply people managed to do it with kmsgrab, but cannot figure out how to do it myself (I tried the common examples with kmsgrab and it didn't work, possibly because I'm on wayland) Is...
Is it possible to record the screen with ffmpeg on wayland using the Hyprland compositor?
I've read some posts that imply people managed to do it with kmsgrab, but cannot figure out how to do it myself (I tried the common examples with kmsgrab and it didn't work, possibly because I'm on wayland)
Is there a way to do it?
I've tried:
ffmpeg -device /dev/dri/card1 -f kmsgrab -i - -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mkv
But get the following error:
[kmsgrab @ 0x556c9ae1fec0] Using plane 58 to locate framebuffers.
[kmsgrab @ 0x556c9ae1fec0] Template framebuffer is 142: 2560x1600 format 34325258 modifier 200000000401b03 flags 2.
[kmsgrab @ 0x556c9ae1fec0] No handle set on framebuffer: maybe you need some additional capabilities?
[in#0 @ 0x556c9ae1fc00] Error opening input: Invalid argument
Error opening input file -.
Error opening input files: Invalid argument
Recording with vaapi with wf-recorder or wl-screenrec works fine btw, but I would prefer to directly use ffmpeg.
I'm also curious if it can be used with nvenc (which would be on card0 for me), but if I try to use it with my nvidia gpu I get:
[kmsgrab @ 0x558916595e80] No usable planes found.
[in#0 @ 0x558916595bc0] Error opening input: Invalid argument
Error opening input file -.
Error opening input files: Invalid argument
Cestarian
(2438 rep)
Jul 28, 2025, 03:26 PM
• Last activity: Jul 29, 2025, 09:19 PM
974
votes
17
answers
1192227
views
How can I reduce a video's size with ffmpeg?
How can I use [`ffmpeg`](https://ffmpeg.org/) to reduce the size of a video by lowering the quality (as minimally as possible, naturally, because I need it to run on a mobile device that doesn't have much available space)? I forgot to mention that when the video can use subtitles (*.srt or *.sub), I...
How can I use [
ffmpeg
](https://ffmpeg.org/) to reduce the size of a video by lowering the quality (as minimally as possible, naturally, because I need it to run on a mobile device that doesn't have much available space)?
I forgot to mention that when the video can use subtitles (*.srt or *.sub), I'd like to convert them too to fit the parameters of the converted video file.
xralf
(15189 rep)
Jan 10, 2012, 09:45 PM
• Last activity: Jul 11, 2025, 02:00 AM
0
votes
0
answers
26
views
How can I grep the output of ffprobe?
I'd like to only see those lines containing "Stream #" from an ffprobe output. But whatever I do, it continues to show the whole output. Neither "|" nor ">" pipes work. What’s the magic? Thanks a lot! ffprobe -v info video.mp4 | grep "Stream #"
I'd like to only see those lines containing "Stream #" from an ffprobe output. But whatever I do, it continues to show the whole output. Neither "|" nor ">" pipes work. What’s the magic? Thanks a lot!
ffprobe -v info video.mp4 | grep "Stream #"
Gary U.U. Unixuser
(339 rep)
Jun 28, 2025, 11:16 AM
• Last activity: Jun 28, 2025, 12:51 PM
0
votes
1
answers
5623
views
"MPEG-1/2 does not support 3/1 fps" when sending webcam to ffserver
I am unable to send a stream to my `ffserver`. I started the server with ffserver -f /etc/ffserver.conf & where `ffserver.conf` has not been modified. I tried sending a webcam stream with ffmpeg -f alsa -ac 2 -i plughw:0,0 -f video4linux2 -s vga -i /dev/video0 http://localhost:8090/feed1.ffm I have...
I am unable to send a stream to my
ffserver
.
I started the server with
ffserver -f /etc/ffserver.conf &
where ffserver.conf
has not been modified. I tried sending a webcam stream with
ffmpeg -f alsa -ac 2 -i plughw:0,0 -f video4linux2 -s vga -i /dev/video0 http://localhost:8090/feed1.ffm
I have however the following error:
[...]
[tcp @ 0x560e1234c6e0] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[...]
MPEG-1/2 does not support 3/1 fps
[...]
The port 9080 is open, as seen with nmap localhost
**Why do I have this error and how to send my stream?**
-----------------------------
**Full output:**
# ffmpeg -f alsa -ac 2 -i plughw:0,0 -f video4linux2 -s vga -i /dev/video0 http://localhost:8090/feed1.ffm
ffmpeg version 3.2.1-1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 6.2.1 (Debian 6.2.1-5) 20161124
configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-libtesseract --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-libopencv --enable-frei0r --enable-libx264 --enable-chromaprint --enable-shared
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'plughw:0,0':
Duration: N/A, start: 1481703954.356244, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Input #1, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 41830.241126, bitrate: 147456 kb/s
Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[tcp @ 0x560e6432c6e0] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[tcp @ 0x560e64345a40] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[mpeg1video @ 0x560e6435fb20] bitrate tolerance 21333 too small for bitrate 64000, overriding
[mpeg1video @ 0x560e6435fb20] MPEG-1/2 does not support 3/1 fps
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp2 (native))
Stream #1:0 -> #0:1 (rawvideo (native) -> mpeg1video (native))
Stream #0:0 -> #0:2 (pcm_s16le (native) -> wmav2 (native))
Stream #1:0 -> #0:3 (rawvideo (native) -> msmpeg4v3 (msmpeg4))
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
**Full /etc/ffserver.conf
** (no modification from original file):
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
File /tmp/feed1.ffm
FileMaxSize 200K
ACL allow 127.0.0.1
Feed feed1.ffm
Format mpeg
AudioBitRate 32
AudioChannels 1
AudioSampleRate 44100
VideoBitRate 64
VideoBufferSize 40
VideoFrameRate 3
VideoSize 160x128
VideoGopSize 12
Feed feed1.ffm
Format asf
VideoFrameRate 15
VideoSize 352x240
VideoBitRate 256
VideoBufferSize 40
VideoGopSize 30
AudioBitRate 64
StartSendOnKey
Format status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
URL http://www.ffmpeg.org/
user123456
(5258 rep)
Dec 14, 2016, 08:35 AM
• Last activity: Jun 26, 2025, 01:06 PM
0
votes
1
answers
3079
views
Error message "Mpeg-4 AAC decoder not installed" when playing video on Ubuntu 18.04.3 in VirtualBox
I am unable to play videos on my Ubuntu 18.04.3 system running in VirtualBox due to the error message `Mpeg-4 AAC decoder not installed`. The file requires MPEG-4 AAC decoder and H.264 (Main Profile) decoder, which are not installed. How can I fix this issue?
I am unable to play videos on my Ubuntu 18.04.3 system running in VirtualBox due to the error message
Mpeg-4 AAC decoder not installed
.
The file requires MPEG-4 AAC decoder and H.264 (Main Profile) decoder, which are not installed. How can I fix this issue?
AbdulKadir Oyedeji
(1 rep)
Jan 6, 2020, 03:46 AM
• Last activity: Jun 24, 2025, 07:04 PM
0
votes
1
answers
2121
views
Starting ffplay X-window without a window manager
I want what is essentially a kiosk, to display a video stream using ffplay, without a whole Desktop environment. I started with minimal CentOS7, and installed xterm and X11, per this simple guide: https://linuxconfig.org/how-to-run-x-applications-without-a-desktop-or-a-wm I've created a .xinitrc fil...
I want what is essentially a kiosk, to display a video stream using ffplay, without a whole Desktop environment.
I started with minimal CentOS7, and installed xterm and X11, per this simple guide:
https://linuxconfig.org/how-to-run-x-applications-without-a-desktop-or-a-wm
I've created a .xinitrc file:
#!/bin/bash
exec firefox
and when I execute startx
, it opens an X11 window containing Firefox.
But, when I replace the .xinitrc file with this one:
#!/bin/bash
exec ffplay udp://192.168.0.237:5444
I just get a blank screen, in spite of knowing that ffplay command is right. Though I can tell from ps -ef | grep ffplay
that ffplay is indeed executing. I think it is just piping the output video someplace different from where Firefox did. I don't know how to tell where that is, nor how to force it to go to localhost:0.0
.
Note the CentOS7 box is a Hyper-V VM, which I am accessing via a Hyper-V console.
Jimbo1987
(1 rep)
Aug 15, 2021, 04:17 PM
• Last activity: Jun 24, 2025, 12:05 PM
1
votes
2
answers
535
views
ffmpeg with NVenc does not seem to utilize my GPU
I tried to convert a high-resolution video to 2k. I used this command: ``` ffmpeg -i input_video.mp4 -vf scale=1920:1080 -c:v h264_nvenc -preset slow -b:v 8M output_video.mp4 ``` Based on the `top` and `nvidia-semi` results, my CPU was at maximum utilization, but my GPU was barely used. The `ffmpeg`...
I tried to convert a high-resolution video to 2k. I used this command:
ffmpeg -i input_video.mp4 -vf scale=1920:1080 -c:v h264_nvenc -preset slow -b:v 8M output_video.mp4
Based on the top
and nvidia-semi
results, my CPU was at maximum utilization, but my GPU was barely used. The ffmpeg
process only used about 240 MiB of vram.
nvidia-smi dmon
did show lots of enc
activity. But the low vram usage and high CPU utilization makes me wonder if ffmpeg is fully utilize my GPU.
nvidia-smi dmon
# gpu pwr gtemp mtemp sm mem enc dec jpg ofa mclk pclk
# Idx W C C % % % % % % MHz MHz
0 - 74 - 6 8 66 0 - - 3504 420
0 - 74 - 6 8 71 0 - - 3504 420
0 - 74 - 6 8 70 0 - - 3504 420
0 - 74 - 6 8 71 0 - - 3504 420
0 - 74 - 6 7 63 0 - - 3504 420
0 - 74 - 5 7 56 0 - - 3504 420
0 - 74 - 6 8 70 0 - - 3504 420
0 - 74 - 6 8 67 0 - - 3504 420
0 - 74 - 6 8 69 0 - - 3504 420
0 - 74 - 6 8 71 0 - - 3504 420
0 - 74 - 6 8 68 0 - - 3504 420
David S.
(5823 rep)
Nov 23, 2024, 12:01 AM
• Last activity: Jun 23, 2025, 11:08 AM
3
votes
2
answers
8598
views
Can I stream from multicast to one client with ffmpeg?
I'm trying to do streaming from a source (tv box transmitting in multicast in this source rtp://@X.X.X.X:Y) to Internet (to my mobile phone as example or another device inside of my LAN) but I can not achieve it. The command I'm using is something like this ffmpeg -i rtp://@X.X.X.X:Y -vcodec copy -f...
I'm trying to do streaming from a source (tv box transmitting in multicast in this source rtp://@X.X.X.X:Y) to Internet (to my mobile phone as example or another device inside of my LAN) but I can not achieve it. The command I'm using is something like this
ffmpeg -i rtp://@X.X.X.X:Y -vcodec copy -f mpegts udp://127.0.0.1:1234
But it does not work as I expected, I mean, I'm able to open vlc and play the streaming in the same machine I'm running ffmpeg but not in another machine in the same LAN. Somebody can help me?
Thank you!
EDIT:
Finally I solved installing a software called "udpxy" that forwards multicast content to the clients. I installed in a raspberry and it works perfect for this purpose.
Thank you for all your explanations. It helped me to understand what I want to do and the limitations I have using a transcoder. I guess I can do the same with udpxy with ffmpeg but I can publish directly the TV Box IPs.
David
(141 rep)
Apr 23, 2018, 03:53 PM
• Last activity: Jun 17, 2025, 11:00 PM
0
votes
0
answers
23
views
How to fork ffmpeg x11grab?
I'm trying to fork `x11grab` to no avail. `m.mp4` is not generated: ```shell ffmpeg -video_size 1024x768 \ -framerate 25 \ -f x11grab \ -i :0.0+100,100 \ /tmp/m.mp4 \ >> /tmp/l.log 2>&1 & ``` Only after removing the trailing ampersand `&` , `m.mp4` is generated. Any ideas what I'm missing?
I'm trying to fork
x11grab
to no avail. m.mp4
is not generated:
ffmpeg -video_size 1024x768 \
-framerate 25 \
-f x11grab \
-i :0.0+100,100 \
/tmp/m.mp4 \
>> /tmp/l.log 2>&1 &
Only after removing the trailing ampersand &
, m.mp4
is generated.
Any ideas what I'm missing?
jjk
(445 rep)
May 27, 2025, 05:51 PM
• Last activity: May 27, 2025, 08:13 PM
3
votes
1
answers
2764
views
Cannot render non-ASCII characters with ffmpeg's drawtext
Using the `drawtext` filter in `ffmpeg` I am unable to use anything but ASCII characters. This command creates a five second test video, as expected (nothing pretty): ffmpeg -f lavfi -i testsrc -to 5 -vf "drawtext=text='AT 05 ーポン 攢ð':fontcolor=white" test.mpg But the output fails to...
Using the
Note from left to right:
AT - Double spaced characters
05 - Simple numbers
ーポン - CJK characters
攢ð - AltGr + a,b,c,d in my locale (en_GB.UTF-8)
At first I assumed the font was at fault, but I've checked numerous fonts and they have the relevant glyphs. Indeed my entire system has no problems with these characters at all. I then assumed it must be
So I'm back to assuming there is something wrong with my environment. I've tried on Ubuntu Trusty and Ubuntu Xenial but the results are the same.
$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
$ ffmpeg
ffmpeg version 3.2.4-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-5) 20170205
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
$ convert -version
Version: ImageMagick 6.7.7-10 2017-05-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
I don't know where else to look given that my locale appears to be correct, and any font I use correctly renders the font, but when passed to either
drawtext
filter in ffmpeg
I am unable to use anything but ASCII characters.
This command creates a five second test video, as expected (nothing pretty):
ffmpeg -f lavfi -i testsrc -to 5 -vf "drawtext=text='AT 05 ーポン 攢ð':fontcolor=white" test.mpg
But the output fails to render any non-ASCII characters:

ffmpeg
but I tried the following:
convert -background black -size 800x480 -fill "#ff0080" -family "Ubuntu Mono" -pointsize 72 -gravity center label:'AT 05 ーポン 攢ð' output.png
The result being:

ffmpeg
or convert
the text shown is useless.
I've done the usual hours and hours of Googling to no avail. I'm amazed nobody else has seen this problem before me.
Can anyone shed any light?
Ken Sharp
(559 rep)
Jun 13, 2017, 10:05 PM
• Last activity: May 21, 2025, 12:04 AM
0
votes
0
answers
51
views
Why are quotation marks and backslashes not working as expected in variables?
I'm trying to pass a command through to `ffmpeg`, but I'm struggling to get it to work with spaces in the name. I've tried this: filters="-vf subtitles='$filename.$format':force_style=Fontsize=24" And this: fn=$(echo $filename | sed 's: :\\ :g') filters="-vf subtitles=$fn.$format:force_style=Fontsiz...
I'm trying to pass a command through to
ffmpeg
, but I'm struggling to get it to work with spaces in the name.
I've tried this:
filters="-vf subtitles='$filename.$format':force_style=Fontsize=24"
And this:
fn=$(echo $filename | sed 's: :\\ :g')
filters="-vf subtitles=$fn.$format:force_style=Fontsize=24"
Then ultimately executed like this:
ffmpeg_command="ffmpeg -y -threads 8 -movflags +faststart $filters -pix_fmt $pfmt -c:a $acodec -c:v $codec $qualitycmd $quality $speed"
echo $ffmpeg_command \"$fileout\" -i \"$filename.$format\"
#Execute:
$($ffmpeg_command "$fileout" -i "$filename.$format")
In both of the above cases, if I do echo $filters
it shows the expected result (the filename encased in '
or the spaces escaped with \
)
However upon execution for some reason it will fail (it will interpret the spaces in the filename as a separator for arguments and throw an error that some part of the name is not a valid argument in spite of the quotation marks or backslashes).
I've confirmed the syntax should work though, if I execute it outside of a script
ffmpeg -i '/path/to/Some File.mkv' -vf subtitles='/path/to/Some File.mkv':force_style=Fontsize=24 out.mp4
That works just fine, so why doesn't it in the script? And how can I work around that?
Cestarian
(2438 rep)
May 17, 2025, 09:20 AM
• Last activity: May 17, 2025, 11:02 AM
169
votes
12
answers
164880
views
How to grep standard error stream (stderr)?
I am using ffmpeg to get the meta info of an audio clip. But I am unable to grep it. $ ffmpeg -i 01-Daemon.mp3 |grep -i Duration FFmpeg version SVN-r15261, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include...
I am using ffmpeg to get the meta info of an audio clip. But I am unable to grep it.
$ ffmpeg -i 01-Daemon.mp3 |grep -i Duration
FFmpeg version SVN-r15261, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib
--mandir=/usr/share/man --arch=i386 --extra-cflags=-O2
...
I checked, this ffmpeg output is directed to stderr.
$ ffmpeg -i 01-Daemon.mp3 2> /dev/null
So I think that grep is unable to read error stream to catch matching lines. How can we enable grep to read error stream?
Using [nixCraft](http://www.cyberciti.biz/faq/redirecting-stderr-to-stdout/) link, I redirected standard error stream to standard output stream, then grep worked.
$ ffmpeg -i 01-Daemon.mp3 2>&1 | grep -i Duration
Duration: 01:15:12.33, start: 0.000000, bitrate: 64 kb/s
But what if we do not want to redirect stderr to stdout?
Andrew-Dufresne
(6043 rep)
Oct 26, 2010, 01:42 AM
• Last activity: May 13, 2025, 07:07 PM
2
votes
1
answers
355
views
How to make `ffmpeg` use GPU mostly for reducing file sizes?
I'm on `Debian 12` & I'm using a `ryzen 5600H with integrated graphics + Nvidia 1650` setup & I'm running the following command ```sh ffmpeg -y -hwaccel cuda -i input.mp4 -vcodec libx264 -crf 24 output.mp4 ``` But this mostly uses `CPU`, as I can see all of the `12` threads are getting to `100%` and...
I'm on
Debian 12
& I'm using a ryzen 5600H with integrated graphics + Nvidia 1650
setup & I'm running the following command
ffmpeg -y -hwaccel cuda -i input.mp4 -vcodec libx264 -crf 24 output.mp4
But this mostly uses CPU
, as I can see all of the 12
threads are getting to 100%
and bloating other tasks. How can I make ffmpeg
use my NVIDIA GPU
mostly for this task?
I have searched through various posts before, but they all seemed to be very outdated, and the ones I was able to make work destroyed the quality.
Saikat Karmakar
(123 rep)
May 1, 2025, 08:24 AM
• Last activity: May 4, 2025, 10:50 AM
Showing page 1 of 20 total questions