4

Can someone help me with this :

The video streams fine but I can't hear any audio. I just hear random click sounds.Please help :

ffmpeg -f video4linux2 -channel 1 -i /dev/video0 -f alsa -i plughw:2,0 -r 25 -vcodec libx264 -strict experimental -acodec aac -b:a 20k -b:v 200k -aspect 4:3 -s 320x260 -ar 16000 -ab 32k -async 1 -g 6 -threads 4 -f flv rtmp://server:1935/live/test1

Any advise on how I should change this to make it work? I am trying this from a raspberry pi 2. All I need is to successfully stream audio+video at this quality since I'm making it work through slow internet connections.

Thanks.

Edit : Here's the output

    ffmpeg version 2.5.8-0ubuntu0.15.04.1 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (Ubuntu/Linaro 4.9.2-10ubuntu13)
  configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --shlibdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 5415.013497, bitrate: 165888 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 720x576, 165888 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, alsa, from 'plughw:2,0':
  Duration: N/A, start: 1442225849.423669, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
-async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
[libx264 @ 0x1fc9630] using SAR=13/12
[libx264 @ 0x1fc9630] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x1fc9630] profile High 4:2:2, level 1.3, 4:2:2 8-bit
[libx264 @ 0x1fc9630] 264 - core 142 r2495 6a301b6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 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=2 keyint=6 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=6 rc=abr mbtree=1 bitrate=200 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://my.server.url:1935/live/test1':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv422p, 320x260 [SAR 13:12 DAR 4:3], q=-1--1, 200 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.13.100 libx264
    Stream #0:1: Audio: aac ([10][0][0][0] / 0x000A), 16000 Hz, stereo, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc56.13.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[alsa @ 0x1fbefd0] ALSA buffer xrun.
frame=   18 fps= 18 q=35.0 size=       0kB time=00:00:00.08 bitrate=  40.9kbits/frame=   29 fps= 19 q=28.0 size=       9kB time=00:00:00.64 bitrate= 117.0kbits/frame=   39 fps= 19 q=26.0 size=      19kB time=00:00:01.15 bitrate= 133.1kbits/[flv @ 0x1fc8860] Failed to update header with correct duration.
[flv @ 0x1fc8860] Failed to update header with correct filesize.
frame=   41 fps= 17 q=-1.0 Lsize=      40kB time=00:00:02.36 bitrate= 140.2kbits/s    
video:38kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.042462%
[libx264 @ 0x1fc9630] frame I:7     Avg QP:26.70  size:  4195
[libx264 @ 0x1fc9630] frame P:13    Avg QP:28.14  size:   290
[libx264 @ 0x1fc9630] frame B:21    Avg QP:27.70  size:   262
[libx264 @ 0x1fc9630] consecutive B-frames: 31.7%  0.0%  0.0% 68.3%
[libx264 @ 0x1fc9630] mb I  I16..4: 53.1% 23.9% 23.0%
[libx264 @ 0x1fc9630] mb P  I16..4:  0.4%  0.5%  0.0%  P16..4: 10.3%  1.2%  0.6%  0.0%  0.0%    skip:87.1%
[libx264 @ 0x1fc9630] mb B  I16..4:  0.1%  0.0%  0.0%  B16..8: 11.5%  0.3%  0.1%  direct: 1.4%  skip:86.5%  L0:34.4% L1:64.5% BI: 1.1%
[libx264 @ 0x1fc9630] final ratefactor: 19.89
[libx264 @ 0x1fc9630] 8x8 transform intra:24.4% inter:75.0%
[libx264 @ 0x1fc9630] coded y,uvDC,uvAC intra: 41.0% 68.8% 43.0% inter: 2.5% 7.3% 2.3%
[libx264 @ 0x1fc9630] i16 v,h,dc,p: 30% 68%  1%  1%
[libx264 @ 0x1fc9630] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 47% 16%  1%  0%  1%  1%  1%  1%
[libx264 @ 0x1fc9630] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 44%  9%  1%  2%  1%  2%  3%  2%
[libx264 @ 0x1fc9630] i8c dc,h,v,p: 25% 45% 28%  2%
[libx264 @ 0x1fc9630] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x1fc9630] ref P L0: 83.6%  1.8% 13.1%  1.5%
[libx264 @ 0x1fc9630] ref B L0: 96.3%  3.7%
[libx264 @ 0x1fc9630] ref B L1: 89.7% 10.3%
[libx264 @ 0x1fc9630] kb/s:124.63
  • Of course you should also include the complete console output from your command. – llogan Sep 13 '15 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.