Quantcast

Audio cut when using select filter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Audio cut when using select filter

Martin Ždila
Hello

I am trying to grab a screen with audio, record it to mp4 file and also
extract 60th frame as jpeg:

ffmpeg -hide_banner -y -thread_queue_size 512 -video_size 800x600
-framerate 30 -r 30 -f x11grab -draw_mouse 0 -i :0.0 -thread_queue_size 512
-f pulse -i default -filter_complex
"[0:v]split=2[in1][in2];[in2]copy[out2];[in1]select=eq(n\,60)[out1]" -map
'[out2]' -map '1:a' -vcodec libx264 -acodec libmp3lame -preset fast xxx.mp4
-map '[out1]' -frames:v 1 xxx.jpeg

The problem is that after the frame for jpeg is selected the audio is no
more recorded. How could I solve it?

Thanks in advance
--
Martin Ždila
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio cut when using select filter

Martin Ždila
Hello,

I am still having problems with that. Any advice please?

I've reformulated question at
http://serverfault.com/questions/830870/ffmpeg-audio-ends-before-video-when-extracting-thumbnail

Should I rather report it as a ffmpeg bug?

--
Martin Ždila
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio cut when using select filter

Carl Eugen Hoyos-2
In reply to this post by Martin Ždila
2017-01-17 17:15 GMT+01:00 Martin Ždila <[hidden email]>:

> I am trying to grab a screen with audio, record it to mp4 file and also
> extract 60th frame as jpeg:
>
> ffmpeg -hide_banner -y -thread_queue_size 512 -video_size 800x600
> -framerate 30 -r 30 -f x11grab -draw_mouse 0 -i :0.0 -thread_queue_size 512
> -f pulse -i default -filter_complex
> "[0:v]split=2[in1][in2];[in2]copy[out2];[in1]select=eq(n\,60)[out1]" -map
> '[out2]' -map '1:a' -vcodec libx264 -acodec libmp3lame -preset fast xxx.mp4
> -map '[out1]' -frames:v 1 xxx.jpeg

Remove "-r 30" and provide both command line and complete, uncut
console output.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio cut when using select filter

Martin Ždila
On Wed, Feb 8, 2017 at 11:09 AM, Carl Eugen Hoyos <[hidden email]>
wrote:

> Remove "-r 30" and provide both command line and complete, uncut
> console output.
>

Let me please provide output of the example mentioned on StackOverflow
which has no "-r 30":

Example:

ffmpeg -y \
  -thread_queue_size 512 -video_size 800x600 -framerate 25 -f x11grab -i :0.0 \
  -thread_queue_size 512 -f pulse -i default \
  -filter_complex
'[0:v]split[vid1][vid2];[vid1]format=pix_fmts=yuv420p[vid];[vid2]select=isnan(prev_selected_t)*gt(t\,5),scale=200:150[thumb]'
\
  -map '[vid]' -map '1:a' -vcodec libx264 -acodec libmp3lame -preset
veryfast -profile:v main -level 3.1 output.mp4 \
  -map '[thumb]' -frames:v 1 output.jpeg


Output:

martin@local ~ $ ffmpeg -y   -thread_queue_size 512 -video_size 800x600
-framerate 25 -f x11grab -i :0.0   -thread_queue_size 512 -f pulse -i
default   -filter_complex
'[0:v]split[vid1][vid2];[vid1]format=pix_fmts=yuv420p[vid];[vid2]select=isnan(prev_selected_t)*gt(t\,5),scale=200:150[thumb]'
  -map '[vid]' -map '1:a' -vcodec libx264 -acodec libmp3lame -preset
veryfast -profile:v main -level 3.1 output.mp4   -map '[thumb]' -frames:v 1
output.jpeg
ffmpeg version 3.2.2-2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-4) 20170121
  configuration: --prefix=/usr --extra-version=2 --toolchain=hardened
--libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu
--enable-gpl --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-libmp3lame
--enable-libopenjpeg --enable-libopenmpt --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-chromaprint
--enable-frei0r --enable-libopencv --enable-libx264 --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
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1486548876.327445, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 800x600, 25
fps, 25.08 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, pulse, from 'default':
  Duration: N/A, start: 1486548876.415727, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[swscaler @ 0x5618c50e7f00] deprecated pixel format used, make sure you did
set range correctly
[libx264 @ 0x5618c50d1ee0] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x5618c50d1ee0] profile Main, level 3.1
[libx264 @ 0x5618c50d1ee0] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options:
cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6
lookahead_threads=2 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_lookahead=10 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf57.56.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p,
800x600, q=-1--1, 25.08 fps, 19264 tbn, 25.08 tbc
    Metadata:
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: mp3 (libmp3lame) (i[0][0][0] / 0x0069), 48000 Hz,
stereo, s16p
    Metadata:
      encoder         : Lavc57.64.101 libmp3lame
Output #1, image2, to 'output.jpeg':
  Metadata:
    encoder         : Lavf57.56.100
    Stream #1:0: Video: mjpeg, yuvj444p(pc), 200x150, q=2-31, 200 kb/s,
25.08 fps, 25.08 tbn, 25.08 tbc
    Metadata:
      encoder         : Lavc57.64.101 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 (rawvideo) -> split (graph 0)
  format (graph 0) -> Stream #0:0 (libx264)
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> mp3 (libmp3lame))
  scale (graph 0) -> Stream #1:0 (mjpeg)
Press [q] to stop, [?] for help
frame=  293 fps= 26 q=-1.0 Lq=3.3 size=     332kB time=00:00:11.56 bitrate=
235.0kbits/s dup=2 drop=0 speed=1.01x
video:254kB audio:81kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
[libx264 @ 0x5618c50d1ee0] frame I:2     Avg QP:18.75  size: 78083
[libx264 @ 0x5618c50d1ee0] frame P:74    Avg QP:28.24  size:  1158
[libx264 @ 0x5618c50d1ee0] frame B:217   Avg QP:33.31  size:    29
[libx264 @ 0x5618c50d1ee0] consecutive B-frames:  1.0%  0.7%  0.0% 98.3%
[libx264 @ 0x5618c50d1ee0] mb I  I16..4: 46.4%  0.0% 53.6%
[libx264 @ 0x5618c50d1ee0] mb P  I16..4:  0.4%  0.0%  0.3%  P16..4:  0.8%
 0.1%  0.2%  0.0%  0.0%    skip:98.1%
[libx264 @ 0x5618c50d1ee0] mb B  I16..4:  0.1%  0.0%  0.0%  B16..8:  0.1%
 0.0%  0.0%  direct: 0.0%  skip:99.8%  L0:62.4% L1:37.6% BI: 0.0%
[libx264 @ 0x5618c50d1ee0] coded y,uvDC,uvAC intra: 39.2% 46.8% 45.4%
inter: 0.1% 0.1% 0.1%
[libx264 @ 0x5618c50d1ee0] i16 v,h,dc,p: 59% 40%  1%  0%
[libx264 @ 0x5618c50d1ee0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 26% 14%  2%
 4%  3%  5%  4%  5%
[libx264 @ 0x5618c50d1ee0] i8c dc,h,v,p: 63% 21% 15%  1%
[libx264 @ 0x5618c50d1ee0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x5618c50d1ee0] kb/s:170.00

 Best regards
--
Martin Ždila
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio cut when using select filter

Carl Eugen Hoyos-2
2017-02-08 11:19 GMT+01:00 Martin Ždila <[hidden email]>:

> ffmpeg -y \
>   -thread_queue_size 512 -video_size 800x600 -framerate 25 -f x11grab -i :0.0 \
>   -thread_queue_size 512 -f pulse -i default

Is the issue reproducible with file input?
With video file and audio pulse input?
(With audio file and video grab input?)

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio cut when using select filter

Martin Ždila
On Wed, Feb 8, 2017 at 11:28 AM, Carl Eugen Hoyos <[hidden email]>
wrote:

> Is the issue reproducible with file input?
>

No


> With video file and audio pulse input?
>

No


> (With audio file and video grab input?)


Yes
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio cut when using select filter

Martin Ždila
We changed out script to extract thumbnail in the second step.

Still this looks like a ffmpeg bug. Feel free to report it ;-)

--
Martin Ždila
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Loading...