
Recherche avancée
Autres articles (60)
-
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (4635)
-
ffmpeg : single frame from video is highly overexposed image
9 avril 2021, par mcgregor94086I am using ffmpeg on a Raspberry Pi 400, attached to a camera array to capture one image from each camera.


Most images generated are highly overexposed and washed out. I am trying to understand which command line options I should set to prevent this over exposure.



Are there options I need to set for the camera to automatically set the right exposure, or some way to set the length of an exposure as opposed to just a "frame" ?


Also, each image is taking about 3 to 4 seconds to capture. I just want to capture the first possible frame and that's it. Is there a set of options which would capture the image is less time ?


/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video0 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam00.jpg
Input #0, video4linux2,v4l2, from '/dev/video0':
 Duration: N/A, start: 672949.710856, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x184adb0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam00.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=1.0 q=3.7 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.39x 
video:37kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video0 image in: 3 seconds
linux_capture_photo_and_return_image_path( /dev/video0 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 1 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam00.jpg
1 /dev/video0: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam00.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video2 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam02.jpg
Input #0, video4linux2,v4l2, from '/dev/video2':
 Duration: N/A, start: 672958.327329, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x1d27db0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam02.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.9 q=8.6 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.374x 
video:136kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video2 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video2 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 2 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam02.jpg
2 /dev/video2: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam02.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video4 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam04.jpg
Input #0, video4linux2,v4l2, from '/dev/video4':
 Duration: N/A, start: 672963.021864, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x10bedb0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam04.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=1.0 q=3.7 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.389x 
video:42kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video4 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video4 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 3 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam04.jpg
3 /dev/video4: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam04.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video6 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam06.jpg
Input #0, video4linux2,v4l2, from '/dev/video6':
 Duration: N/A, start: 672967.663385, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x24e4db0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam06.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.9 q=8.2 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.352x 
video:126kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video6 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video6 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 4 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam06.jpg
4 /dev/video6: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam06.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video8 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam08.jpg
Input #0, video4linux2,v4l2, from '/dev/video8':
 Duration: N/A, start: 672972.189025, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x13fadb0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam08.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.9 q=9.1 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.352x 
video:154kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video8 image in: 3 seconds
linux_capture_photo_and_return_image_path( /dev/video8 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 5 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam08.jpg
5 /dev/video8: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam08.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video17 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam17.jpg
Input #0, video4linux2,v4l2, from '/dev/video17':
 Duration: N/A, start: 672976.730667, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0xae6e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam17.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.9 q=8.7 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.353x 
video:164kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video17 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video17 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 6 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam17.jpg
6 /dev/video17: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam17.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video19 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam19.jpg
Input #0, video4linux2,v4l2, from '/dev/video19':
 Duration: N/A, start: 672981.425451, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x15a7e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam19.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=1.0 q=3.2 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.391x 
video:40kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video19 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video19 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 7 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam19.jpg
7 /dev/video19: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam19.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video21 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam21.jpg
Input #0, video4linux2,v4l2, from '/dev/video21':
 Duration: N/A, start: 672986.050603, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x1722e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam21.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=1.0 q=7.8 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.388x 
video:119kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video21 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video21 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 8 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam21.jpg
8 /dev/video21: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam21.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video23 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam23.jpg
Input #0, video4linux2,v4l2, from '/dev/video23':
 Duration: N/A, start: 672990.712888, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x19f4e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam23.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=1.0 q=3.4 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.389x 
video:42kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video23 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video23 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 9 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam23.jpg
9 /dev/video23: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam23.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video25 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam25.jpg
Input #0, video4linux2,v4l2, from '/dev/video25':
 Duration: N/A, start: 672995.359539, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x9d7e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam25.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.9 q=8.4 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.369x 
video:146kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video25 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video25 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 10 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam25.jpg
10 /dev/video25: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam25.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video27 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam27.jpg
Input #0, video4linux2,v4l2, from '/dev/video27':
 Duration: N/A, start: 673000.069328, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x1f90e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam27.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=1.0 q=3.9 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.382x 
video:135kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video27 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video27 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 11 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam27.jpg
11 /dev/video27: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam27.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video29 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam29.jpg
Input #0, video4linux2,v4l2, from '/dev/video29':
 Duration: N/A, start: 673004.676618, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x22dde20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam29.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=1.0 q=9.3 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.385x 
video:165kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video29 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video29 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 12 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam29.jpg
12 /dev/video29: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam29.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video31 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam31.jpg
Input #0, video4linux2,v4l2, from '/dev/video31':
 Duration: N/A, start: 673009.555417, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x22f5e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam31.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.8 q=8.6 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=0.335x 
video:141kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video31 image in: 4 seconds
linux_capture_photo_and_return_image_path( /dev/video31 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 13 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam31.jpg
13 /dev/video31: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam31.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video33 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam33.jpg
Input #0, video4linux2,v4l2, from '/dev/video33':
 Duration: N/A, start: 673014.171570, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x6d4e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam33.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.9 q=9.7 Lsize=N/A time=00:00:00.20 bitrate=N/A speed=0.172x 
video:156kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video33 image in: 3 seconds
linux_capture_photo_and_return_image_path( /dev/video33 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 14 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam33.jpg
14 /dev/video33: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam33.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video35 -frames:v 1 -f image2 /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam35.jpg
Input #0, video4linux2,v4l2, from '/dev/video35':
 Duration: N/A, start: 673018.565769, bitrate: 165888 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x1667e20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam35.jpg':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
 Metadata:
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.8 q=9.8 Lsize=N/A time=00:00:00.20 bitrate=N/A speed=0.167x 
video:148kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Captured /dev/video35 image in: 3 seconds
linux_capture_photo_and_return_image_path( /dev/video35 , /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/ , 15 ) RETURNS /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam35.jpg
15 /dev/video35: /var/www/html/sonascan/data/scans/10000000e1f45394/20210405184504/SonaCam35.jpg
/usr/bin/ffmpeg -y -hide_banner -ss 0:0:0 -r 15 -s 1920x1080 -f video4linux2 -i /dev/video37 -frames:v 1 -f image2




$ v4l2-ctl --all
Driver Info:
 Driver name : uvcvideo
 Card type : FHD Camera: FHD Camera
 Bus info : usb-0000:01:00.0-1.2.1.1
 Driver version : 5.10.17
 Capabilities : 0x84a00001
 Video Capture
 Metadata Capture
 Streaming
 Extended Pix Format
 Device Capabilities
 Device Caps : 0x04200001
 Video Capture
 Streaming
 Extended Pix Format
Media Driver Info:
 Driver name : uvcvideo
 Model : FHD Camera: FHD Camera
 Serial : 
 Bus info : usb-0000:01:00.0-1.2.1.1
 Media version : 5.10.17
 Hardware revision: 0x00000001 (1)
 Driver version : 5.10.17
Interface Info:
 ID : 0x03000002
 Type : V4L Video
Entity Info:
 ID : 0x00000001 (1)
 Name : FHD Camera: FHD Camera
 Function : V4L2 I/O
 Flags : default
 Pad 0x01000007 : 0: Sink
 Link 0x02000013: from remote pad 0x100000a of entity 'Extension 4': Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
 Width/Height : 1920/1080
 Pixel Format : 'YUYV' (YUYV 4:2:2)
 Field : None
 Bytes per Line : 3840
 Size Image : 4147200
 Colorspace : sRGB
 Transfer Function : Rec. 709
 YCbCr/HSV Encoding: ITU-R 601
 Quantization : Default (maps to Limited Range)
 Flags : 
Crop Capability Video Capture:
 Bounds : Left 0, Top 0, Width 1920, Height 1080
 Default : Left 0, Top 0, Width 1920, Height 1080
 Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080, Flags: 
Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080, Flags: 
Streaming Parameters Video Capture:
 Capabilities : timeperframe
 Frames per second: 5.000 (5/1)
 Read buffers : 0
 brightness 0x00980900 (int) : min=0 max=255 step=1 default=128 value=128
 contrast 0x00980901 (int) : min=0 max=255 step=1 default=30 value=30
 saturation 0x00980902 (int) : min=0 max=100 step=1 default=64 value=64
 hue 0x00980903 (int) : min=-180 max=180 step=1 default=0 value=0
 white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
 gamma 0x00980910 (int) : min=90 max=150 step=1 default=120 value=120
 gain 0x00980913 (int) : min=4 max=8 step=1 default=5 value=5
 power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1
 white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4000 value=4000 flags=inactive
 sharpness 0x0098091b (int) : min=0 max=7 step=1 default=2 value=2
 backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=2 value=2
 exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
 exposure_absolute 0x009a0902 (int) : min=9 max=2500 step=1 default=123 value=123 flags=inactive
error 22 getting ext_ctrl Exposure, Auto Priority



-
Dreamcast Archival
24 mai 2011, par Multimedia Mike — Sega DreamcastConsole homebrew communities have always had a precarious relationship with console pirates. The same knowledge and skills useful for creating homebrew programs can usually be parlayed into ripping games and cajoling a console into honoring ripped copies. For this reason, the Dreamcast homebrew community tried hard to distance itself from pirates, rippers, and other unsavory characters.
Funny how times change. While I toed the same line while I was marginally a part of the community back in the day, now I think I’m performing a service for video game archivists and historians by openly publishing the same information. I know of at least one solution already. But I think it’s possible to do much better.
Pre-existing Art
Famed Japanese game hacker BERO (FFmpeg contributors should recognize his name from a number of Dreamcast-related multimedia contributions including CRI ADX and SH-4 optimizations) crafted a program called dreamrip based on KOS’s precursor called libdream. This is the program I used to extract 4XM multimedia files from Alone in the Dark : The New Nightmare.Fun facts : The Sega Dreamcast used special optical discs called GD-ROMs. The GD stands for ‘GigaDisc’ which implied that they could hold roughly a gigabyte of data. How long do you think it takes to transfer that much data over a serial cable operating at 115,200 bits/second (on the order of 11 Kbytes/sec) ? I seem to recall entire discs requiring on the order of 27-28 hours to archive.
If only I possessed some expertise in data compression which might expedite this process.
KallistiOS’ Unwitting Help
The KallistiOS (KOS) console-oriented RTOS provides all the software infrastructure necessary for archiving (that’s what we’ll call it in this post) Dreamcast games. KOS exposes the optical disc’s filesystem via the/cd
mount point on the VFS. From there, KOS provides functions for communicating with a host computer via ethernet (broadband adapter) or serial line (DC coder’s cable). To this end, KOS exposes another mount point on the VFS named/pc
which allows direct access to the host PC’s filesystem.Thus, it’s pretty straightforward to use KOS to access the files (or raw sectors) of the Dreamcast disc and then send them over the communication line to the host PC. Simple.
Compressing Before Transfer
Right away, I wonder about compiling 3 different compression libraries : libz, libbz2, and liblzma. The latter 2 are exceptionally CPU-intensive to compress. Then again, it doesn’t really matter how long the compressor takes to do its job as long as it can average better than 11 Kbytes/sec on a 200MHz Hitachi SH-4 CPU. KOS can be set up in a preemptive threading mode which means it should be possible to read sectors and compress them while keeping the UART operating at full tilt.A 4th compression algorithm should be in play here as well : FLAC. Since some of these discs contain red book CD audio tracks that need archival, lossless audio compression should be useful.
This post serves as a rough overview for possible future experiments. Readers might have further brainstorms.
-
How to fix laggy ffmpeg screen and audio capture ?
26 juillet 2022, par Wh0r00tI am using
ffmpeg
to capture the screen along with audio.

The
ffmpeg
command that i tried is

ffmpeg -y \
 -f x11grab \
 -framerate 60 \
 -s 1366x768 \
 -i :0.0 \
 -f alsa -i default -ac 2 \
 -r 30 \
 -c:v h264 -crf 0 -preset ultrafast -c:a vorbis -strict experimental \
 "$HOME/Videos/$fname-$(date '+%y%m%d-%H%M-%S').mkv"



The stdout of the
ffmpeg
https://pastebin.com/Qmi5TMKv

ffmpeg version n5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 12.1.0 (GCC)
 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
 libavutil 57. 17.100 / 57. 17.100
 libavcodec 59. 18.100 / 59. 18.100
 libavformat 59. 16.100 / 59. 16.100
 libavdevice 59. 4.100 / 59. 4.100
 libavfilter 8. 24.100 / 8. 24.100
 libswscale 6. 4.100 / 6. 4.100
 libswresample 4. 3.100 / 4. 3.100
 libpostproc 56. 3.100 / 56. 3.100
[x11grab @ 0x561faf77eb00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':0.0':
 Duration: N/A, start: 1658814267.169414, bitrate: 2014248 kb/s
 Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x768, 2014248 kb/s, 60 fps, 1000k tbr, 1000k tbn
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'default':
 Duration: N/A, start: 1658814267.230653, bitrate: 1536 kb/s
 Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
 Stream #1:0 -> #0:1 (pcm_s16le (native) -> vorbis (native))
Press [q] to stop, [?] for help
[libx264 @ 0x561faf7d4300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 0x561faf7d4300] profile High 4:4:4 Predictive, level 3.2, 4:4:4, 8-bit
[libx264 @ 0x561faf7d4300] 264 - core 164 r3081 19856cc - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
[alsa @ 0x561faf78a940] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Output #0, matroska, to '/home/earth/Videos/-220726-1114-27.mkv':
 Metadata:
 encoder : Lavf59.16.100
 Stream #0:0: Video: h264 (H264 / 0x34363248), yuv444p(tv, progressive), 1366x768, q=2-31, 30 fps, 1k tbn
 Metadata:
 encoder : Lavc59.18.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 Stream #0:1: Audio: vorbis (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp
 Metadata:
 encoder : Lavc59.18.100 vorbis
[vorbis @ 0x561faf7d5500] Queue input is backward in time0 bitrate=N/A speed= 0x
frame= 153 fps= 31 q=-1.0 Lsize= 2295kB time=00:00:05.06 bitrate=3709.5kbits/s dup=0 drop=150 speed=1.01x
video:2282kB audio:7kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.281689%
[libx264 @ 0x561faf7d4300] frame I:1 Avg QP: 0.00 size:381729
[libx264 @ 0x561faf7d4300] frame P:152 Avg QP: 0.00 size: 12857
[libx264 @ 0x561faf7d4300] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x561faf7d4300] mb P I16..4: 56.3% 0.0% 0.0% P16..4: 0.1% 0.0% 0.0% 0.0% 0.0% skip:43.6%
[libx264 @ 0x561faf7d4300] coded y,u,v intra: 1.6% 1.6% 1.6% inter: 0.2% 0.2% 0.2%
[libx264 @ 0x561faf7d4300] i16 v,h,dc,p: 99% 1% 0% 0%
[libx264 @ 0x561faf7d4300] kb/s:3664.27
Exiting normally, received signal 15.



I am using the preset ultrafast because I read that it helps not to compress the video too much.
The output of the recorded test file using ffmpeg is as below.


(+) Video --vid=1 (h264 1366x768 30.000fps)
 (+) Audio --aid=1 (vorbis 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1366x768 yuv444p
AV: 00:00:03 / 00:00:19 (17%) A-V: 0.000
[mkv] Discarding potentially broken or useless index.
AV: 00:00:14 / 00:00:19 (73%) A-V: 0.000

Exiting... (Quit)



The recording works but there is a audio lag. If I record the same using
simplescreenrecorder
with the same settings like,

audio backend - alsa


source - default


audio codec - vorbis


video codec - h.264


container - matroska


preset - superfast


The
simplescreenrecorder
log https://pastebin.com/83hMMRQF

[PageRecord::StartPage] Starting page ...
[PageRecord::StartPage] Started page.
[PageRecord::StartOutput] Starting output ...
[PageRecord::StartOutput] Output file: /home/earth/Videos/simplescreenrecorder-2022-07-26_11.18.13.mkv
[Muxer::Init] Using format matroska (Matroska).
[Muxer::AddStream] Using codec libx264 (libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10).
[VideoEncoder::PrepareStream] Using pixel format nv12.
[libx264 @ 0x563436cbfd40] using SAR=1/1
[libx264 @ 0x563436cbfd40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 0x563436cbfd40] profile High, level 3.2, 4:2:0, 8-bit
[libx264 @ 0x563436cbfd40] 264 - core 164 r3081 19856cc - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=4 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 pb_ratio=1.30 aq=1:1.00
[Muxer::AddStream] Using codec libvorbis (libvorbis).
[BaseEncoder::EncoderThread] Encoder thread started.
[AudioEncoder::PrepareStream] Using sample format f32p.
[BaseEncoder::EncoderThread] Encoder thread started.
[Muxer::MuxerThread] Muxer thread started.
[PageRecord::StartOutput] Started output.
[Synchronizer::SynchronizerThread] Synchronizer thread started.
[PageRecord::StartInput] Starting input ...
[X11Input::Init] Using X11 shared memory.
[X11Input::Init] Detecting screen configuration ...
[X11Input::Init] Screen 0: x1 = 0, y1 = 0, x2 = 1366, y2 = 768
[X11Input::InputThread] Input thread started.
[ALSAInput::InputThread] Using sample format s16.
[PageRecord::StartInput] Started input.
[ALSAInput::InputThread] Input thread started.
[FastResampler::Resample] Resample ratio is 1.0000 (was 0.0000).
[PageRecord::StopOutput] Stopping output ...
[PageRecord::StopOutput] Stopped output.
[PageRecord::StopInput] Stopping input ...
[X11Input::~X11Input] Stopping input thread ...
[X11Input::InputThread] Input thread stopped.
[ALSAInput::~ALSAInput] Stopping input thread ...
[ALSAInput::InputThread] Input thread stopped.
[PageRecord::StopInput] Stopped input.



It works perfectly without any lag whatsoever. The output of the recorded test file using simplescreenrecorder is as below.


(+) Video --vid=1 (h264 1366x768)
 (+) Audio --aid=1 (vorbis 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1366x768 yuv420p
AV: 00:00:01 / 00:00:17 (7%) A-V: 0.000
[mkv] Discarding potentially broken or useless index.
AV: 00:00:08 / 00:00:17 (47%) A-V: 0.000

Exiting... (Quit)



The only difference that I saw between these two recordings is
VO: [gpu] 1366x768 yuv444p

VO: [gpu] 1366x768 yuv420p
for ffmpeg and simplescreenrecorder receptively.
I do not know if this matters but is there something that I could tweak to makeffmpeg
to capture the screen and audio without any lag.
Like answered here https://unix.stackexchange.com/questions/675436/ffmpeg-recording-slows-down-when-audio-inputs-are-added
I do open pavucontrol but its not much of a help.

The reason that I going with
ffmpeg
is because I can kill the process usingpid
at a particular time using cronjobs.
These are my system information, in case if it helps

System:
 Host: taco Kernel: 5.18.12-arch1-1 arch: x86_64 bits: 64 Desktop: dwm
 v: 6.2 Distro: Arch Linux
Machine:
 Type: Desktop Mobo: Acer model: A75F2-M v: P21-A1 serial: N/A BIOS: Acer
 v: P21-A1 date: 02/07/2014
CPU:
 Info: quad core model: AMD A8-5500B APU with Radeon HD Graphics bits: 64
 type: MT MCP cache: L2: 4 MiB
 Speed (MHz): avg: 1400 min/max: 1400/3200 cores: 1: 1400 2: 1400 3: 1400
 4: 1400
Graphics:
 Device-1: AMD Trinity [Radeon HD 7560D] driver: radeon v: kernel
 Display: server: X.Org v: 21.1.4 driver: X: loaded: modesetting
 gpu: radeon resolution: 1366x768~60Hz
 OpenGL: renderer: AMD ARUBA (DRM 2.50.0 / 5.18.12-arch1-1 LLVM 14.0.6)
 v: 4.3 Mesa 22.1.3
Audio:
 Device-1: AMD FCH Azalia driver: snd_hda_intel
 Sound Server-1: ALSA v: k5.18.12-arch1-1 running: yes
 Sound Server-2: PulseAudio v: 16.1 running: yes
 Sound Server-3: PipeWire v: 0.3.56 running: yes



Any help is much appreciated.