Re: [LAD] Screencasting with JACK [SOLVED!]

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: F. Medeiros <excalibas@...>
Cc: lad <linux-audio-dev@...>
Date: Thursday, September 26, 2013 - 4:44 pm

--089e012298e4c9f71d04e74c158c
Content-Type: text/plain; charset=UTF-8

On Thu, Sep 26, 2013 at 8:16 AM, F. Medeiros wrote:

> Hello,

What is the output of jack_lsp -l?

>

--089e012298e4c9f71d04e74c158c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

=
On Thu, Sep 26, 2013 at 8:16 AM, F. Medeiros <excalibas@gmail.com&g=
t; wrote:

=20
=20
=20

Hello,

I have the same problem, audio and video are not in sync and=C2=A0 th=
e
data is not aligned Warning.
This also happens when using Xephyr.

This is what I get from ffmpeg:

x@space:~/Documents/ffmpeg$ ./ffmpeg -fflags +genpts+igndts -f
x11grab -vsync 0 -r 30 -s 1920x1080 -i :1.0+0,0 -vcodec h264 -f
jack -ac 2 -r:a 48000=C2=A0 -i screencast -acodec pcm_s16le -r:v 30
-vsync 2 -async 1 -map 0:0,1,0 -map 1:0 -preset ultrafast -qp 0
test.mkv
ffmpeg version N-56669-g1906e00 Copyright (c) 2000-2013 the FFmpeg
developers
=C2=A0 built on Sep 26 2013 11:48:30 with gcc 4.6 (Ubuntu/Linaro
4.6.3-1ubuntu5)
=C2=A0 configuration: --enable-libvorbis --enable-gpl --enable-libx26=
4
--enable-x11grab
=C2=A0 libavutil=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 52. 46.100 / 52. 46.10=
0
=C2=A0 libavcodec=C2=A0=C2=A0=C2=A0=C2=A0 55. 33.100 / 55. 33.100
=C2=A0 libavformat=C2=A0=C2=A0=C2=A0 55. 18.102 / 55. 18.102
=C2=A0 libavdevice=C2=A0=C2=A0=C2=A0 55.=C2=A0 3.100 / 55.=C2=A0 3.10=
0
=C2=A0 libavfilter=C2=A0=C2=A0=C2=A0=C2=A0 3. 87.100 /=C2=A0 3. 87.10=
0
=C2=A0 libswscale=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2.=C2=A0 5.100 /=C2=
=A0 2.=C2=A0 5.100
=C2=A0 libswresample=C2=A0=C2=A0 0. 17.103 /=C2=A0 0. =
17.103

=C2=A0 libpostproc=C2=A0=C2=A0=C2=A0 52.=C2=A0 3.100 / 52.=C2=A0 3.10=
0
[x11grab @ 0x917dfc0] device: :1.0+0,0 -> display: :1.0 x: 0 y:
0 width: 1920 height: 1080
[x11grab @ 0x917dfc0] shared memory extension found
Input #0, x11grab, from ':1.0+0,0':
=C2=A0 Duration: N/A, start: 1380208288.085940, bitrate: 1990656 kb/s=

=C2=A0=C2=A0=C2=A0 Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), =
bgr0,
1920x1080, 1990656 kb/s, 30 tbr, 1000k tbn, 30 tbc<=
br>
jack_port_get_latency_range called with an incorrect port 0
[jack @ 0x918e260] JACK client registered and activated
(rate=3D48000Hz, buffer_size=3D256 frames)
Guessed Channel Layout for=C2=A0 Input Stream #1.0 : stereo
Input #1, jack, from 'screencast':
=C2=A0 Duration: N/A, start: 1380144319.409428, bitrate: 3072 kb/s
=C2=A0=C2=A0=C2=A0 Stream #1:0: Audio: pcm_f32le, 48000 Hz, stereo, f=
lt, 3072
kb/s
[swscaler @ 0x9171fc0] deprecated pixel format used, make sure you
did set range correctly
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media
players.
-async is forwarded to lavfi similarly to -af
aresample=3Dasync=3D1:min_hard_comp=3D0.100000:first_pts=3D0.
[libx264 @ 0x95e97c0] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2
[libx264 @ 0x95e97c0] profile High 4:4:4 Predictive, level 4.0,
4:4:4 8-bit
[libx264 @ 0x95e97c0] 64 - core 120 r2151 a3f4407 - H.264/MPEG-4
AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html
- options: cabac=3D0 ref=3D1 deblock=3D0:0:0 analyse=3D0:0 me=3Ddia s=
ubme=3D0
psy=3D0 mixed_ref=3D0 me_range=3D16 chroma_me=3D1 trellis=3D0 8x8dct=
=3D0 cqm=3D0
deadzone=3D21,11 fast_pskip=3D0 chroma_qp_offset=3D0 threads=3D6
sliced_threads=3D0 nr=3D0 decimate=3D1 interlaced=3D0 bluray_compat=
=3D0
constrained_intra=3D0 bframes=3D0 weightp=3D0 keyint=3D250 keyint_min=
=3D25
scenecut=3D0 intra_refresh=3D0 rc=3Dcqp mbtree=3D0 qp=3D0
Output #0, matroska, to 'test.mkv':
=C2=A0 Metadata:
=C2=A0=C2=A0=C2=A0 encoder=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 : Lavf55.18.102
=C2=A0=C2=A0=C2=A0 Stream #0:0: Video: h264 (libx264) (H264 / 0x34363=
248),
yuv444p, 1920x1080, q=3D-1--1, 1k tbn, 30 tbc
=C2=A0=C2=A0=C2=A0 Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x00=
01), 48000
Hz, stereo, s16, 1536 kb/s
Stream mapping:
=C2=A0 Stream #0:0 -> #0:0 (rawvideo -> libx264)
=C2=A0 Stream #1:0 -> #0:1 (pcm_f32le -> pcm_s16le)
Press [q] to stop, [?] for help
[swscaler @ 0x9171fc0] Warning: data is not aligned! This can lead
to a speedloss
frame=3D=C2=A0=C2=A0 76 fps=3D 30 q=3D-1.0 Lsize=3D=C2=A0=C2=A0=C2=A0=
1218kB time=3D00:00:02.53
bitrate=3D3939.6kbits/s=C2=A0=C2=A0=C2=A0
video:745kB audio:469kB subtitle:0 global headers:0kB muxing
overhead 0.358030%
[libx264 @ 0x95e97c0] frame I:1=C2=A0=C2=A0=C2=A0=C2=A0 Avg QP: 0.00=
=C2=A0 size:=C2=A0 7840
[libx264 @ 0x95e97c0] frame P:75=C2=A0=C2=A0=C2=A0 Avg QP: 0.00=C2=A0=
size: 10057
[libx264 @ 0x95e97c0] mb I=C2=A0 I16..4: 100.0%=C2=A0 0.0%=C2=A0 0.0%=

[libx264 @ 0x95e97c0] mb P=C2=A0 I16..4: 98.5%=C2=A0 0.0%=C2=A0 0.0%=
=C2=A0 P16..4:=C2=A0
0.0%=C2=A0 0.0%=C2=A0 0.0%=C2=A0 0.0%=C2=A0 0.0%=C2=A0=C2=A0=C2=A0 sk=
ip: 1.5%
[libx264 @ 0x95e97c0] coded y,u,v intra: 0.0% 0.0% 0.0% inter:
0.0% 0.0% 0.0%
[libx264 @ 0x95e97c0] i16 v,h,dc,p: 100%=C2=A0 0%=C2=A0 0%=C2=A0 0%
[libx264 @ 0x95e97c0] kb/s:2406.68
x@space:~/Documents/ffmpeg$

On 08/12/2013 03:18 AM, J. Liles wrote:

On Sun, Aug 11, 2013 at 6:18 AM,
Diego Simak <diego.simak@gmail.com>
wrote:
2013/8/8
J. Liles <malnourite@gmail.com>

>
>
> As some of you may recall, every time I've poste=
d
a demo video to LAD, I've had to include a disclaimer
excusing the poor quality due to a lack of functional
screencasting tools.
>
> Well, it took a couple of weeks of hair pulling
and many, many hours of testing, but I finally arrived
at a solution.
>
> Anyone who wants to create a screencast and
record audio via JACK *in perfect sync* must do the
following:
>
> Get ffmpeg. Apply this patch to it:
>
> htt=
ps://github.com/original-male/FFmpeg/commit/d02509d04d396a98646ca81e9ba327a=
501486130.patch

>
> Build it with vorbis and h264 support.
>
> Then, start your favorite desktop environment. I
use Xephyr for this.
>
> Have jack running (at -r 48000)
>
> Then run the following command:
>
> ffmpeg -fflags +genpts+igndts -f x11grab -vsync 0
-r 30 -s 1920x1080 -i :${DISPLAY}.+0,0 -vcodec h264 -f
jack -ac 2 -r:a 48000 =C2=A0-i screencast -acodec pcm_s16=
le
-r:v 30 -vsync 2 -async 1 -map 0:0,1,0 -map 1:0
-preset ultrafast -qp 0 "$FILE"
>
> Where DISPLAY is the number of your X11 display
and FILE is the filename for the screencast. I use a
.mkv extension for the matroska container.
>
> Remember to connect the streams you want recorded
to the 'screencast' JACK inputs!
>
> With this setup I'm able to record a full 30 FPS
@ 1080P with audio in perfect sync. Please share your
results too. With some more evidence I might have a
good case to get ffmpeg to accept my patch.
>
> Enjoy!
>
>
>
>
>
>
>

>
_______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev@lists.linuxaudio.org
> http://lists.linuxaudio.org/listinfo/linux-aud=
io-dev

>

My result:

- I had to change screen size to 1366x768 according to my
laptop display
- Audio and video are not in sync, I can see the following
message
after executing the ffmpeg command:

[swscaler @ 0x1ac5080] Warning: data is not aligned! This
can lead to
a speedloss

This is the full log.
Thank you very much!

diego@ruidosa:~$ ffmpeg -fflags +genpts+igndts -f x11grab
-vsync 0 -r
30 -s 1366x768 -i :0.0+0,0 -vcodec h264 -f jack -ac 2 -r:a
48000 =C2=A0-i
screencast -acodec pcm_s16le -r:v 30
-vsync 2 -async 1 -map 0:0,1,0

-map 1:0 -preset ultrafast -qp 0 aaa.mkv
ffmpeg version N-55422-gb37ff48 Copyright (c) 2000-2013
the FFmpeg developers
=C2=A0 built on Aug 10 2013 10:54:00 with gcc 4.6
(Ubuntu/Linaro 4.6.3-1ubuntu5)
=C2=A0 configuration: --enable-libx264 --enable-x11grab
--enable-gpl
--enable-libvorbis --disable-yasm
=C2=A0 libavutil =C2=A0 =C2=A0 =C2=A052. 41.100 / 52. 41.100<=
br>
=C2=A0 libavcodec =C2=A0 =C2=A0 55. 24.100 / 55. 24.100
=C2=A0 libavformat =C2=A0 =C2=A055. 13.102 / 55. 13.102
=C2=A0 libavdevice =C2=A0 =C2=A055. =C2=A03.100 / 55. =C2=A03=
.100
=C2=A0 libavfilter =C2=A0 =C2=A0 3. 82.100 / =C2=A03. 82.100<=
br>
=C2=A0 libswscale =C2=A0 =C2=A0 =C2=A02. =C2=A04.100 / =C2=A0=
2. =C2=A04.100
=C2=A0 libswresample =C2=A0 0. 17.103 / =C2=A0=
0. 17.103

=C2=A0 libpostproc =C2=A0 =C2=A052. =C2=A03.100 / 52. =C2=A03=
.100
[x11grab @ 0x1ae3700] device: :0.0+0,0 -> display: :0.0
x: 0 y: 0
width: 1366 height: 768
[x11grab @ 0x1ae3700] shared memory extension found
Input #0, x11grab, from ':0.0+0,0':
=C2=A0 Duration: N/A, start: 1376226919.464630, bitrate:
1007124 kb/s
=C2=A0 =C2=A0 Stream #0:0: Video: rawvideo (BGR[0] / 0x524742=
),
bgr0, 1366x768,
1007124 kb/s, 30 tbr, 1000k tbn, 30 tbc
jack_port_get_latency_range called with an incorrect port
0
[jack @ 0x1afbce0] JACK client registered and activated
(rate=3D48000Hz,
buffer_size=3D1024 frames)
Guessed Channel Layout for =C2=A0Input Stream #1.0 : stereo
Input #1, jack, from 'screencast':
=C2=A0 Duration: N/A, start: 1376226919.619355, bitrate: 3072
kb/s
=C2=A0 =C2=A0 Stream #1:0: Audio: pcm_f32le, 48000 Hz, stereo=
, flt,
3072 kb/s
[swscaler @ 0x1ac5080] deprecated pixel format used, make
sure you did
set range correctly
No pixel format specified, yuv444p for H.264 encoding
chosen.
Use -pix_fmt yuv420p for compatibility with outdated media
players.
-async is forwarded to lavfi similarly to -af
aresample=3Dasync=3D1:min_hard_comp=3D0.100000:first_pts=3D0.=

[libx264 @ 0x2b6e520] using cpu capabilities: MMX2
SSE2Fast SSSE3
FastShuffle SSE4.1 Cache64
[libx264 @ 0x2b6e520] profile High 4:4:4 Predictive, level
3.2, 4:4:4 8-bit
[libx264 @ 0x2b6e520] 64 - core 120 r2151 a3f4407 -
H.264/MPEG-4 AVC
codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html
-
options: cabac=3D0 ref=3D1 deblock=3D0:0:0 analyse=3D0:0 me=
=3Ddia
subme=3D0 psy=3D0
mixed_ref=3D0 me_range=3D16 chroma_me=3D1 trellis=3D0 8x8dct=
=3D0
cqm=3D0
deadzone=3D21,11 fast_pskip=3D0 chroma_qp_offset=3D0 threads=
=3D3
sliced_threads=3D0 nr=3D0 decimate=3D1 interlaced=3D0
bluray_compat=3D0
constrained_intra=3D0 bframes=3D0 weightp=3D0 keyint=3D250
keyint_min=3D25
scenecut=3D0 intra_refresh=3D0 rc=3Dcqp mbtree=3D0 qp=3D0
Output #0, matroska, to 'aaa.mkv':
=C2=A0 Metadata:
=C2=A0 =C2=A0 encoder =C2=A0 =C2=A0 =C2=A0 =C2=A0 : Lavf55.13=
.102
=C2=A0 =C2=A0 Stream #0:0: Video: h264 (libx264) (H264 /
0x34363248), yuv444p,
1366x768, q=3D-1--1, 1k tbn, 30 tbc
=C2=A0 =C2=A0 Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0=
x0001),
48000 Hz,
stereo, s16, 1536 kb/s
Stream mapping:
=C2=A0 Stream #0:0 -> #0:0 (rawvideo -> libx264)
=C2=A0 Stream #1:0 -> #0:1 (pcm_f32le -> pcm_s16le)
Press [q] to stop, [?] for help
[swscaler @ 0x1ac5080] Warning: data is not aligned! This
can lead to
a speedloss
frame=3D =C2=A0122 fps=3D 23 q=3D-1.0 Lsize=3D =C2=A0 =C2=A02=
774kB
time=3D00:00:04.06
bitrate=3D5588.3kbits/s
video:2040kB audio:732kB subtitle:0 global headers:0kB
muxing overhead 0.097703%
[libx264 @ 0x2b6e520] frame I:1 =C2=A0 =C2=A0 Avg QP: 0.00
=C2=A0size:596863
[libx264 @ 0x2b6e520] frame P:121 =C2=A0 Avg QP: 0.00 =C2=A0s=
ize:
12324
[libx264 @ 0x2b6e520] mb I =C2=A0I16..4: 100.0% =C2=A00.0% =
=C2=A00.0%
[libx264 @ 0x2b6e520] mb P =C2=A0I16..4: =C2=A07.6% =C2=A00.0=
% =C2=A00.0%
=C2=A0P16..4: =C2=A00.3%
0.0% =C2=A00.0% =C2=A00.0% =C2=A00.0% =C2=A0 =C2=A0skip:92.1%=

[libx264 @ 0x2b6e520] coded y,u,v intra: 11.9% 37.1% 37.5%
inter: 0.2% 0.2% 0.2%
[libx264 @ 0x2b6e520] i16 v,h,dc,p: 91% =C2=A08% =C2=A00% =C2=
=A00%
[libx264 @ 0x2b6e520] kb/s:4107.72
Received signal 2: terminating.
diego@ruidosa:~$
diego@ruidosa:~$
diego@ruidosa:~$

Interesting. If you use Xephyr you can record a virtual
desktop larger than your actual display (and therefore
1920x1080), does that avoid the error (and give you better
results)?

_______________________________________________
Linux-audio-dev mailing list
L=
inux-audio-dev@lists.linuxaudio.org

http://lists.linuxaudio.org/listinfo/linux-audio-dev

=C2=A0<=
br>=C2=A0What is the output of jack_lsp -l?

--089e012298e4c9f71d04e74c158c--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] Screencasting with JACK [SOLVED!], J. Liles, (Fri Aug 9, 1:54 am)
Re: [LAD] Screencasting with JACK [SOLVED!], Diego Simak, (Sun Aug 11, 1:19 pm)
Re: [LAD] Screencasting with JACK [SOLVED!], J. Liles, (Mon Aug 12, 2:19 am)
Re: [LAD] Screencasting with JACK [SOLVED!], F. Medeiros, (Thu Sep 26, 3:16 pm)
Re: [LAD] Screencasting with JACK [SOLVED!], J. Liles, (Thu Sep 26, 4:44 pm)
Re: [LAD] Screencasting with JACK [SOLVED!], F. Medeiros, (Fri Sep 27, 8:36 am)
Re: [LAD] Screencasting with JACK [SOLVED!], Dominique Michel, (Sat Aug 10, 5:22 pm)
Re: [LAD] Screencasting with JACK [SOLVED!], Harry van Haaren, (Fri Aug 9, 8:03 pm)
Re: [LAD] Screencasting with JACK [SOLVED!], J. Liles, (Fri Aug 9, 2:59 am)
Re: [LAD] Screencasting with JACK [SOLVED!], Patrick Shirkey, (Fri Aug 9, 5:26 am)
Re: [LAD] Screencasting with JACK [SOLVED!], Esben Stien, (Fri Aug 9, 7:57 pm)