You are not logged in.

#1 2015-05-27 14:58:26

doc1623
Member
Registered: 2013-08-08
Posts: 10

ffmpeg no sound

trying to get high quaility video with sound

works but low quality

ffmpeg -f alsa -i pulse -f v4l2 -s 1920x1080 -i /dev/video1 output.mpg

blows up

ffmpeg -f alsa -i pulse -f v4l2 -s 1920X1080 -i /dev/video1 -acodec flac -vcodec libx264 -aspect 16:9 output.mpg
[mpeg @ 0x7f27f80d31c0] buffer underflow st=0 bufi=269361 size=271919
[mpeg @ 0x7f27f80d31c0] buffer underflow st=0 bufi=271402 size=271919
[mpeg @ 0x7f27f80d31c0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x7f27f80d31c0] buffer underflow st=0 bufi=271402 size=271919
[mpeg @ 0x7f27f80d31c0] buffer underflow st=1 bufi=0 size=0
    Last message repeated 1 times

Last message counts to the thousands... control c


plays back without sound

ffmpeg -f alsa -i default -f v4l2 -s 1920X1080 -i /dev/video1 -acodec flac -vcodec libx264 -aspect 16:9 -r 30 output.mkv

mplayer output.mkv

 
MPlayer SVN-r37379 (C) 2000-2015 MPlayer Team
210 audio & 441 video codecs
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing output.mkv.
libavformat version 56.25.101 (internal)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (flac), -aid 0
VIDEO:  [H264]  1920x1080  0bpp  30.000 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 ENCODER: Lavf56.25.101
Load subtitles in ./
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 56.26.100 (internal)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 32000 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->128000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
[AO_ALSA] alsa-lib: pcm_hw.c:1583:(snd_pcm_hw_open) open '/dev/snd/pcmC2D0p' failed (-2): No such file or directory
[AO_ALSA] Playback open error: No such file or directory
AO: [pulse] 32000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1920x1080 => 1920x1080 Planar YV12 
A:   0.0 V:   5.7 A-V: -5.733 ct: -0.063   0/  0 16%  1%  0.0% 0 0 

this works
ffmpeg -f alsa -ac 2 -i hw:2,0 out.wav

Last edited by doc1623 (2015-05-27 16:29:40)

Offline

#2 2015-05-27 15:17:49

doc1623
Member
Registered: 2013-08-08
Posts: 10

Re: ffmpeg no sound

**** List of CAPTURE Hardware Devices ****
card 1: Generic [HD-Audio Generic], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: C920 [HD Pro Webcam C920], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
%cat .asoundrc
pcm.!default {
type hw
card 2
}

ctl.!default {
type hw
card 2
}

Last edited by doc1623 (2015-05-27 16:31:39)

Offline

#3 2015-05-27 16:07:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: ffmpeg no sound

When posting configs, code or command output, please use [ code ] tags https://bbs.archlinux.org/help.php#bbcode

like this

It makes the code more readable and - in case of longer listings - more convenient to scroll through.

I have no idea about transcoding, so I can offer just some wild guesses.
mplayer should support something like 'lirc=no' to get rid of some warnings. You can use a more verbose output to see what's going on. Try a different AO, maybe it's PA fault? Have you tried playing it with mpv or vlc?

Offline

#4 2015-05-27 16:23:57

doc1623
Member
Registered: 2013-08-08
Posts: 10

Re: ffmpeg no sound

Sorry bout the formatting. I've worked on this since 4am.


I'm not worried about the error messages. Just want to hear sound!....


Hopefully it's better now

Last edited by doc1623 (2015-05-27 16:32:36)

Offline

#5 2015-05-27 18:09:54

teckk
Member
Registered: 2013-02-21
Posts: 590

Re: ffmpeg no sound

ffmpeg -f alsa -i pulse -f v4l2 -s 1920x1080 -i /dev/video1 output.mpg

Specify the audio and video bitrate that you want for better quality.

Example:

ffmpeg -i ... -c:a libmp3lame -b:a 192k -c:v libx264 -b:v 2000k -r 24..

-s 1920X1080 is big, you may not be able to capture and encode that all at once. Especially 30 frames per second. Drop your framerate, or dump raw and encode it later.

Turn your mixer controls up. FFmpeg can amplify sound (128 = 100%, 256 = 200%) etc.

ffmpeg -i .... -vol 256 ...

Look at man ffmpeg
or

man -t ffmpeg | ps2pdf - ManFFmpeg.pdf

https://www.ffmpeg.org/documentation.html
https://ffmpeg.org/ffmpeg.html
https://trac.ffmpeg.org/wiki/TitleIndex

Offline

#6 2015-05-27 18:11:47

esa
Member
Registered: 2011-12-29
Posts: 143
Website

Re: ffmpeg no sound

Any luck with?

ffmpeg  -f v4l2 -s 1920x1080 -i /dev/video1 -c:v libx264 -i :0 -f alsa -i default -c:a aac -ac 2 -strict -2  -f mp4 "output.mp4"

There is always the option to manualy increase the bitrate, and hope this changes anything.


Author of: TUI (Text User Interface for scripts), VHS (Video Handler Script, using ffmpeg) and YASSI (Yet Another Simple Script Installer)

Offline

Board footer

Powered by FluxBB