LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-20-2019, 02:23 AM   #1
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 197

Rep: Reputation: Disabled
ffmpeg streaming


Hi,

Do you know how could I listen into the stream with VLC?

This runs on the device:
Code:
ffmpeg -f alsa -re -i hw:0,0 -acodec libmp3lame -ab 32k -ac 1 -shortest -f rtp rtp://127.0.0.1:4444
Either does it work:
Quote:
ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -ar 8000 -f mulaw -f rtp rtp://localhost:4444
I tried this with the other laptop:
Code:
vlc rtp://<IP>:4444/live.sdp
vlc rtp://<IP>:4444

Last edited by kzo81; 03-20-2019 at 02:26 AM.
 
Old 03-20-2019, 01:24 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,901

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
have you checked this page already: https://trac.ffmpeg.org/wiki/StreamingGuide ?
 
Old 03-20-2019, 02:25 PM   #3
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 197

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
have you checked this page already: https://trac.ffmpeg.org/wiki/StreamingGuide ?
Yes.
 
Old 10-16-2019, 07:08 AM   #4
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 197

Original Poster
Rep: Reputation: Disabled
ffmpeg streaming

Having checked the documentation I can stream the audio with this script:

Code:
#!/bin/bash

streaming_port=4444

ffserver_config="/etc/ffserver.conf"

if [ ! -e "$ffserver_config" ];then
cat > "$ffserver_config" <<EOF

HTTPPort ${streaming_port}
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 10
MaxClients 10
MaxBandwidth 4096
CustomLog /var/log/ffserver.log

<Feed audio.ffm>
        File /tmp/audio.ffm
        FileMaxSize 1024M
</Feed>

<Stream audio>
	Feed audio.ffm
        Format wav
        AudioCodec pcm_s16le
        AudioBitRate 256
        AudioChannels 2
        AudioSampleRate 16000
        NoVideo
        StartSendOnKey
</Stream>

<Stream stat.html>
        Format status
</Stream>
EOF
fi
#
ffserver -f /etc/ffserver.conf &

#
sleep 3

ffmpeg -f alsa -i hw:0,0 -acodec pcm_s16le -shortest http://localhost:${streaming_port}/audio.ffm
It works until /var/volatile folder reaches 100%. Do you know any idea how to prevent this? I need the streaming 0-24.
 
Old 10-16-2019, 12:00 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,901

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
what is in that folder?
 
1 members found this post helpful.
Old 10-17-2019, 12:46 AM   #6
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 197

Original Poster
Rep: Reputation: Disabled
Wink

Quote:
Originally Posted by pan64 View Post
what is in that folder?
a copy of this file: /tmp/audio.ffm

I figured out in the meantime that if I set this FileMaxSize 1024M in the config file to FileMaxSize 32M than that file doesnt grow over. I'm still testing. Thanks though!
 
  


Reply



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
Install ffmpeg for PHP ( ffmpeg-php extension ) shlomi.s Linux - Software 2 02-02-2010 12:52 AM
ffmpeg: symbol lookup error: ffmpeg: undefined symbol: avformat_alloc_context YeeHaa4LINUX Linux - Software 2 10-16-2009 11:09 PM
Help me in installing ffmpeg, ffmpeg-PHP, Mplayer, Mencoder, flv2tool, LAME MP3 Encod mitesh.ever Red Hat 5 05-16-2009 12:14 PM
Does the latest version of ffmpeg not work with ffmpeg-php? whitey4900 Linux - Software 0 08-04-2008 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:25 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