I have a simple http server for incoming MPEG stream and I'm trying to stream video from another machine on the same network. It works using ffmpeg like this
ffmpeg -f video4linux2 -i /dev/video0 -f mpeg1video http://myaddress.com:port
But from one specific computer ffmpeg refuses to stream and I can't find out why. All I can get is this output:
ffmpeg version 0.7.8, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 16 2012 09:30:22 with gcc 4.5.3
configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib
--mandir=/usr/share/man --enable-shared --cc=i686-pc-linux-gnu-gcc
--disable-static --enable-gpl --enable-postproc --enable-avfilter
--disable-stripping --disable-debug --disable-doc --disable-network
--disable-vaapi --disable-ffplay --disable-vdpau --disable-indev=v4l
--disable-indev=oss --disable-indev=jack --disable-outdev=oss
--disable-altivec --disable-avx --cpu=atom --enable-hardcoded-tables
libavutil 50. 43. 0 / 50. 43. 0
libavcodec 52.123. 0 / 52.123. 0
libavformat 52.111. 0 / 52.111. 0
libavdevice 52. 5. 0 / 52. 5. 0
libavfilter 1. 80. 0 / 1. 80. 0
libswscale 0. 14. 1 / 0. 14. 1
libpostproc 51. 2. 0 / 51. 2. 0
Your ffmpeg build is compiled with --disable-network which I assume is the problem.
Related
I'm using this command to convert flv to 3gp
ffmpeg -y -i in.flv -ar 8000 -b:a 12.20k -ac 1 -s 176x144 out.3gp
And it's giving this error
Encoder (codec amr_nb) not found for output stream #0:1
I have searched for amr_nb packages on yum but didn't able to find it.
I'm on CentOS 7
ffmpeg -version
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
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
I'm not sure what's missing.
Edit:
I followed this guide https://s3bubble.com/installing-ffmpeg-on-centos-6-6-in-usrlocalbin/ + alijandro's advice.
The ffmpeg installed in your system didn't support encoder amr-nb which is the default encoder for 3gp format.
See if you can find in the encoders list
$ ffmpeg -encoders |grep amr_nb
You can try
use h263/aac as the output encoder, add the option -vcodec h263 -acodec aac
or build ffmpeg with amr-nb support
get opencore source from here https://sourceforge.net/projects/opencore-amr
compile the source and install to /path/to/opencore-amr
get the source of ffmpeg
configure ffmpeg with the options
$./configure --enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-version3 \
...
--extra-cflags="-I/path/to/opencore-amr/include" \
--extra-ldflags="-L/path/to/opencore-amr/lib"
...
# more configure options
compile and install ffmpeg, then your command will work
While executing below ffmpeg command on fedora 21 i m facing "Requested output format 'rtp_mpegts' is not a suitable output format"; whereas same works on Ubuntu any ideas please.
ffmpeg -f v4l2 -i /dev/video0 -s 720x480 -pix_fmt yuv420p -vcodec h264 -r 30 -g 15 -ar 0 -streamid 0:48 -bf 2 -f rtp_mpegts rtp://239.0.32.0:50000
ffmpeg version 2.4.11 Copyright (c) 2000-2015 the FFmpeg developers
built on Aug 26 2015 19:46:08 with gcc 4.9.2 (GCC) 20150212 (Red Hat
4.9.2-6) configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib --mandir=/usr/share/man --arch=i686 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-opencl --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib --cpu=i686 --enable-runtime-cpudetect libavutil 54. 7.100 / 54. 7.100 libavcodec 56. 1.100 / 56. 1.100 libavformat 56. 4.101 /
56. 4.101 libavdevice 56. 0.100 / 56. 0.100 libavfilter 5. 1.100 / 5. 1.100 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 0.100 / 3. 0.100 libswresample 1. 1.100 /
1. 1.100 libpostproc 53. 0.100 / 53. 0.100 Input #0, video4linux2,v4l2, from '/dev/video0': Duration: N/A, start:
554538.584009, bitrate: 199065 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 199065 kb/s, 6 fps, 6 tbr, 1000k tbn, 1000k tbc
[NULL # 0x8e94d00] Requested output format 'rtp_mpegts' is not a suitable output format rtp://239.0.32.0:50000: Invalid argument
Resolved by "FFmpeg Static Builds" version from ffmepg.org
I have a custom heroku buildpack that is installing ffmpeg, libvorbis, etc.
When I run ffmpeg I get the following output:
FFmpeg version SVN-r0.5.9-4:0.5.9-0ubuntu0.10.04.3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5.9-0ubuntu0.10.04.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Jan 24 2013 19:42:59, gcc: 4.4.3
At least one output file must be specified
I'm trying to convert mp4 audio to webm audio.
Here is the command I am using:
~/public/audio $ ffmpeg -i sample.mp3 sample.webm
And the output:
FFmpeg version SVN-r0.5.9-4:0.5.9-0ubuntu0.10.04.3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5.9-0ubuntu0.10.04.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Jan 24 2013 19:42:59, gcc: 4.4.3
Input #0, mp3, from 'sample.mp3':
Duration: 00:00:01.56, start: 0.000000, bitrate: 76 kb/s
Stream #0.0: Audio: mp3, 24000 Hz, stereo, s16, 64 kb/s
Unable to find a suitable output format for 'sample.webm'
This works fine on my OSX install, but on Ubuntu 14.04 I'm getting these errors.
What do I need to do so .webm files can be the destination?
When i run this command i get an error. If i run without the pipe, it works.
With Pipe
cat mymovie.m4v | ffmpeg -i pipe:0 -an -analyzeduration 1000000 -f image2 -vf
"select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr 'public/files/thumb%04d.png'
Without Pipe (Works)
ffmpeg -i mymovie.m4v -an -analyzeduration 2147483647 -probesize 2147483647 -f image2 -vf
"select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr 'public/files/thumb%04d.png'
Output
ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Apr 10 2014 17:50:46 with Apple LLVM version 5.1 (clang-503.0.38)
(based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2
--enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree
--enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang
--host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame
--enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libvo-aacenc --enable-libass --enable-ffplay --enable-libspeex
--enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r
--enable-libopenjpeg --extra-cflags='-
I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7fd87b80f000] stream 0, offset 0x2c: partial file
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7fd87b80f000] Could not find codec parameters for stream 0
(Video: h264 (avc1 / 0x31637661), 1280x720, 3310 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
pipe:0: could not find codec parameters
I have tried setting (link)
-analyzeduration100 -probesize 10000000
-analyzeduration 2147483647 -probesize 2147483647
Still didn't work.
MP4 container is not the best choice for piping. The muxer that made the MP4 file may place certain info at the end of the file. This info is required for proper demuxing, but is not immediately available if using a pipe. However, you have a few options:
Don't use a pipe
I don't know why you need to use a pipe in the first place. Just use the file as a normal input:
ffmpeg -i input.mp4 ...
Don't use MP4
If you must use a pipe then consider using some other container such as .mkv or .ts for your input.
Re-mux your MP4 then pipe
If you must use MP4 then one method is to re-arrange the moov atom so it is at the beginning of the file:
ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4
I've tried all sorts of parameters with ffmpeg to make this work, but they all result in a staticy audio file as a result.
some of what i've tried are:
ffmpeg -i file.wma file.wav
ffmpeg -sameq -i file.wma file.wav
ffmpeg -i file.wma -ar 44100 -ac 1 -ab 64000 file.wav
ffmpeg -i file.wma -vn 64000 file.wav
Here's a link to the audio file:
(Removed broken link)
It is working with ffmpeg -i Untitled.wma Untitled.wav for me, using ffmpeg from the Ubuntu repositories.
Version output:
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.2, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5.1-1ubuntu1.2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Sep 16 2011 17:04:18, gcc: 4.4.3
FFmpeg SVN-r0.5.1-4:0.5.1-1ubuntu1.2
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
Maybe it helps.
Use Mplayer to convert wma to wav
mplayer -ao pcm:file-name-in-wav.wav file-name-in-wma.wma
or
Use FFMpeg
ffmpeg -i myfile.wma myfile.wav