i.mx283 / armv5te 아키텍쳐의
dsp enchancement 명령을 사용하기 위한 컴파일 옵션

--cpu=armv5te --enable-armv5te 

코덱마다 다르고 시간마다 달라 정형화하기 힘들지만
classic channel 인터넷 방송은 정상재생이냐 끊어지냐 수준
80% vs 13% 급이고

mbc fm 은
거의 차이가 없는 78% 이나
load average가 5.0 vs 4.8 정도로 유의미하게 나진 않는다

[링크 : http://ffmpeg.org/pipermail/ffmpeg-user/2011-May/000833.html]

'프로그램 사용 > ffmpeg & ffserver' 카테고리의 다른 글

ASLA 입출력 - mplayer / ffmpeg  (0) 2014.09.29
ffmpeg armv5te performance  (0) 2014.09.26
lame을 이용한 mp3 포맷변경  (0) 2014.09.24
ubuntu에서 ffmpeg 컴파일하기  (0) 2010.01.14
ffserver.conf 때려잡기  (0) 2009.11.24
Posted by 구차니
테스트용으로
channel  / samping rate / bitrate  등을 변경하기 위한 방법

#!/bin/sh

# CBR - channel / bitrate / resample
# VBR - channel / quality / resample

# bitrate - CBR
# MPEG1 - 320 256 224 192 160 128 118 96 80 64 56 48 40 32
# MPEG2 - 160 144 128 112 96 80 64 56 48 40 32 24 16 8

# bitrate - VBR
# 9 8 7 6 5 4 3 2 1 0

# sampling
# mpeg1-3 48 44.1 32
# mpeg2-3 24 22.05 16
# mpeg2.5-3 12 11.025 8

for rate in 48 44.1 32
do
        for bps in 320 256 224 192 160 128 118 96 80 64 56 48 40 32
        do
                lame -b ${bps} -m s --resample ${rate} $1 C${bps}bps_${rate}KH_2ch.mp3
                lame -b ${bps} -m m --resample ${rate} $1 C${bps}bps_${rate}KH_1ch.mp3
        done
done

for rate in 48 44.1 32
do
        for bps in 9 8 7 6 5 4 3 2 1 0
        do
                lame -V ${bps} -m s --resample ${rate} $1 V${bps}bps_${rate}KH_2ch.mp3
                lame -V ${bps} -m m --resample ${rate} $1 V${bps}bps_${rate}KH_1ch.mp3
        done
done 

위와 같이 변경하니. 320kbps가 
---
mp3가 mpeg1 layer3인데.
mpeg2 layer3 와
mpeg2.5 layer3는 도무지 뭔지 ㅠㅠ

       -m mode
              mode = s, j, f, d, m

              Joint-stereo is the default mode for stereo files with VBR  when  -V  is  more  than  4  or  fixed
              bitrates  of  160kbs  or  less.   At  higher fixed bitrates or higher VBR settings, the default is
              stereo.

              (s)imple stereo
              In this mode, the encoder makes no use of potentially existing correlations between the two  input
              channels.   It  can, however, negotiate the bit demand between both channel, i.e. give one channel
              more bits if the other contains silence or needs less bits because of a lower complexity.

              (j)oint stereo
              In this mode, the encoder will make use of a correlation between both channels.  The  signal  will
              be  matrixed into a sum ("mid"), computed by L+R, and difference ("side") signal, computed by L-R,
              and more bits are allocated to the mid channel.  This will effectively increase the  bandwidth  if
              the  signal  does  not have too much stereo separation, thus giving a significant gain in encoding
              quality.

              Using mid/side stereo inappropriately can  result  in  audible  compression  artifacts.   To  much
              switching  between mid/side and regular stereo can also sound bad.  To determine when to switch to
              mid/side stereo, LAME uses a much more sophisticated algorithm than that described in the ISO doc‐
              umentation, and thus is safe to use in joint stereo mode.

              (f)orced MS stereo
              This  mode  will  force  MS stereo on all frames.  It is slightly faster than joint stereo, but it
              should be used only if you are sure that every frame of the input file has very little stereo sep‐
              aration.

              (d)ual mono
              In  this  mode,  the  2  channels  will  be totally independently encoded.  Each channel will have
              exactly half of the bitrate.  This mode is designed for applications like dual languages  encoding
              (for example: English in one channel and French in the other).  Using this encoding mode for regu‐
              lar stereo files will result in a lower quality encoding.

              (m)ono
              The input will be encoded as a mono signal.  If it was a stereo signal, it will be downsampled  to
              mono.  The downmix is calculated as the sum of the left and right channel, attenuated by 6 dB. 

       --resample sfreq
              sfreq = 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48
              Select output sampling frequency (only supported for encoding).
              If not specified, LAME will automatically resample the input when using high compression ratios. 

       CBR (constant bitrate, the default) options:

       -b n   For MPEG1 (sampling frequencies of 32, 44.1 and 48 kHz)
              n = 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320

              For MPEG2 (sampling frequencies of 16, 22.05 and 24 kHz)
              n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160

              Default is 128 for MPEG1 and 64 for MPEG2.

       --cbr  enforce use of constant bitrate

       ABR (average bitrate) options:

       --abr n
              Turns  on encoding with a targeted average bitrate of n kbits, allowing to use frames of different
              sizes.  The allowed range of n is 8 - 310, you can use any integer value within that range.

              It can be combined with the -b and -B switches like: lame --abr 123 -b 64 -B 192 a.wav a.mp3 which
              would limit the allowed frame sizes between 64 and 192 kbits.

              The  use  of  -B  is NOT RECOMMENDED.  A 128 kbps CBR bitstream, because of the bit reservoir, can
              actually have frames which use as many bits as a 320 kbps frame.  VBR modes minimize  the  use  of
              the  bit  reservoir,  and  thus  need  to allow 320 kbps frames to get the same flexibility as CBR
              streams.

       VBR (variable bitrate) options:

       -v     use variable bitrate (--vbr-old)

       --vbr-old
              Invokes the oldest, most tested VBR algorithm.  It produces very good quality files, though is not
              very fast.  This has, up through v3.89, been considered the "workhorse" VBR algorithm.

       --vbr-new
              Invokes the newest VBR algorithm.  During the development of version 3.90, considerable tuning was
              done on this algorithm, and it is now considered to be on par with the original --vbr-old.  It has
              the added advantage of being very fast (over twice as fast as --vbr-old).

       -V n   0 <= n <= 9
              Enable  VBR  (Variable BitRate) and specifies the value of VBR quality (default = 4).  0 = highest
              quality.

[링크 : http://tuxtweaks.com/2008/08/how-to-resample-mp3-audio-files-on-linux-using-lame/

'프로그램 사용 > ffmpeg & ffserver' 카테고리의 다른 글

ffmpeg armv5te performance  (0) 2014.09.26
ffmpeg armv5te 옵션  (0) 2014.09.25
ubuntu에서 ffmpeg 컴파일하기  (0) 2010.01.14
ffserver.conf 때려잡기  (0) 2009.11.24
ffserver의 상태페이지 (stat.html)  (0) 2009.11.05
Posted by 구차니
소스는 tarball이던 svn이건 상관없을려나?

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
[링크 : http://www.ffmpeg.org/download.html]

./configure --enable-libopencore-amrnb  --enable-libopencore-amrwb --enable-version3

libopencore-amrnb 와 libopencore-amrwb 를 사용하려면 version3로 라이센스를 바꾸어야 한다.
(upgrade (L)GPL to version 3)



머.. 그 다음에는 make/make install

$ ffmpeg --help | grep amr
FFmpeg version SVN-r21186, Copyright (c) 2000-2010 Fabrice Bellard, et al.
  built on Jan 14 2010 00:21:22 with gcc 4.4.1
  configuration: --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3
  libavutil     50. 7. 0 / 50. 7. 0
  libavcodec    52.47. 0 / 52.47. 0
  libavformat   52.46. 0 / 52.46. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 8. 0 /  0. 8. 0

'프로그램 사용 > ffmpeg & ffserver' 카테고리의 다른 글

ffmpeg armv5te 옵션  (0) 2014.09.25
lame을 이용한 mp3 포맷변경  (0) 2014.09.24
ffserver.conf 때려잡기  (0) 2009.11.24
ffserver의 상태페이지 (stat.html)  (0) 2009.11.05
ffserver , ffserver.conf  (0) 2009.11.03
Posted by 구차니
Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
CustomLog -
NoDaemon

<Feed feed1.ffm>
    File /tmp/feed1.ffm
    FileMaxSize 200K
    ACL allow 127.0.0.1
</Feed>

<Stream test1.mpg>
    Feed feed1.ffm
    Format mpeg
    AudioBitRate 32
    AudioChannels 1
    AudioSampleRate 44100
    VideoBitRate 64
    VideoBufferSize 40


#    VideoIntraOnly
    VideoGopSize 12
#    NoAudio
#    NoVideo
#    VideoQMin 3
#    VideoQMax 31
#    Preroll 15
#    ACL ALLOW <first address>
#    ACL DENY <first address>
</Stream>

#<Stream test.mjpg>
#    Feed feed1.ffm
#    Format mpjpeg
#    VideoFrameRate 2
#    VideoIntraOnly
#    NoAudio
#    Strict -1
#</Stream>

#<Stream test.jpg>
#    Feed feed1.ffm
#    Format jpeg
#    VideoFrameRate 2
#    VideoIntraOnly
#    VideoSize 352x240
#    NoAudio
#    Strict -1
#</Stream>

#<Stream test.swf>
#    Feed feed1.ffm
#    Format swf
#    VideoFrameRate 2
#    VideoIntraOnly
#    NoAudio
#</Stream>

<Stream test.asf>
    Feed feed1.ffm
    Format asf
    VideoFrameRate 15
    VideoSize 352x240
    VideoBitRate 256
    VideoBufferSize 40
    VideoGopSize 30
    AudioBitRate 64
    StartSendOnKey
</Stream>

#<Stream test.mp3>
#    Feed feed1.ffm
#    Format mp2
#    AudioCodec mp3
#    AudioBitRate 64
#    AudioChannels 1
#    AudioSampleRate 44100
#    NoVideo
#</Stream>

#<Stream test.ogg>
#    Feed feed1.ffm
#    Title "Stream title"
#    AudioBitRate 64
#    AudioChannels 2
#    AudioSampleRate 44100
#    NoVideo
#</Stream>

#<Stream test.ra>
#    Feed feed1.ffm
#    Format rm
#    AudioBitRate 32
#    NoVideo
#    NoAudio
#</Stream>

#<Stream test.rm>
#    Feed feed1.ffm
#    Format rm
#    AudioBitRate 32
#    VideoBitRate 128
#    VideoFrameRate 25
#    VideoGopSize 25
#    NoAudio
#</Stream>

#<Stream file.rm>
#    File "/usr/local/httpd/htdocs/tlive.rm"
#    NoAudio
#</Stream>

#<Stream file.asf>
#    File "/usr/local/httpd/htdocs/test.asf"
#    NoAudio
#    Author "Me"
#    Copyright "Super MegaCorp"
#    Title "Test stream from disk"
#    Comment "Test comment"
#</Stream>

File 이 들어 가는건 VLC에서 트랜스코딩이 비활성화 된 스트림이라고 생각된다.





#<Stream test1-rtsp.mpg>
#    Format rtp
#    File "/usr/local/httpd/htdocs/test1.mpg"
#</Stream>

#<Stream test1-sdp.mpg>
#    Format rtp
#    File "/usr/local/httpd/htdocs/test1.mpg"
#    MulticastAddress 224.124.0.1
#    MulticastPort 5000
#    MulticastTTL 16
#    NoLoop
#</Stream>

<Stream stat.html>
    Format status
    ACL allow localhost
    ACL allow 192.168.0.0 192.168.255.255
</Stream>

<Redirect index.html>
    URL http://www.ffmpeg.org/
</Redirect>
Posted by 구차니
ffserver.conf의 설정에 따라 다르지만

Format status 항목의 이름에 따른 페이지로 접속하면된다.
기본값은 stat.html로 되어있다.

<Stream stat.html>
Format status

ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255


위와 같은 화면이 나오게 되면 일단 서버는 이상없이 돌아가는 건데..
희한하게 여전히.. 스트리밍에는 오류가 나네 ㅠ.ㅠ


2009/11/25 추가
곰 플레이어나 / 윈도우 미디어 플레이어에서 잘 안되면
일단  VLC로 확인 해보는것이 좋음. 곰에서는 잘 연결이 안됨.
Posted by 구차니
The server is too busy to serve your request at this time.

The bandwidth being served (including your stream) is 3758kbit/sec, and this exceeds the limit of 1000kbit/sec.
http://localhost:8090/feed1.ffm 로 접속하니 위와 같은 에러가 난다.

<Stream test.asf>
Feed feed1.ffm
Format asf
VideoFrameRate 30
VideoSize 320x240
VideoBitRate 1872
VideoBufferSize 4000
VideoGopSize 30
AudioBitRate 1886
StartSendOnKey
</Stream>
ffserver.conf의 설정은 video가 1872kb / audio 가 1886kb 였고
합쳐서 3758kb 인데 이는 1000kbit의 데이터 폭을 넘어선다는 에러인 듯 하다.


아무튼 http://localhost:8090/test.asf로 접속하면


위와 같은 화면이 뜬다.
(아직 스트리밍은 실패 ㅠ.ㅠ)
Posted by 구차니
우분투 8.04에서 Logitech Quickcam Pro 4000으로 스트리밍 서버 만드는 방법이다.

$ ffserver -f ./ffserver.conf
$ ffmpeg -y -f video4linux -r 30 -s 160x120 -i /dev/video0 http://localhost:8090/feed1.ffm
웹브라우저 http://xxx.xxx.xxx.xxx:8090/stream.asf

[링크 : http://sound79.tistory.com/105]

머.. ffmpeg 홈페이지의 ffserver 문서와 다를 내용은 그리 없지만

As a simple test, just run the following two command lines where INPUTFILE is some file which you can decode with ffmpeg:

./ffserver -f doc/ffserver.conf &
./ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm

At this point you should be able to go to your Windows machine and fire up Windows Media Player (WMP). Go to Open URL and enter

    http://<linuxbox>:8090/test.asf

아무튼.. wmv 중요한건 저게 아니라 /etc/ffserver.conf 파일의 내용일 듯 하다.


ffmpeg 홈페이지의 ffserver.conf 예제파일

# Port on which the server is listening. You must select a different
# port from your standard HTTP web server if it is running on the same
# computer.
Port 8090

# Address on which the server is bound. Only useful if you have
# several network interfaces.
BindAddress 0.0.0.0

# Number of simultaneous HTTP connections that can be handled. It has
# to be defined *before* the MaxClients parameter, since it defines the
# MaxClients maximum limit.
MaxHTTPConnections 2000

# Number of simultaneous requests that can be handled. Since FFServer
# is very fast, it is more likely that you will want to leave this high
# and use MaxBandwidth, below.
MaxClients 1000

# This the maximum amount of kbit/sec that you are prepared to
# consume when streaming to clients.
MaxBandwidth 1000

# Access log file (uses standard Apache log file format)
# '-' is the standard output.
CustomLog -

# Suppress that if you want to launch ffserver as a daemon.
NoDaemon


##################################################################
# Definition of the live feeds. Each live feed contains one video
# and/or audio sequence coming from an ffmpeg encoder or another
# ffserver. This sequence may be encoded simultaneously with several
# codecs at several resolutions.

<Feed feed1.ffm>

# You must use 'ffmpeg' to send a live feed to ffserver. In this
# example, you can type:
#
# ffmpeg http://localhost:8090/feed1.ffm

# ffserver can also do time shifting. It means that it can stream any
# previously recorded live stream. The request should contain:
# "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify
# a path where the feed is stored on disk. You also specify the
# maximum size of the feed, where zero means unlimited. Default:
# File=/tmp/feed_name.ffm FileMaxSize=5M
File /tmp/feed1.ffm
FileMaxSize 200K

# You could specify
# ReadOnlyFile /saved/specialvideo.ffm
# This marks the file as readonly and it will not be deleted or updated.

# Specify launch in order to start ffmpeg automatically.
# First ffmpeg must be defined with an appropriate path if needed,
# after that options can follow, but avoid adding the http:// field
#Launch ffmpeg

# Only allow connections from localhost to the feed.
ACL allow 127.0.0.1

</Feed>


##################################################################
# Now you can define each stream which will be generated from the
# original audio and video stream. Each format has a filename (here
# 'test1.mpg'). FFServer will send this stream when answering a
# request containing this filename.

<Stream test1.mpg>

# coming from live feed 'feed1'
Feed feed1.ffm

# Format of the stream : you can choose among:
# mpeg       : MPEG-1 multiplexed video and audio
# mpegvideo  : only MPEG-1 video
# mp2        : MPEG-2 audio (use AudioCodec to select layer 2 and 3 codec)
# ogg        : Ogg format (Vorbis audio codec)
# rm         : RealNetworks-compatible stream. Multiplexed audio and video.
# ra         : RealNetworks-compatible stream. Audio only.
# mpjpeg     : Multipart JPEG (works with Netscape without any plugin)
# jpeg       : Generate a single JPEG image.
# asf        : ASF compatible streaming (Windows Media Player format).
# swf        : Macromedia Flash compatible stream
# avi        : AVI format (MPEG-4 video, MPEG audio sound)
Format mpeg

# Bitrate for the audio stream. Codecs usually support only a few
# different bitrates.
AudioBitRate 32

# Number of audio channels: 1 = mono, 2 = stereo
AudioChannels 1

# Sampling frequency for audio. When using low bitrates, you should
# lower this frequency to 22050 or 11025. The supported frequencies
# depend on the selected audio codec.
AudioSampleRate 44100

# Bitrate for the video stream
VideoBitRate 64

# Ratecontrol buffer size
VideoBufferSize 40

# Number of frames per second
VideoFrameRate 3

# Size of the video frame: WxH (default: 160x128)
# The following abbreviations are defined: sqcif, qcif, cif, 4cif, qqvga,
# qvga, vga, svga, xga, uxga, qxga, sxga, qsxga, hsxga, wvga, wxga, wsxga,
# wuxga, woxga, wqsxga, wquxga, whsxga, whuxga, cga, ega, hd480, hd720,
# hd1080
VideoSize 160x128

# Transmit only intra frames (useful for low bitrates, but kills frame rate).
#VideoIntraOnly

# If non-intra only, an intra frame is transmitted every VideoGopSize
# frames. Video synchronization can only begin at an intra frame.
VideoGopSize 12

# More MPEG-4 parameters
# VideoHighQuality
# Video4MotionVector

# Choose your codecs:
#AudioCodec mp2
#VideoCodec mpeg1video

# Suppress audio
#NoAudio

# Suppress video
#NoVideo

#VideoQMin 3
#VideoQMax 31

# Set this to the number of seconds backwards in time to start. Note that
# most players will buffer 5-10 seconds of video, and also you need to allow
# for a keyframe to appear in the data stream.
#Preroll 15

# ACL:

# You can allow ranges of addresses (or single addresses)
#ACL ALLOW <first address>

# You can deny ranges of addresses (or single addresses)
#ACL DENY <first address>

# You can repeat the ACL allow/deny as often as you like. It is on a per
# stream basis. The first match defines the action. If there are no matches,
# then the default is the inverse of the last ACL statement.
#
# Thus 'ACL allow localhost' only allows access from localhost.
# 'ACL deny 1.0.0.0 1.255.255.255' would deny the whole of network 1 and
# allow everybody else.

</Stream>


##################################################################
# Example streams


# Multipart JPEG

#<Stream test.mjpg>
#Feed feed1.ffm
#Format mpjpeg
#VideoFrameRate 2
#VideoIntraOnly
#NoAudio
#Strict -1
#</Stream>


# Single JPEG

#<Stream test.jpg>
#Feed feed1.ffm
#Format jpeg
#VideoFrameRate 2
#VideoIntraOnly
##VideoSize 352x240
#NoAudio
#Strict -1
#</Stream>


# Flash

#<Stream test.swf>
#Feed feed1.ffm
#Format swf
#VideoFrameRate 2
#VideoIntraOnly
#NoAudio
#</Stream>


# ASF compatible

<Stream test.asf>
Feed feed1.ffm
Format asf
VideoFrameRate 15
VideoSize 352x240
VideoBitRate 256
VideoBufferSize 40
VideoGopSize 30
AudioBitRate 64
StartSendOnKey
</Stream>


# MP3 audio

#<Stream test.mp3>
#Feed feed1.ffm
#Format mp2
#AudioCodec mp3
#AudioBitRate 64
#AudioChannels 1
#AudioSampleRate 44100
#NoVideo
#</Stream>


# Ogg Vorbis audio

#<Stream test.ogg>
#Feed feed1.ffm
#Title "Stream title"
#AudioBitRate 64
#AudioChannels 2
#AudioSampleRate 44100
#NoVideo
#</Stream>


# Real with audio only at 32 kbits

#<Stream test.ra>
#Feed feed1.ffm
#Format rm
#AudioBitRate 32
#NoVideo
#NoAudio
#</Stream>


# Real with audio and video at 64 kbits

#<Stream test.rm>
#Feed feed1.ffm
#Format rm
#AudioBitRate 32
#VideoBitRate 128
#VideoFrameRate 25
#VideoGopSize 25
#NoAudio
#</Stream>


##################################################################
# A stream coming from a file: you only need to set the input
# filename and optionally a new format. Supported conversions:
#    AVI -> ASF

#<Stream file.rm>
#File "/usr/local/httpd/htdocs/tlive.rm"
#NoAudio
#</Stream>

#<Stream file.asf>
#File "/usr/local/httpd/htdocs/test.asf"
#NoAudio
#Author "Me"
#Copyright "Super MegaCorp"
#Title "Test stream from disk"
#Comment "Test comment"
#</Stream>


##################################################################
# RTSP examples
#
# You can access this stream with the RTSP URL:
#   rtsp://localhost:5454/test1-rtsp.mpg
#
# A non-standard RTSP redirector is also created. Its URL is:
#   http://localhost:8090/test1-rtsp.rtsp

#<Stream test1-rtsp.mpg>
#Format rtp
#File "/usr/local/httpd/htdocs/test1.mpg"
#</Stream>


##################################################################
# SDP/multicast examples
#
# If you want to send your stream in multicast, you must set the
# multicast address with MulticastAddress. The port and the TTL can
# also be set.
#
# An SDP file is automatically generated by ffserver by adding the
# 'sdp' extension to the stream name (here
# http://localhost:8090/test1-sdp.sdp). You should usually give this
# file to your player to play the stream.
#
# The 'NoLoop' option can be used to avoid looping when the stream is
# terminated.

#<Stream test1-sdp.mpg>
#Format rtp
#File "/usr/local/httpd/htdocs/test1.mpg"
#MulticastAddress 224.124.0.1
#MulticastPort 5000
#MulticastTTL 16
#NoLoop
#</Stream>


##################################################################
# Special streams

# Server status

<Stream stat.html>
Format status

# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255

#FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico
</Stream>


# Redirect index.html to the appropriate site

<Redirect index.html>
URL http://www.ffmpeg.org/
</Redirect>


http://www.ffmpeg.org/

아무튼 적절한 코덱을 지원하는 동영상을 찾아서 테스트 해봐야 하겠지만,
해상도는 16의 배수, 프레임은 1이상 이어야 하는 것으로 보인다.
Posted by 구차니