I need to get the rtp stream with the next codecs vp8,opus.
I get a stream from a camera (h264, aac), then I send to ffmpeg,then I send it to the ffserver and from there I want to receive a stream in the format rtp.
Video (VP8) without audio i successfully get, but stream video with audio ( any codecs ( aac, vorbis, opus ) ) not work.
ffmpeg command:
./ffmpeg -thread_queue_size 512 -rtsp_transport tcp -i rtsp://ip:port/stream -analyzeduration 0 -threads 2 http://localhost:4000/feed1.ffm
ffserver config:
HTTPPort 4000
RTSPPort 1235
RTSPBindAddress 0.0.0.0
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 1G
ACL allow 127.0.0.1
ACL allow localhost
</Feed>
<Stream test1.sdp>
Feed feed1.ffm
Format rtp
# Video settings
VideoCodec libvpx
VideoSize 720x576
VideoFrameRate 25
VideoBitRate 512
AVOptionVideo maxrate 2000
VideoQMin 4
VideoQMax 50
VideoBufferSize 4000
AVOptionVideo cpu-used 3
AVOptionVideo crf 33
AVOptionVideo quality realtime
AVOptionVideo flags +global_header
#PreRoll 0
#StartSendOnKey
# Audio settings
#AudioCodec aac
#AudioCodec libopus
#Strict -2
AudioBitRate 128
AudioChannels 2
AudioSampleRate 48k
AVOptionAudio flags +global_header
ACL allow localhost
</Stream>
And without video (only audio) - not worked
HTTPPort 4000
RTSPPort 1235
RTSPBindAddress 0.0.0.0
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 1G
ACL allow 127.0.0.1
ACL allow localhost
</Feed>
<Stream test1.sdp>
Feed feed1.ffm
Format rtp
# Video settings
NoVideo
# Audio settings
#AudioCodec aac
#AudioCodec libopus
#Strict -2
AudioBitRate 128
AudioChannels 2
AudioSampleRate 48k
AVOptionAudio flags +global_header
ACL allow localhost
</Stream>
I try to connect to my stream via vlc, but i see error in vlc ( if audio libopus) core error: could not identify codec, if audio codec (e.g. aac ) - live555 error: no data received in 10s, aborting .
ffserver info build:
ffserver version N-86676-g45dbb40cd1-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-11) 20170519
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 67.100 / 55. 67.100
libavcodec 57.100.102 / 57.100.102
libavformat 57. 75.100 / 57. 75.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 94.100 / 6. 94.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
ffmpeg info build:
ffmpeg version N-86676-g45dbb40cd1-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-11) 20170519
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 67.100 / 55. 67.100
libavcodec 57.100.102 / 57.100.102
libavformat 57. 75.100 / 57. 75.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 94.100 / 6. 94.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
What a problem ? Any idea?
.
Related
Querying video codecs does not list libx264 as an available codec
[terry#localhost ~]$ melt -query video_codecs | grep 264
- h264_nvenc
- h264_v4l2m2m
- h264_vaapi
- nvenc_h264
- h264
- h264_cuvid
But I can use it in a command such as:
melt avformat:DarkStar.webm -consumer avformat:output.mp4 acodec=aac vcodec=libx264
and it works successfully.
This is causing a problem with kdenlive. When selecting Render and choosing the format MP4 - the dominating format (H264/AAC) the render option is disabled with the error Unsupported video codec: libx264.
kdenlive checks the profile codec against the list obtained from MLT using:
Mlt::Properties vcodecs(mlt_properties(consumer->get_data("vcodec")));
which seems to get the same list as query video_codecs.
For info here is what ffmpeg says about the codecs:
[terry#localhost ~]$ ffmpeg -codecs | grep 264
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.0 (PCLinuxOS 9.3.0-1pclos2020)
configuration: --prefix=/usr --enable-shared --enable-pic --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include --extra-cflags=-I/usr/include/nvenc --disable-stripping --enable-postproc --enable-gpl --enable-pthreads --enable-libtheora --enable-libvorbis --disable-encoder=vorbis --enable-libvpx --enable-runtime-cpudetect --enable-libdc1394 --enable-librtmp --enable-libspeex --enable-libfreetype --enable-libgsm --enable-libcelt --enable-libopus --enable-libopencv --enable-libopenjpeg --enable-libtwolame --enable-libxavs --enable-frei0r --enable-libmodplug --enable-libass --enable-gnutls --enable-libcdio --enable-libpulse --enable-libv4l2 --enable-avresample --enable-opencl --enable-libmp3lame --enable-libaom --enable-sndio --enable-libdav1d --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libx264 --enable-libx265 --enable-libvo-amrwbenc --enable-libxvid --enable-decoder=atrac3 --enable-decoder=atrac3p --enable-libwebp --enable-libfdk-aac --enable-nonfree --enable-cuda --enable-cuvid --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )
Software versions:
mlt-6.20.0
ffmpeg-4.3
x264-1.157.20190309
libx264 is not a codec, its an encoder implementation of a codec. use ffmpeg -encoders | grep 264
There were changes in ffmpeg 4.3 which required MLT to be rebuilt against it.
The command I'm using :
ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4
Stream #0: not enough frames to estimate rate; consider increasing probesize
And also :
Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
And then all the time :
Past duration 0.810524 too large
Some info :
ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4
ffmpeg version N-81045-g450cf40 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 50.100 / 57. 50.100
libavformat 57. 42.100 / 57. 42.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
[gdigrab # 00000000026a24a0] Capturing whole desktop as 1920x1080x32 at (0,0)
ffmpeg tries to guess the effective framerate of the input. It does this by examining input frames to fetch their timestamps. At a minimum, ffmpeg wants 2 frames to make some guess. But there is a limit set to how much of the data ffmpeg will read for this and other information-gathering purposes. The default value is 5 megabytes. Windows GDI supplies uncompressed frames so they can take a lot of space. For a 1920x1080x32 input, you need to read at least 16.6 MB for 2 frames, but ideally 4 to 5 frames for an accurate assessment. So,
ffmpeg -f gdigrab -framerate 24 -probesize 42M -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4
gdigrab's framerate option is private to it and only tells the grabber how long to wait between captures.
For the other two messages, you should upgrade ffmpeg. Your build is at least a few years old.
I want to streaming the camera via NETWORK. I have connected the USB webcam to i.MX6 board and want to stream in Ubuntu14.04/16.04 via network.
Incidentally, I have installed the gstreamer and ffmpeg tools for this in i.MX6 board.
Also I am able to stream USB webcam within Ubuntu14.04 PC using the following ffmpeg commands. But it's also not working if I use ffplay in other Ubuntu16.04 and I am not sure why (both are same ffmpeg versions).
ffmpeg -f v4l2 -i /dev/video0 -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts udp://192.168.0.37:1234
ffplay udp://192.168.0.37:1234
Ubuntu 16.06: (NOT WORKING)
tus#titus-PC:~/workdir$ ffplay udp://192.168.0.105:1234
ffplay version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2003-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
Ubuntu 14.04: (WORKING)
titus#titus-laptop:~$
titus#titus-laptop:~$ ffplay udp://127.0.0.1:1234
ffplay version 3.3.2 Copyright (c) 2003-2017 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[h264 # 0xb0621660] non-existing PPS 0 referenced sq= 0B f=0/0
Last message repeated 1 times
[h264 # 0xb0621660] decode_slice_header error
[h264 # 0xb0621660] non-existing PPS 0 referenced
[h264 # 0xb0621660] decode_slice_header error
[h264 # 0xb0621660] non-existing PPS 0 referenced
[h264 # 0xb0621660] decode_slice_header error
[h264 # 0xb0621660] non-existing PPS 0 referenced
[h264 # 0xb0621660] decode_slice_header error
[h264 # 0xb0621660] no frame!
[h264 # 0xb0621660] non-existing PPS 0 referenced sq= 0B f=0/0
1751.47 M-V: -0.021 fd= 0 aq= 0KB vq= 11KB sq= 0B f=0/0
1751.63 M-V: -0.020 fd= 0 aq= 0KB vq= 11KB sq= 0B f=0/0
1751.80 M-V: -0.020 fd= 0 aq= 0KB vq= 11KB sq= 0B f=0/0
Finally I want to stream with different ARM boards. Am also not able to build ffplay command. Same issue with raspberry pi too. I am doing something wrong or misunderstood something here?
You want to stream the live USB camera feed from iMX6 to PC. Assuming I understood correctly, running the following pipeline on iMX6
gst-launch-1.0 imxv4l2src device=/dev/video3 ! videoconvert ! queue ! vpuenc_h264 ! rtph264pay ! udpsink host=10.18.0.125 port=5004
and by running the following pipeline on my PC
gst-launch-1.0 udpsrc port=5004 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, payload=(int)96, encoding-name=(string)H264" ! rtph264depay ! avdec_h264 ! xvimagesink
I can view the USB camera stream on PC.
Im trying to use FFMPEG to stream out to my Decklink duo 2 but im unable to do so.
Heres the command that im trying:
ffmpeg -f decklink -i "DeckLink Duo (1)#5"
-pix_fmt uyvy422 -r 25000/1000 "DeckLink Duo (3)"
I tried just sending color bars as an output but it still doesnt work
Command:
ffmpeg -f lavfi -i color=color=red -t 10000 "DeckLink Duo (3)"
Both Result:
ffmpeg version N-82794-g3ab1311 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-dxva2 --enable-libmfx --enable-nvenc
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg
--enable-libopus --enable-librtmp --enable-libschroedinger
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg
--enable-lzma --enable-decklink --enable-zlib
libavutil 55. 42.100 / 55. 42.100
libavcodec 57. 67.100 / 57. 67.100
libavformat 57. 58.102 / 57. 58.102
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, lavfi, from 'color=color=red':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
[NULL # 00000000025745a0] Unable to find a suitable output format for 'DeckLink Duo (3)'
DeckLink Duo (3): Invalid argument
Any Suggestions or help to solve this is much appreciated.
As the documentation says "DeckLink is very picky about the formats it supports. Pixel format is always uyvy422, framerate, field order and video size must be determined for your device with -list_formats 1. Audio sample rate is always 48 kHz.", see https://www.ffmpeg.org/ffmpeg-devices.html#decklink-1. So you need to add the resolution and make sure it is supported.
For the Duo 2 or Quad 2, You need to confirm in Desktop Video utility that you have assigned an SDI port to the channel, otherwise it may be in key/fill mode. This can be found in the third tab called "Connectors". If you can't select one (happens on device (2) or (4) if 1 or 3 are set to key/fill mode, you go back to 1 or 3 and change them to use a single connector.
That was the cause of my I/O error trying to use chanel (3).
So, I have a directory full of files named motor_animate_000.gif, motor_animate_001.gif, etc.
I run:
ffmpeg -r 30 -i motor_animate_%03d.gif -r 30 motor.mpg
I expect to get a file called motor.mpg, but instead I get the usual bunch of printout, ending with:
motor_animate_%03d.gif: No such file or directory
What? This worked in Ubuntu 14.04, but doesn't work now. What I'm doing appears to be consistent with the ffmpeg man page. I'm now officially clueless. Thanks in advance.
Here's what I get when I try the alternate suggested below:
tim#Servo:~/Documents/Movies/dcmotor/animation$ ffmpeg -f image2 -framerate 30 -i motor_animate_%03d.gif motor.mpg
ffmpeg version 2.8.10-0ubuntu0.16.04.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[image2 # 0x20bd420] Could not find codec parameters for stream 0 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
motor_animate_%03d.gif: could not find codec parameters
Input #0, image2, from 'motor_animate_%03d.gif':
Duration: 00:00:04.03, start: 0.000000, bitrate: N/A
Stream #0:0: Video: none, none, 30 fps, 30 tbr, 30 tbn, 30 tbc
No decoder for stream #0:0, filtering impossible
Error opening filters!
The gif demuxer does not support a series of input files. You'll need to manually tell it to use the image file demuxer instead:
ffmpeg -f image2 -framerate 30 -i motor_animate_%03d.gif motor.mpg
The image file demuxer uses -framerate instead of -r.
You don't need to declare frame rate twice if you want to output to be the same as the input, so I removed the output -r.