I have a server which streams FLV files to a Flex client.
In this flex client, the video timeline advances incoherently, and no video can be seen on screen (only the sound can be heard).
My FLV file has been generated using ffmpeg, which says (about this generated file)
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
built on Aug 8 2010 04:24:04 with gcc 4.3.2
configuration: --prefix=/home/marpada/ffmpegfull --enable-gpl --enable-version3 --enable-nonfree --disable-ffplay --disable-ffserver --enable-libmp3lame --enable-libfaac --enable-libvpx --enable-libfaad --enable-libvorbis --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxvid --enable-libx264 --enable-libtheora --extra-ldflags=-static --extra-libs='-lvorbis -logg -lxvidcore -lx264 -lopencore-amrnb -lopencore-amrwb -lfaad -lfaac -lvpx -ltheora -lm -lpthread' --enable-small --enable-runtime-cpudetect
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.11. 0 / 0.11. 0
[flv # 0x95c6aa0]Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, flv, from '/appli/perigee_70ri/data/files/ged_bur%0/Imagettes/70ri/279/2/8/20_109021138o.70ri_FLV_preview_.flv':
Metadata:
hasMetadata : true
hasVideo : true
hasAudio : true
duration : 589
lasttimestamp : 589
lastkeyframetimestamp: 589
width : 352
height : 288
videodatarate : 199
framerate : 25
audiodatarate : 125
audiosamplerate : 44100
audiosamplesize : 16
stereo : true
filesize : 25058444
videosize : 15195503
audiosize : 9690850
datasize : 23027
metadatacreator : flvmeta 1.1-r202
audiocodecid : 2
videocodecid : 2
audiodelay : 0
canSeekToEnd : false
hasCuePoints : false
hasKeyframes : true
Duration: 00:09:48.78, start: 0.000000, bitrate: 332 kb/s
Stream #0.0: Video: flv, yuv420p, 352x288, 204 kb/s, 25 tbr, 1k tbn, 1k tbc
Stream #0.1: Audio: mp3, 44100 Hz, 2 channels, s16, 128 kb/s
At least one output file must be specified
Which, as far as it seems to me, is OK.
Furthermore, the video plays nice in VLC.
Use H.264 for the video stream.
Related
Wave files can contain unofficial metadata, such as Sampler Chunk - "smpl":
https://sites.google.com/site/musicgapi/technical-documents/wav-file-format#smpl
These are used for audio looping players and samplers avoiding to loading multiple samples.
I have one such file here:
https://github.com/studiorack/basic-harmonica/blob/bf42d5bab7470cc201e3c4b6dee7925b19db6bff/samples/harmonica_1.wav
and a flac file converted using the official flac command line tool:
flac harmonica_1.wav --keep-foreign-metadata
https://github.com/studiorack/basic-harmonica/blob/main/samples/harmonica_1.flac
When running these tools I can confirm the metadata exists in each file:
https://hexfiend.com
However I do see a different in the number of bytes (I believe as flac has riff inserted in multiple places)
I can also convert the .flac file back to .wav and it is the same size, and contains the metadata: flac harmonica_1.flac --keep-foreign-metadata
When using other tools I can read the data:
$ sndfile-info har.wav
smpl : 60
Manufacturer : 0
Product : 0
Period : 20833 nsec
Midi Note : 64
Pitch Fract. : 0
SMPTE Format : 0
SMPTE Offset : 00:00:00 00
Loop Count : 1
Cue ID : 131072 Type : 0 Start : 12707 End : 47221 Fraction : 0 Count : 0
Sampler Data : 0
https://linux.die.net/man/1/sndfile-info
This only works for .wav files. There is a feature request for libsndfile to support 'smpl' in flac files:
https://github.com/libsndfile/libsndfile/issues/59
$ metaflac ./har.flac --list
smpl<aQ#�1u�METADATA block #7
type: 2 (APPLICATION)
is last: false
length: 20
application ID: 72696666
data contents:
https://xiph.org/flac
However as you can see the result returned are different. I would like a both .wav and .flac RIFF 'smpl' data to be returned in the same format, so I can verify the results match.
https://exiftool.org appears to be tool to do that. But it also produced inconsistent results between .wav and .flac:
$ exiftool -a -G1 -s ./har.wav
[ExifTool] ExifToolVersion : 12.42
[System] FileName : har.wav
[System] Directory : .
[System] FileSize : 95 kB
[System] FileModifyDate : 2022:10:11 21:16:37-07:00
[System] FileAccessDate : 2022:10:15 14:39:46-07:00
[System] FileInodeChangeDate : 2022:10:15 14:39:50-07:00
[System] FilePermissions : -rw-r--r--
[File] FileType : WAV
[File] FileTypeExtension : wav
[File] MIMEType : audio/x-wav
[RIFF] Encoding : Microsoft PCM
[RIFF] NumChannels : 1
[RIFF] SampleRate : 48000
[RIFF] AvgBytesPerSec : 96000
[RIFF] BitsPerSample : 16
[RIFF] Manufacturer : 0
[RIFF] Product : 0
[RIFF] SamplePeriod : 20833
[RIFF] MIDIUnityNote : 64
[RIFF] MIDIPitchFraction : 0
[RIFF] SMPTEFormat : none
[RIFF] SMPTEOffset : 00:00:00:00
[RIFF] NumSampleLoops : 1
[RIFF] SamplerDataLen : 0
[RIFF] SamplerData : (Binary data 20 bytes, use -b option to extract)
[RIFF] UnshiftedNote : 64
[RIFF] FineTune : 0
[RIFF] Gain : 0
[RIFF] LowNote : 0
[RIFF] HighNote : 127
[RIFF] LowVelocity : 0
[RIFF] HighVelocity : 127
[RIFF] Comment : Recorded on 7/10/2022 in Edison.
[RIFF] Software : FL Studio 20
[Composite] Duration : 0.99 s
and for flac
$ exiftool -a -G1 -s ./har.flac
[ExifTool] ExifToolVersion : 12.42
[System] FileName : har.flac
[System] Directory : .
[System] FileSize : 83 kB
[System] FileModifyDate : 2022:10:11 20:59:37-07:00
[System] FileAccessDate : 2022:10:15 14:44:12-07:00
[System] FileInodeChangeDate : 2022:10:15 14:42:26-07:00
[System] FilePermissions : -rw-r--r--
[File] FileType : FLAC
[File] FileTypeExtension : flac
[File] MIMEType : audio/flac
[FLAC] BlockSizeMin : 4096
[FLAC] BlockSizeMax : 4096
[FLAC] FrameSizeMin : 3442
[FLAC] FrameSizeMax : 6514
[FLAC] SampleRate : 48000
[FLAC] Channels : 1
[FLAC] BitsPerSample : 16
[FLAC] TotalSamples : 47222
[FLAC] MD5Signature : f89646c0d3056ec38c3e33ca79299253
[Vorbis] Vendor : reference libFLAC 1.4.1 20220922
[Composite] Duration : 0.98 s
How can I read this data consistently regardless of .flac or .wav file?
I was helped by the creator of exiftool here:
https://exiftool.org/forum/index.php?topic=14064.0
In short flac riff blocks were stored in a custom metadata format which exiftool could parse but needed a custom .ExifTool_config file
The creator added the necessary changes in a commit:
https://github.com/exiftool/exiftool/commit/5c2467fa6cdb38233793884e80cee9abf4da48e6#diff-0c24c6846e8207ad8d090e564fdc366dad6386f2ef7c51eea5aa0d72d970ff11
The latest release of ExifTool 12.49 now parses .wav and .flac loop data!
"Decode 'riff' metadata blocks in FLAC audio files"
https://exiftool.org/history.html
Usage:
exiftool ./har.wav
exiftool ./har.flac
Output:
Encoding : Microsoft PCM
Num Channels : 1
Sample Rate : 48000
Avg Bytes Per Sec : 96000
Bits Per Sample : 16
Manufacturer : 0
Product : 0
Sample Period : 20833
MIDI Unity Note : 64
MIDI Pitch Fraction : 0
SMPTE Format : none
SMPTE Offset : 00:00:00:00
Num Sample Loops : 1
Sampler Data Len : 0
Sampler Data : (Binary data 20 bytes, use -b option to extract)
Unshifted Note : 64
Fine Tune : 0
Gain : 0
Low Note : 0
High Note : 127
Low Velocity : 0
High Velocity : 127
Acidizer Flags : One shot
Root Note : High C
Beats : 2
Meter : 4/4
Tempo : 0
Comment : Recorded on 7/10/2022 in Edison.
Software : FL Studio 20
Duration : 0.87 s
I was using sox to convert a 2 channels, 48000Hz, 24bits wav file (new.wav) to a mono wav file (post.wav).
Here are the related commands and outputs:
[Farmer#Ubuntu recording]$ soxi new.wav
Input File : 'new.wav'
Channels : 2
Sample Rate : 48000
Precision : 24-bit
Duration : 00:00:01.52 = 72901 samples ~ 113.908 CDDA sectors
File Size : 447k
Bit Rate : 2.35M
Sample Encoding: 24-bit Signed Integer PCM
[Farmer#Ubuntu recording]$ sox new.wav -c 1 post.wav
[Farmer#Ubuntu recording]$ soxi post.wav
Input File : 'post.wav'
Channels : 1
Sample Rate : 48000
Precision : 24-bit
Duration : 00:00:01.52 = 72901 samples ~ 113.908 CDDA sectors
File Size : 219k
Bit Rate : 1.15M
Sample Encoding: 24-bit Signed Integer PCM
It looks fine. But let us check the header of post.wav:
[Farmer#Ubuntu recording]$ xxd post.wav | head -10
00000000: 5249 4646 9856 0300 5741 5645 666d 7420 RIFF.V..WAVEfmt
00000010: 2800 0000 feff 0100 80bb 0000 8032 0200 (............2..
00000020: 0300 1800 1600 1800 0400 0000 0100 0000 ................
00000030: 0000 1000 8000 00aa 0038 9b71 6661 6374 .........8.qfact
00000040: 0400 0000 c51c 0100 6461 7461 4f56 0300 ........dataOV..
This is the standard wav file header structure.
The first line is no problem.
The second line "2800 0000" shows the size of sub chunk "fmt ", it should be 0x00000028 (as this is little endian) = 40 bytes. But there are 54 bytes (before sub chunk "fmt " and sub chunk "data").
The third line shows "ExtraParamSize" is 0x0018 = 22 bytes. But actually it is 36 bytes (from third line's "1600" to 5th line's "0100"). The previous 16 bytes are standard.
So what's the extra 36 bytes?
Ok,I found out the answer.
Look at the second line, we can found that audio format is "feff", actual value is 0xFFFE, so this is not a PCM standard wave format, but a extensible format.
Wav head detailed introduction can refer to this link. The article is well written and thanks to the author.
So as this is a Non-PCM format wav, "fmt " chunk space occupied 40 bytes is no problem, and followed by a "fact" chunk, and then is "data" chunk, So everything makes sense.
OFFICIAL EDIT:
I thank you so much for your help but I am still encountering problems.
My ffserver.conf file is like this:
# 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.
HTTPPort 8090
# Address on which the server is bound. Only useful if you have
# several network interfaces.
HTTPBindAddress 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 -
##################################################################
# 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
#ACL allow 189.34.0.158
</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> <last address>
# You can deny ranges of addresses (or single addresses)
#ACL DENY <first address> <last 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
#Metadata 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
#Metadata author "Me"
#Metadata copyright "Super MegaCorp"
#Metadata title "Test stream from disk"
#Metadata 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>
# Transcode an incoming live feed to another live feed,
# using libx264 and video presets
#<Stream live.h264>
#Format rtp
#Feed feed1.ffm
#VideoCodec libx264
#VideoFrameRate 24
#VideoBitRate 100
#VideoSize 480x272
#AVPresetVideo default
#AVPresetVideo baseline
#AVOptionVideo flags +global_header
#
#AudioCodec libfaac
#AudioBitRate 32
#AudioChannels 2
#AudioSampleRate 22050
#AVOptionAudio flags +global_header
#</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>
I started my server and executed:
ffserver -d -f /usr/share/doc/ffmpeg-2.6.8/ffserver.conf
No error message and everything looks fine.
After that I execute this (in your answer, I think you forgot the port number):
ffmpeg -i "rtsp://200.180.90.95:554/onvif1" -r 25 -s 640x480 -c:v libx264 -flags +global_header -f flv "http://45.79.207.38:8090/feed1.ffm"
Then I get this log:
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[h264 # 0x1a23580] RTP: missed 1 packets
[pcm_alaw # 0x1a24360] RTP: missed 2 packets
[h264 # 0x1a23580] RTP: missed 1 packets
Invalid UE golomb code
[h264 # 0x1a23580] cbp too large (3199971767) at 76 33
[h264 # 0x1a23580] error while decoding MB 76 33
[h264 # 0x1a23580] Cannot use next picture in error concealment
[h264 # 0x1a23580] concealing 933 DC, 933 AC, 933 MV errors in P frame
[h264 # 0x1a23580] RTP: missed 1 packets
[h264 # 0x1a23580] cbp too large (62) at 50 24
[h264 # 0x1a23580] error while decoding MB 50 24
[h264 # 0x1a23580] Cannot use next picture in error concealment
[h264 # 0x1a23580] concealing 1679 DC, 1679 AC, 1679 MV errors in P frame
[h264 # 0x1a23580] RTP: missed 2 packets
[h264 # 0x1a23580] Cannot use next picture in error concealment
[h264 # 0x1a23580] concealing 1965 DC, 1965 AC, 1965 MV errors in P frame
[pcm_alaw # 0x1a24360] RTP: missed 1 packets
Last message repeated 1 times
[h264 # 0x1a23580] RTP: missed 3 packets
[h264 # 0x1a23580] mb_type 49 in P slice too large at 74 25
[h264 # 0x1a23580] error while decoding MB 74 25
[h264 # 0x1a23580] Cannot use next picture in error concealment
[h264 # 0x1a23580] concealing 1575 DC, 1575 AC, 1575 MV errors in P frame
[h264 # 0x1a23580] RTP: missed 2 packets
[h264 # 0x1a23580] P sub_mb_type 29 out of range at 30 26
[h264 # 0x1a23580] error while decoding MB 30 26
[h264 # 0x1a23580] Cannot use next picture in error concealment
[h264 # 0x1a23580] concealing 1539 DC, 1539 AC, 1539 MV errors in P frame
[h264 # 0x1a23580] RTP: missed 1 packets
[h264 # 0x1a23580] out of range intra chroma pred mode at 72 29
[h264 # 0x1a23580] error while decoding MB 72 29
[h264 # 0x1a23580] Cannot use next picture in error concealment
[h264 # 0x1a23580] concealing 1257 DC, 1257 AC, 1257 MV errors in P frame
[h264 # 0x1a23580] RTP: missed 3 packets
[h264 # 0x1a23580] negative number of zero coeffs at 48 5
[h264 # 0x1a23580] error while decoding MB 48 5
[h264 # 0x1a23580] Cannot use next picture in error concealment
[h264 # 0x1a23580] concealing 3201 DC, 3201 AC, 3201 MV errors in P frame
[pcm_alaw # 0x1a24360] RTP: missed 1 packets
[rtsp # 0x1a20ee0] decoding for stream 0 failed
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://200.180.90.95:554/onvif1':
Metadata:
title : H.264 Video, RtspServer_0.0.0.2
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuv420p, 1280x720, 90k tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
[libx264 # 0x1b728a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
[libx264 # 0x1b728a0] profile High, level 3.0
[libx264 # 0x1b728a0] 264 - core 142 r2495 6a301b6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[flv # 0x1a66300] FLV does not support sample rate 8000, choose from (44100, 22050, 11025)
[flv # 0x1a66300] Audio codec mp3 not compatible with flv
Output #0, flv, to 'http://45.79.207.38:8090/feed1.ffm':
Metadata:
title : H.264 Video, RtspServer_0.0.0.2
encoder : Lavf56.25.101
Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 640x480, q=-1--1, 25 fps, 1k tbn, 25 tbc
Metadata:
encoder : Lavc56.26.100 libx264
Stream #0:1: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 8000 Hz, mono, s16p
Metadata:
encoder : Lavc56.26.100 libmp3lame
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (pcm_alaw (native) -> mp3 (libmp3lame))
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
I am doing this in a clean install of CENTOS, no customization. Could you please helpe me?
When you installed ffmpeg (yum install ffmpeg), along with ffmpeg,ffserver is also installed.
Step 1: Configure ffserver (config file located in /etc/ffserver.conf), configure HTTPPort to any available port. <Feed feed1.ffm> .... </Feed> this block describes the input point for server feed. and <Stream test1.mpg> .. </Stream> block in output. Final output stream is decided by this block.
Step 2: Start ffserver by typing ffserver in command line (if you want to run it in background then 'nohup ffserver &')
Step 3: ffmpeg -i "rtsp://200.180.90.95:554/onvif1" -r 25 -s 640x480 -c:v libx264 -flags +global_header -f flv "http://45.79.207.38:/feed1.ffm"
NOTE: Streaming video requires higher internet bandwidth.
so im currrently trying to stream my windows desktop using ffmpeg into a raspberry pi running ffserver.
The client software im using needs to use RTSP, however i cannot connect to the stream no matter what i try.
I even used VLC in the messages it just says it cannot connect to the stream.
Any help would be greatly appreciated!
Im attempting to access the stream with rtsp :// 169.254.70.227 :8544/test.flv, as soon as i do it stops the ffmpeg feed
FFserver conf
`RTSPPort 8544
HTTPPort 8090 # Port to bind the server to
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000 # Maximum bandwidth per client
# set this high enough to exceed stream bitrate
CustomLog - # Remove this if you want FFserver to daemoni$
<Feed feed1.ffm> # This is the input feed where FFmpeg will send
File ./feed1.ffm # video stream.
FileMaxSize 100000K # Maximum file size for buffering video
ACL allow 192 .168.0.8
ACL allow 192 .168.0.17
ACL allow 169 .254.70.227
ACL allow 169 .254.9.29
ACL allow 169 .254.165.231
ACL allow 10 .14.2.197
ACL allow 192 .168.0.13
ACL allow 10 .14.2.197
ACL allow 192.16 8.0.13
ACL allow 192.1 68.1.3
ACL allow 192. 168.1.4
ACL allow 192 .168.1.2
</Feed>
<Stream test.flv> # Output stream URL definition
Format rtp
Feed feed1.ffm
NoAudio
# Video settings
VideoCodec libx264
VideoSize 720x576 # Video resolution
VideoBufferSize 2000
VideoFrameRate 30 # Video FPS
# Parameters passed to encoder
AVOptionVideo qmin 10
AVOptionVideo qmax 42
PreRoll 15
StartSendOnKey
MulticastAddress 224 .124.0.1
MulticastPort 5000
MulticastTTL 16
VideoBitRate 450 # Video bitrate
</Stream>
<Stream status.html> # Server status URL
Format status
# Only allow local people to get the status
ACL allow localhost
# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168. 0.0 192.168. 255.255
</Stream>
<Redirect index. html> # Just an URL redirect for index
# Redirect index.html to the appropriate site
URL http ://www. ffmpeg .org/
</Redirect>`
FFmpeg feed
ffmpeg -rtbufsize 2100M -f dshow -r 29.970 -i video=screen-capture-recorder -c video=screen-capture-recorder.flv http :// 169 .254.70.227:8090/ feed1.ffm
FFserver output
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
libavutil 55. 22.101 / 55. 22.101
libavcodec 57. 35.100 / 57. 35.100
libavformat 57. 34.103 / 57. 34.103
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 44.100 / 6. 44.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
/etc/ffserver.conf:48: Setting default value for video bit rate tolerance = 112500. Use NoDefaults to disable it.
/etc/ffserver.conf:48: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
/etc/ffserver.conf:48: Setting default value for video max rate = 20744848. Use NoDefaults to disable it.
Wed Apr 27 10:33:46 2016 FFserver started.
Wed Apr 27 10:33:46 2016 224.124.0.1:5000 - - "PLAY test.flv/streamid=0 RTP/MCAST"
Wed Apr 27 10:33:46 2016 [rtp # 0x13d4660]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Wed Apr 27 10:33:49 2016 169.254.165.231 - - [GET] "/feed1. ffm HTTP/1.1" 200 4175
FFMpeg output
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler # 000000000252f5e0] Warning: data is not aligned! This can lead to a speedloss
av_interleaved_write_frame(): Unknown errortime=00:00:05.00 bitrate= 249.0kbits/s speed=0.393x
Error writing trailer of http: //169. 254.70.227:8090/feed1.ffm: Error number -10053 occurredframe= 204 fps= 15 q=26.0 Lsize= 164kB time=00:00:05.03 bitrate= 266.9kbits/s speed=0.365x
video:155kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.475512%
[libx264 # 00000000025187e0] frame I:1 Avg QP:34.24 size: 32151
[libx264 # 00000000025187e0] frame P:59 Avg QP:27.14 size: 1807
[libx264 # 00000000025187e0] frame B:144 Avg QP:32.16 size: 168
[libx264 # 00000000025187e0] consecutive B-frames: 4.9% 2.0% 2.9% 90.2%
[libx264 # 00000000025187e0] mb I I16..4: 26.0% 23.1% 50.9%
[libx264 # 00000000025187e0] mb P I16..4: 1.9% 1.6% 1.1% P16..4: 4.3% 0.6% 0.4% 0.0% 0.0% skip:90.2%
[libx264 # 00000000025187e0] mb B I16..4: 0.2% 0.1% 0.1% B16..8: 3.1% 0.1% 0.0% direct: 0.1% skip:96.3% L0:26.0% L1:73.5% BI: 0.5%
[libx264 # 00000000025187e0] final ratefactor: 24.13
[libx264 # 00000000025187e0] 8x8 transform intra:31.8% inter:47.1%
[libx264 # 00000000025187e0] coded y,u,v intra: 28.1% 8.2% 6.3% inter: 0.6% 0.2% 0.1%
[libx264 # 00000000025187e0] i16 v,h,dc,p: 30% 63% 6% 1%
[libx264 # 00000000025187e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 16% 63% 1% 0% 0% 1% 0% 3%
[libx264 # 00000000025187e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 39% 15% 2% 2% 3% 4% 3% 4%
[libx264 # 00000000025187e0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 00000000025187e0] ref P L0: 66.3% 13.1% 16.9% 3.6%
[libx264 # 00000000025187e0] ref B L0: 66.6% 29.7% 3.8%
[libx264 # 00000000025187e0] ref B L1: 91.7% 8.3%
[libx264 # 00000000025187e0] kb/s:191.78
Conversion failed!
I am struggling with FFmpeg within Drupal Video Module to produce files to MP4 that is compatible with IOS and Flash Player10 and up.
I have used the following commands so far, please note that the variables starting with "!" are placeholders and will be replaces with the proper items:
FFmpeg -strict experimental -y -i !videofile -pass 1 -s !widthx!height -b:v 500k -threads 0 -vcodec libx264 -vf "pad=!paddingwidth:!paddingheight:!paddingleft:!paddingtop:000000" -preset slow -an !convertfile
FFmpeg -strict experimental -y -i !videofile -pass 2 -s !widthx!height -b:v 500k -threads 0 -vcodec libx264 -vf "pad=!paddingwidth:!paddingheight:!paddingleft:!paddingtop:000000" -preset slow -acodec aac -ab 128k !convertfile
The above command produce an error as:
error executing command for rendering preset HTML5 MP4, command #1:
nice -n 19 /usr/bin/ffmpeg/ffmpeg -y -i '80137db8c3_1334836277_int_tr_19.mp4' -s 176x100 -b:v 500k -threads 0 -vcodec libx264 -preset slow -acodec aac -ab 128k '/converted/80137db8c3_1334836277_int_tr_19.mp4' 2>&1
Output:
ffmpeg version git-2013-02-01-5a67e30 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 1 2013 14:23:14 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --enable-gpl --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3
libavutil 52. 17.100 / 52. 17.100
libavcodec 54. 91.100 / 54. 91.100
libavformat 54. 61.104 / 54. 61.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 35.100 / 3. 35.100
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '80137db8c3_1334836277_int_tr_19.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2011-03-28 00:12:26
Duration: 00:02:01.14, start: 0.000000, bitrate: 703 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 601 kb/s, 29.96 fps, 29.92 tbr, 1k tbn, 59.83 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s
Metadata:
creation_time : 2011-03-28 00:12:27
handler_name : (C) 2007 Google Inc. v08.13.2007.
[libx264 # 0x34ec060] using SAR=100/99
[libx264 # 0x34ec060] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 # 0x34ec060] profile High, level 2.0
[libx264 # 0x34ec060] 264 - core 129 r2245 bc13772 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 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=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
Alternatively use the non experimental encoder 'libfaac'.
Another command that I used is:
FFmpeg -i !videofile -an -pass 1 -vcodec libx264 -preset slow -b 500k -threads auto !convertfile
FFMpeg -y -i !videofile -acodec libfaac -ab 128k -pass 2 -vcodec libx264 -preset slow -b 500k -threads auto !convertfile
Output for the first pass:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'comiccon.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41
creation_time : 2012-08-15 17:12:37
Duration: 01:17:15.93, start: 0.000000, bitrate: 706 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 636 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
creation_time : 2012-08-15 17:12:37
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 63 kb/s
Metadata:
creation_time : 2012-08-15 17:12:37
handler_name : SoundHandler
Please use -b:a or -b:v, -b is ambiguous
using SAR=1/1
[libx264 # 0x1c39be0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 # 0x1c39be0] profile Main, level 3.0
[libx264 # 0x1c39be0] 264 - core 129 r2245 bc13772 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'comiccon.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41
encoder : Lavf54.61.104
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, pass 1, 500 kb/s, 15360 tbn, 30 tbc
Metadata:
creation_time : 2012-08-15 17:12:37
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> libx264)
Press [q] to stop, [?] for help
frame=139078 fps=279 q=32766.0 Lsize= 286145kB time=01:17:15.86 bitrate= 505.6kbits/s
video:284758kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.487000%
[libx264 # 0x1c39be0] frame I:656 Avg QP:19.51 size: 21457
[libx264 # 0x1c39be0] frame P:76006 Avg QP:22.19 size: 3141
[libx264 # 0x1c39be0] frame B:62416 Avg QP:26.38 size: 621
[libx264 # 0x1c39be0] consecutive B-frames: 32.3% 17.5% 18.6% 31.6%
[libx264 # 0x1c39be0] mb I I16..4: 24.5% 0.0% 75.5%
[libx264 # 0x1c39be0] mb P I16..4: 7.5% 0.0% 0.0% P16..4: 40.5% 0.0% 0.0% 0.0% 0.0% skip:52.1%
[libx264 # 0x1c39be0] mb B I16..4: 1.4% 0.0% 0.0% B16..8: 12.0% 0.0% 0.0% direct: 2.9% skip:83.7% L0:41.1% L1:41.6% BI:17.3%
[libx264 # 0x1c39be0] final ratefactor: 23.45
[libx264 # 0x1c39be0] direct mvs spatial:95.3% temporal:4.7%
[libx264 # 0x1c39be0] coded y,uvDC,uvAC intra: 37.6% 42.8% 11.8% inter: 8.9% 8.2% 0.5%
[libx264 # 0x1c39be0] i16 v,h,dc,p: 43% 28% 19% 10%
[libx264 # 0x1c39be0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 21% 11% 6% 4% 5% 4% 6% 6%
[libx264 # 0x1c39be0] i8c dc,h,v,p: 57% 19% 20% 4%
[libx264 # 0x1c39be0] Weighted P-Frames: Y:1.4% UV:0.5%
[libx264 # 0x1c39be0] kb/s:503.18
output for the second pass:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'comiccon.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41
creation_time : 2012-08-15 17:12:37
Duration: 01:17:15.93, start: 0.000000, bitrate: 706 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 636 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
creation_time : 2012-08-15 17:12:37
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 63 kb/s
Metadata:
creation_time : 2012-08-15 17:12:37
handler_name : SoundHandler
Please use -b:a or -b:v, -b is ambiguous
[libx264 # 0x3247f80] using SAR=1/1
[libx264 # 0x3247f80] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 # 0x3247f80] profile High, level 3.0
[libx264 # 0x3247f80] 264 - core 129 r2245 bc13772 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=2pass mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'comiccon.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41
encoder : Lavf54.61.104
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, pass 2, 500 kb/s, 15360 tbn, 30 tbc
Metadata:
creation_time : 2012-08-15 17:12:37
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s
Metadata:
creation_time : 2012-08-15 17:12:37
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> libx264)
Stream #0:1 -> #0:1 (aac -> libfaac)
Press [q] to stop, [?] for help
frame=139078 fps=206 q=32766.0 Lsize= 357252kB time=01:17:15.93 bitrate= 631.3kbits/s
video:282992kB audio:69592kB subtitle:0 global headers:0kB muxing overhead 1.324238%
[libx264 # 0x3247f80] frame I:656 Avg QP:19.61 size: 20433
[libx264 # 0x3247f80] frame P:76006 Avg QP:23.07 size: 2996
[libx264 # 0x3247f80] frame B:62416 Avg QP:26.23 size: 780
[libx264 # 0x3247f80] consecutive B-frames: 32.3% 17.5% 18.6% 31.6%
[libx264 # 0x3247f80] mb I I16..4: 17.2% 37.8% 44.9%
[libx264 # 0x3247f80] mb P I16..4: 2.9% 3.7% 1.2% P16..4: 30.3% 6.1% 3.4% 0.0% 0.0% skip:52.5%
[libx264 # 0x3247f80] mb B I16..4: 0.5% 0.6% 0.3% B16..8: 25.9% 2.2% 0.5% direct: 0.9% skip:69.3% L0:51.4% L1:43.0% BI: 5.7%
[libx264 # 0x3247f80] 8x8 transform intra:45.9% inter:51.5%
[libx264 # 0x3247f80] direct mvs spatial:85.5% temporal:14.5%
[libx264 # 0x3247f80] coded y,uvDC,uvAC intra: 47.3% 49.2% 13.5% inter: 9.0% 9.4% 0.5%
[libx264 # 0x3247f80] i16 v,h,dc,p: 38% 27% 13% 22%
[libx264 # 0x3247f80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 16% 14% 5% 5% 7% 7% 8% 9%
[libx264 # 0x3247f80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 15% 9% 6% 7% 8% 7% 8% 8%
[libx264 # 0x3247f80] i8c dc,h,v,p: 49% 22% 20% 8%
[libx264 # 0x3247f80] Weighted P-Frames: Y:1.4% UV:0.5%
[libx264 # 0x3247f80] ref P L0: 79.3% 10.4% 6.8% 1.6% 1.2% 0.7% 0.0%
[libx264 # 0x3247f80] ref B L0: 93.6% 4.8% 1.2% 0.3%
[libx264 # 0x3247f80] ref B L1: 96.6% 3.4%
[libx264 # 0x3247f80] kb/s:500.06
The above command produces the file correctly however it cannot be played in flash player. One thing that I noticed is this may happen if the input file is mp4 as well. This command is executed for users uploading files, so the input file could be any format.
Below is the information about my FFmpeg version:
> ffmpeg version git-2013-02-01-5a67e30 Copyright (c) 2000-2013 the
> FFmpeg developers built on Feb 1 2013 14:23:14 with gcc 4.6
> (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --enable-gpl
> --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 libavutil 52. 17.100 / 52. 17.100
libavcodec 54. 91.100 / 54. 91.100
libavformat 54. 61.104 / 54. 61.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 35.100 / 3. 35.100
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.1
Some notes:
The binary is ffmpeg; not FFmpeg or FFMpeg.
-strict experimental should be used as an output option. You are using it as an input option and is being ignored. You won't need it for other AAC encoders.
-threads auto is now default and adding it is superfluous.
You compiled with --enable-libfdk-aac, and therefore you can use -codec:a libfdk_aac which will provide better quality per file size than the other AAC encoders. See the FFmpeg AAC Encoding Guide and FFmpeg and x264 Encoding Guide.
The message Please use -b:a or -b:v, -b is ambiguous should not be ignored so ffmpeg knows if you want to apply your desired bitrate to the audio or video.
I don't see why the second command shouldn't work in a flash player. You may simply not be waiting long enough for the file to download completely before playing. You can add -movflags +faststart to allow playback to begin before the download completes.
Replace -s with the scale filter so you can have a proper filterchain with pad. Next time show actual commands and not commands with variables; otherwise I could have given a proper filtering example.