LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-19-2015, 01:00 PM   #1
xcislav
LQ Newbie
 
Registered: Feb 2011
Location: Kiev, Ukraine
Posts: 25

Rep: Reputation: 0
Post ffmpeg twitch screencast no sound (correct bitrate)


Sound is intermittent and exists in this state only few seconds of the stream.

command line
https://bpaste.net/show/82259476b5e6
the output:
https://bpaste.net/show/ca46c5b25e94

Code:
Past duration ... too large
&
Code:
[x11grab @ 0x2081740] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[alsa @ 0x206f790] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
I even found this parameter and placed in front of all of them.

Quote:
-thread_queue_size 512
Quote:
ffmpeg -thread_queue_size 512 -f alsa -ac 2 -i hw:0,0 -f x11grab -framerate 30 -video_size 1280x1024 -i :0.0+0,0 -vcodec libx264 -preset veryfast -maxrate 1984k -bufsize 3968k -vf "format=yuv420p" -g 60 -acodec libmp3lame -b:a 96k -ar 44100 -f flv
But after 30 seconds audio finally stops forever.

Last edited by xcislav; 10-19-2015 at 01:24 PM. Reason: add info parameter
 
Old 10-23-2015, 12:37 PM   #2
xcislav
LQ Newbie
 
Registered: Feb 2011
Location: Kiev, Ukraine
Posts: 25

Original Poster
Rep: Reputation: 0
still sound recording problem regarding flv / h264

I'm getting from "time to time" sound, how to say... choppy, intermittent 1 second it plays 2 seconds no sound:

Code:
ffmpeg -f alsa -ac 1 -i hw:0,0 -f x11grab -framerate 25 -video_size 1280x1024 -i :0.0+0,0 -vcodec libx264 -maxrate 15000k -bufsize 15000k -acodec libfdk_aac -b:a 32k -ar 11025 -f flv num55.flv
The more I change audio codecs to fit the flv container (that is the format which I'm trying) the more I'm thinking it's the codecs part. How could it be that codecs went wrong? How to debug/fix, find where my problem in system is etc...?

If i record just an mp3 for vorbis audio file - all is Ok, it works... no problem. But when I need flv video for a twitch screencast - then big NO(((
 
Old 10-23-2015, 01:20 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
please provide us with an example command that is supposed to work.
from your pastes i tried
Code:
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -framerate 30 -video_size 1280x1024 -i :0.0+0,0 -vcodec libx264 -preset veryfast -maxrate 1984k -bufsize 3968k -vf format=yuv420p -g 60 -acodec libmp3lame -b:a 96k -ar 44100 -f flv 'rtmp://live.twitch.tv/app/live_100571654_3GRona33f8mCtHKYeCjnqLzNDNewf7'
but it just hangs and isn't downloading anything.
maybe that stream is dead now.

also, have you tried using ffplay?

also, from your first post i got the impression that you just want to play back a stream, now you talk about recording.
please clarify what you are trying to achieve.

Last edited by ondoho; 10-23-2015 at 01:21 PM.
 
Old 10-23-2015, 06:16 PM   #4
xcislav
LQ Newbie
 
Registered: Feb 2011
Location: Kiev, Ukraine
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ondoho View Post
please provide us with an example command that is supposed to work.
from your pastes i tried
Code:
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -framerate 30 -video_size 1280x1024 -i :0.0+0,0 -vcodec libx264 -preset veryfast -maxrate 1984k -bufsize 3968k -vf format=yuv420p -g 60 -acodec libmp3lame -b:a 96k -ar 44100 -f flv 'rtmp://live.twitch.tv/app/live_100571654_3GRona33f8mCtHKYeCjnqLzNDNewf7'
but it just hangs and isn't downloading anything.
maybe that stream is dead now.

also, have you tried using ffplay?

also, from your first post i got the impression that you just want to play back a stream, now you talk about recording.
please clarify what you are trying to achieve.
ondoho,
Thank you for your reply! AFAIK ffplay is a frontend to ffmpeg.

I'm recording my stream for test.
twitch.tv/xsy_/profile
(here you could see many past attempts)
I've been trying for one week with no sound so long that i've even got 1 subscriber (oh.. LOL!)
And
http://www.twitch.tv/xsy_/v/22092758
This last record, with the record command which you quoted shows some breaking through advertisement on this page (where i'm writing these lines)...

I repeat again, yes I'm recording. And in order to record I'm performing audio tests. And UNFORTUNATELY all audio codecs that i'm choosing failed with the main audio task: -acodec libmp3lame (also: aac, libfaac, libfdk_aac, pcm_s16le, adpcm_swf ...).
On ffmpeg forum they suggested me to output not via that site, but to local file:
http://ffmpeg.gusari.org/viewtopic.p...4&p=7063#p7073
And from that time I'm trying writing tests to local .flv file.

AFAIK (from search) FLV (flash) is the only container which i am able to use when going on twitch!


Those are all compatible audio codecs for FLV I found (not so much):
https://trac.ffmpeg.org/wiki/Support...TypesInFormats

Those are USE flags (I added them for trying for now)

Code:
[ebuild   R    ] media-video/ffmpeg-2.8.1:0/54.56.56::gentoo  USE="X aac alsa bzip2 celt encode faac fdk gpl gsm hardcoded-tables iconv librtmp libsoxr mp3 network opengl opus postproc pulseaudio sdl speex theora threads truetype twolame vorbis vpx x264 x265 xcb xvid zlib -aacplus (-altivec) -amr -amrenc (-armv5te) (-armv6) (-armv6t2) (-armvfp) -bluray -bs2b -cdio -cpudetection -debug -doc -examples -flite -fontconfig -frei0r -fribidi -gme -gnutls -iec61883 -ieee1394 -jack -jpeg2k -ladspa -libass -libcaca -libressl -libv4l -lzma (-mipsdspr1) (-mipsdspr2) (-mipsfpu) -modplug (-neon) -openal -openssl -oss -pic -quvi -samba -schroedinger -snappy -ssh -static-libs {-test} -v4l -vaapi -vdpau -wavpack -webp -zvbi" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="mmx mmxext sse sse2 -3dnow -3dnowext -avx -avx2 -fma3 -fma4 -sse3 -sse4_1 -sse4_2 -ssse3 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher" 0 KiB
And again from the the output:

Quote:
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'hw:0,0':
Duration: N/A, start: 1445639209.493453, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Input #1, x11grab, from ':0.0+0,0':
Duration: N/A, start: 1445639209.527357, bitrate: N/A
Stream #1:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x1024, 30 fps, 30 tbr, 1000k tbn, 30 tbc
[libx264 @ 0x156c3c0] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x156c3c0] profile High, level 3.2
[libx264 @ 0x156c3c0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 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=1 keyint=60 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1984 vbv_bufsize=3968 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://live.twitch.tv/app/live_100571654_3GRona33f8mCtHKYeCjnqLzNDNewf7':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1280x1024, q=-1--1, max. 1984 kb/s, 30 fps, 1k tbn, 30 tbc
Metadata:
encoder : Lavc56.60.100 libx264
Stream #0:1: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, s16p, 96 kb/s
Metadata:
encoder : Lavc56.60.100 libmp3lame
Stream mapping:
Stream #1:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Stream #0:0 -> #0:1 (pcm_s16le (native) -> mp3 (libmp3lame))
I hope it's normal,
Quote:
Stream #1:0 -> #0:0
Stream #0:0 -> #0:1
and besides sound appears (though, bad).

I even tried -async 1 parameter (and other following numbers) - no sound at all.

yesterday I updated all the system/kernel emerge -avDuN @world . to make sure () that it's flv+ audio codecs - though, it's only psychological impression (no forum actually really replied to my thoughts)... (i see recording sound and i recorded arecord few audiobooks myself(((

And finally about ffcast. Why not.. I will try and it is emerging. AFAIK it's a graphical frontend (only a cover .. a graphical shell for ffmpeg).

Last edited by xcislav; 10-23-2015 at 06:37 PM.
 
Old 10-24-2015, 03:31 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i thought you wanted to stream, and maybe record, an internet stream to your local machine.
you have not provided a command that is supposed to reproduce the problem (i phrased that wrongly in my previous post).

i don't even know what twitch.tv is - i couldn't look at your example pages even with temporarily disabling my privacy & security addons. usually a bad sign for a website.

you could upload that local .flv file somewhere, and provide us with a command that is supposed to work / reproduce the problem, together with a link to that file (so that people intersted in helping you can download that file to their own machines and try).
 
  


Reply

Tags
ffmpeg, screencast



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Audio problems while streaming (twitch.tv, avconv/ffmpeg + alsa/pulse). earthw0rmjim Linux - Software 1 10-20-2013 08:56 AM
Using ffmpeg to record sound from speakers p3aul Ubuntu 12 06-26-2012 07:45 AM
ffmpeg bitrate problem J_angel2000 Linux - Software 2 05-14-2007 03:10 PM
SOUND Correct driver installed but still no sound smOk3 Linux - Hardware 2 03-02-2007 12:44 PM
Ok Finegan...Home stretch to becoming an addict. *twitch twitch* taz.devil General 18 04-07-2002 04:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration