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

From: Diego Simak <diego.simak@email-addr-hidden>
Date: Mon Aug 12 2013 - 15:17:37 EEST

2013/8/12 Peder Hedlund <peder@email-addr-hidden>:
> Quoting Diego Simak <diego.simak@email-addr-hidden>:
>
>> - 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
>>
>> diego@email-addr-hidden:~$ 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 -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
>
>
>> Duration: N/A, start: 1376226919.464630, bitrate: 1007124 kb/s
>> 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=48000Hz,
>> buffer_size=1024 frames)
>> Guessed Channel Layout for Input Stream #1.0 : stereo
>> Input #1, jack, from 'screencast':
>> Duration: N/A, start: 1376226919.619355, bitrate: 3072 kb/s
>> Stream #1:0: Audio: pcm_f32le, 48000 Hz, stereo, flt, 3072 kb/s
>> [swscaler @ 0x1ac5080] Warning: data is not aligned! This can lead to
>> a speedloss
>> frame= 122 fps= 23 q=-1.0 Lsize= 2774kB time=00:00:04.06
>> bitrate=5588.3kbits/s
>> video:2040kB audio:732kB subtitle:0 global headers:0kB muxing overhead
>> 0.097703%
>
>
> A couple of things :
>
> * 1366 isn't a multiple of 8 which is probably why you get the "data is not
> aligned! This can lead to a speedloss" warning. Set it to 1360 instead.
>

Ok, changing to 1360 and now no speedloss message is observerd.

> * You've set ffmpeg to record at 30 fps but it seems your computer can only
> manage to do 23 fps. That might be the cause of the A/V being out of sync.
> Either decrease the capture area, change "-r:v 30" to something like "-r:v
> 20" or try doing an uncompressed recording (replace "-vcodec h264 -preset
> ultrafast -qp 0" with something like "-vcodec huffyuv"). In the latter case
> you'll end up with a really big capture file which you might want/need to
> demux, compress and remux afterwards.
>

I've tried both and still the audio is not in sync with the video:

with -r:v 20

ffmpeg -fflags +genpts+igndts -f x11grab -vsync 0 -r 30 -s 1360x768 -i
:0.0+0,0 -vcodec h264 -f jack -ac 2 -r:a 48000 -i screencast -acodec
pcm_s16le -r:v 20 -vsync 2 -async 1 -map 0:0,1,0 -map 1:0 -preset
ultrafast -qp 0 toto.mkv

I get this message every second:

[libx264 @ 0x2832a00] non-strictly-monotonic PTS
    Last message repeated 2 times
frame= 11 fps=0.0 q=0.0 size= 587kB time=00:00:00.25
bitrate=19235.5kbits/[libx264 @ 0x2832a00] non-strictly-monotonic PTS
    Last message repeated 3 times
frame= 23 fps= 21 q=0.0 size= 804kB time=00:00:00.65
bitrate=10137.9kbits/[libx264 @ 0x2832a00] non-strictly-monotonic PTS
    Last message repeated 3 times
frame= 33 fps= 21 q=0.0 size= 1125kB time=00:00:01.00
bitrate=9220.1kbits/s[libx264 @ 0x2832a00] non-strictly-monotonic PTS
    Last message repeated 2 times
frame= 44 fps= 21 q=0.0 size= 1461kB time=00:00:01.35 bitrate=8866.4kbits/s

without -r:v 20 and with -vcodec huffyuv

I get as you said an enormeous file and this message, but this option
seems to be better; e.g: audio is not in sync but better than h264

Too many video packets in the buffer: (27 in 33747576 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
A: 8.2 V: 7.8 A-V: 0.461 ct: 0.074 0/ 0 97% 3% 69.7% 71 0

           ************************************************
           **** Your system is too SLOW to play this! ****
           ************************************************

It's a Core 2 Duo 2.27 GHz CPUs, don't know if its slow or not, seems it is...

I still have to try what happens with J.Liles suggestion to use Xephyr
but it seems that it will be the same.

Thanks for your help, really appreciated!

> - Peder
> _______________________________________________
> Linux-audio-user mailing list
> Linux-audio-user@email-addr-hidden
> http://lists.linuxaudio.org/listinfo/linux-audio-user
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Tue Aug 13 00:15:07 2013

This archive was generated by hypermail 2.1.8 : Tue Aug 13 2013 - 00:15:08 EEST