Re: [FFmpeg-user] ffmpeg HIGH CPU, http streaming with libmp3lame

2019-02-06 Thread Moritz Barsnick
On Tue, Feb 05, 2019 at 21:05:33 +0100, Zoltan Kerenyi Nagy wrote:
> I see, however do you think it is normal that recording to 300 sec wav
> segments digests 4% CPU, in contrast with streaming with mp3 conversion and
> recording to wav at the same time digest 90-100% CPU on an ARM7 device
> which has 4 cores an 625 Mhz CPU and 256MB ram?

Did you read Carl Eugen's hint that there may be some format conversion
involved, which you can avoid if you request the correct format from
ALSA (IIUC)?

https://ffmpeg.org/pipermail/ffmpeg-user/2019-February/043140.html

Aprart from that, encoding to WAV (i.e. PCM) is extremely easy on the
CPU, unlike encoding to "more" compressed formats.

Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg HIGH CPU, http streaming with libmp3lame

2019-02-06 Thread Ted Park


> On Feb 5, 2019, at 3:05 PM, Zoltan Kerenyi Nagy 
>  wrote:
> 
> I see, however do you think it is normal that recording to 300 sec wav
> segments digests 4% CPU, in contrast with streaming with mp3 conversion and
> recording to wav at the same time digest 90-100% CPU on an ARM7 device
> which has 4 cores an 625 Mhz CPU and 256MB ram?

Probably not, even if there was an increase it shouldn’t be much more than 
twice at its worst


> On Feb 5, 2019, at 12:15 PM, Zoltan Kerenyi Nagy 
>  wrote:
> 
> The CPU usage is still abobe 90% with libshine. Do you think that something
> is buggy with my script?
> https://pastebin.com/dyHK6ATh 

> #!/bin/bash
> folder="/home/$USER/recordings"
> ffserver -f /etc/ffserver.conf &
> sleep 2
>  
> mkfifo /tmp/fifo1 2>/dev/null
> mkdir -p "$folder"
>  
> while true;do
> day=$(date '+%Y-%m-%d')
> mkdir -p "$folder"/"$day"
> ffmpeg -f alsa -i hw:0,0 http://localhost:/audio.ffm -f wav pipe:1 > 
> /tmp/fifo1 &
> ffmpeg -i /tmp/fifo1 -ss 0 -t 300 -ar 44100 "$folder"/"$day"/"$(date 
> '+%Y-%m-%d__%H_%M')".wav
> done
>  
> exit 0

Does this script work? I am suspicious of the while loop with the fifo. Pretty 
sure it wouldn’t do what you want, there would be a break in the audio every 
five minutes. Maybe you could use the segment muxer?

ffmpeg -f alsa -i hw:0,0 http://localhost:/audio.ffm 
 -ar 44100 -f segment -strftime 1 
-segment_time 300 %Y-%m-%d__%H_%M.wav

Only thing is it wouldn’t create the directory structure.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg HIGH CPU, http streaming with libmp3lame

2019-02-05 Thread Zoltan Kerenyi Nagy
I see, however do you think it is normal that recording to 300 sec wav
segments digests 4% CPU, in contrast with streaming with mp3 conversion and
recording to wav at the same time digest 90-100% CPU on an ARM7 device
which has 4 cores an 625 Mhz CPU and 256MB ram?

On Tue, 5 Feb 2019 at 19:14, Lou Logan  wrote:

> On Tue, Feb 5, 2019, at 8:15 AM, Zoltan Kerenyi Nagy wrote:
> > Hi,
> >
> > The CPU usage is still abobe 90% with libshine. Do you think that
> something
> > is buggy with my script?
> > https://pastebin.com/dyHK6ATh
> >
> > Zoli
>
> 1. I've never used ffserver so I can't comment on that.
>
> 2. We don't provide support for scripts here: it complicates matters.
> Please just provide your actual, unscripted ff* commands and the complete
> console outputs in a reply (not a link).
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg HIGH CPU, http streaming with libmp3lame

2019-02-05 Thread Lou Logan
On Tue, Feb 5, 2019, at 8:15 AM, Zoltan Kerenyi Nagy wrote:
> Hi,
> 
> The CPU usage is still abobe 90% with libshine. Do you think that something
> is buggy with my script?
> https://pastebin.com/dyHK6ATh
> 
> Zoli

1. I've never used ffserver so I can't comment on that.

2. We don't provide support for scripts here: it complicates matters. Please 
just provide your actual, unscripted ff* commands and the complete console 
outputs in a reply (not a link).
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg HIGH CPU, http streaming with libmp3lame

2019-02-05 Thread Zoltan Kerenyi Nagy
Hi,

The CPU usage is still abobe 90% with libshine. Do you think that something
is buggy with my script?
https://pastebin.com/dyHK6ATh

Zoli

On Tue, 5 Feb 2019 at 01:19, Lou Logan  wrote:

> On Mon, Feb 4, 2019, at 11:31 AM, Zoltan Kerenyi Nagy wrote:
> > Hi All,
> >
> > For some reason the CPU is insanely high, hitting almost all the time
> 100%,
> > I run ffmpeg on an ARM7 4 core embedded device.
> >
> > This is the setup, how I do it:
> >
> > ffserver -d -f /etc/ffserver.conf
> > ffmpeg -f alsa -i hw:0,0 http://localhost:/audio.ffm
>
> You can see if libshine gives you better performance likely at the cost of
> quality per bit but it may not matter. You'll need to compile with
> "--enable-libshine" and encode with "-c:a libshine" unless it is the only
> MP3 encoder.
>
> > ffmpeg -f alsa -i hw:0,0-ar 8000 http://localhost:/audio.ffm
>
> Use the "-sample_rate" ALSA private option (before the input) if you want
> to change the sample rate, otherwise ffmpeg will use the default ALSA value
> of 48000 and resample to 8000.
>
> https://ffmpeg.org/ffmpeg-devices.html#alsa
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg HIGH CPU, http streaming with libmp3lame

2019-02-04 Thread Lou Logan
On Mon, Feb 4, 2019, at 11:31 AM, Zoltan Kerenyi Nagy wrote:
> Hi All,
> 
> For some reason the CPU is insanely high, hitting almost all the time 100%,
> I run ffmpeg on an ARM7 4 core embedded device.
> 
> This is the setup, how I do it:
> 
> ffserver -d -f /etc/ffserver.conf
> ffmpeg -f alsa -i hw:0,0 http://localhost:/audio.ffm

You can see if libshine gives you better performance likely at the cost of 
quality per bit but it may not matter. You'll need to compile with 
"--enable-libshine" and encode with "-c:a libshine" unless it is the only MP3 
encoder.

> ffmpeg -f alsa -i hw:0,0-ar 8000 http://localhost:/audio.ffm

Use the "-sample_rate" ALSA private option (before the input) if you want to 
change the sample rate, otherwise ffmpeg will use the default ALSA value of 
48000 and resample to 8000.

https://ffmpeg.org/ffmpeg-devices.html#alsa
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg HIGH CPU, http streaming with libmp3lame

2019-02-04 Thread Carl Eugen Hoyos
2019-02-04 21:31 GMT+01:00, Zoltan Kerenyi Nagy :

> I was experimenting with these parameters, however the CPU
> usage never changed:
>
> ffmpeg -f alsa -i hw:0,0-ar 8000 http://localhost:/audio.ffm
> ffmpeg -f alsa -i hw:0,0 -b:a 128k http://localhost:/audio.ffm
>
> Do you have any idea, why this procedure  is so CPU intense?

I am not sure iirc but FFmpeg requests a sample fmt from alsa
that alsa does not natively provide and therefore starts to do
useless conversions, you have to find out which format avoids
these.
(Iirc!)

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".