I wanted to use mplayer (a command line tool) to play a SoundCloud url that I fetched with there official API. The url looks like this
https://cf-media.sndcdn.com/qop35iYKlHhs.128.mp3?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vcW9wMzVpWUtsSGhzLjEyOC5tcDMiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE0Njg3NTM4NjB9fX1dfQ__&Signature=OZ4IawmjdU6hEN8KB8e~t3QTy4lBFVBbIDg-a6tuPkb65e0mPskkCFFASkTWbyy5lsaT9IrURan6y70sZhLXPbng1IfkTsGdX1dO938NwVYnKs-BS7IL4TiVFxTBXoKJgmCmUD0qmmGmYqm3YdGZQrP~Sj~mw9~fmtwdHQu0rhl3O-dKsgk497JAR6pMorQs7BSs0XIosV1Mmv2DMD6iifquCWV9Ezq4ekneQ1gfSjVmzjjnKvsxjPpgmU~5DTdewwzlNClVxdzHSQONWM7c0YMGlBcVz97NviaeZOQSCAW8QZS59WULXJBJ9OmEPctWtpe3O0mo-GYjwEkbVGYl9A__&Key-Pair-Id=APKAJAGZ7VMH2PFPW6UQ
I use the command "mplayer 'url'" to play it but I always get the output:
libavformat version 57.25.100 (internal)
https protocol not found, recompile FFmpeg with openssl, gnutls,
or securetransport enabled.
Looking which protocols have been installed tells me that I have https input and output support (ffmpeg -protocols):
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libfaac --enable-ffplay --enable-libspeex --enable-openssl --enable-libopus --disable-lzma --enable-nonfree --enable-vda
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Supported file protocols:
Input:
async
cache
concat
crypto
data
file
ftp
gopher
hls
http
httpproxy
https
mmsh
mmst
pipe
rtp
srtp
subfile
tcp
tls
udp
udplite
unix
rtmp
rtmpe
rtmps
rtmpt
rtmpte
Output:
crypto
file
ftp
gopher
http
httpproxy
https
icecast
md5
pipe
rtp
srtp
tcp
tls
udp
udplite
unix
rtmp
rtmpe
rtmps
rtmpt
rtmpte
Related
I am new to streaming and am trying to figure out how to transcode streams via ffmpeg.
I have a few raw rtp uncompressed streams where some are on address 239.x.x.x and others are on 169.x.x.x.
I want to setup an RTSP server to grab those streams and transcode them into H264 and stream them out to a new address and port.
I have tried some ffmpeg commands but I keep getting errors about having to compile ffmpeg with pthreads.
I have no idea how to do that so does anyone know what commands I can use that will work with the current windows version of ffmpeg?
For now, I am just trying to save the stream to a file to see if that works. Command I am using is:
ffmpeg -i rtp://224.1.1.10:6972 transcoded test.mp4
and the return I get in the command line is
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.3.1 (GCC) 20190414
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[udp # 000002cb292abf40] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp # 000002cb292bc200] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
rtp://224.1.1.10:6972: Immediate exit requested
Exiting normally, received signal 2.
Try TCP instead of UDP. If your server outputs TCP you can try adding the input option(s) -rtsp_flags prefer_tcp and/or -rtsp_transport tcp (place them before -i).
Or use a build of ffmpeg that supports pthreads.
I have a problem on connect to a rtsp camera using ffplay.
The camera is under a router that permits only the TCP protocol.
I can watch the camera using ffplay only if I am in the same network of the camera.
So, when I am out, using this command line
ffplay rtsp://address:554/onvif1
or this
ffplay -rtsp_transport tcp rtsp://address:554/onvif1
I cannot watch the camera.
This is the output of ffplay (the latest).
[rtsp # 059ee680] Nonmatching transport in server reply 0B f=0/0
rtsp://address:554:/onvif1: Invalid data found when processing input
Trying with VLC and I can watch the camera without any problem, both when I am in the same network or when I am out. The VLC output says that VLC uses TCP.
Has someone got a suggestion?
Sure, as you can see below vlc works without any problem.
FFMpeg works only with a local camera but not with a remote camera. Forcing tcp as rtsp protocol seems to have no effect.
try to capture a remote camera (doesn't work)
denis#tomcat:~/Scaricati/ffmpeg-git-20181227-amd64-static$ **./ffmpeg -v verbose -i rtsp://address:554/onvif1 a.avi**
ffmpeg version N-47834-gb5e0a0fe3a-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 25.100 / 56. 25.100
libavcodec 58. 42.104 / 58. 42.104
libavformat 58. 25.100 / 58. 25.100
libavdevice 58. 6.101 / 58. 6.101
libavfilter 7. 46.101 / 7. 46.101
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
[tcp # 0x5f86700] Starting connection attempt to address port 554
try to capture a remote camera forcing tcp (doesn't work)
denis#tomcat:~/Scaricati/ffmpeg-git-20181227-amd64-static$ **./ffmpeg -v verbose -rtsp_transport tcp -i rtsp://address:554/onvif1 a.avi**
ffmpeg version N-47834-gb5e0a0fe3a-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 25.100 / 56. 25.100
libavcodec 58. 42.104 / 58. 42.104
libavformat 58. 25.100 / 58. 25.100
libavdevice 58. 6.101 / 58. 6.101
libavfilter 7. 46.101 / 7. 46.101
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
[tcp # 0x5515740] Starting connection attempt to address port 554
Using vlc (works)
denis#tomcat:~/Scaricati/ffmpeg-git-20181227-amd64-static$ **vlc -v**
VLC media player 3.0.3 Vetinari (revision 3.0.3-1-0-gc2bb759264)
[000056417a4461a0] main libvlc: Esecuzione di vlc con l'interfaccia predefinita. Usa 'cvlc' per utilizzare vlc senza interfaccia.
[000056417a4da540] main playlist: playlist is empty
[00007fcd00000eb0] live555 demux warning: no data received in 10s. Switching to TCP
[00007fcd0000b2d0] main decoder error: buffer deadlock prevented
[000056417a505bf0] pulse audio output warning: starting late (-591 us)
[000056417a505bf0] main audio output warning: playback way too early (-260338): playing silence
[000056417a505bf0] main audio output warning: playback too late (67682): up-sampling
[000056417a505bf0] main audio output warning: playback too early (-60916): down-sampling
[000056417a505bf0] main audio output warning: playback way too early (-191284): playing silence
[000056417a505bf0] main audio output warning: playback way too late (252312): flushing buffers
[000056417a505bf0] pulse audio output warning: starting late (-5953 us)
[000056417a505bf0] main audio output warning: playback way too early (-701316): playing silence
[000056417a505bf0] main audio output warning: playback way too early (-332484): playing silence
[000056417a505bf0] main audio output warning: playback too late (125861): up-sampling
[000056417a505bf0] main audio output warning: playback way too late (297954): flushing buffers
[000056417a505bf0] main audio output warning: playback way too early (-993047): playing silence
[00007fcd0000b2d0] avcodec decoder warning: thread type 1: disabling hardware acceleration
[000056417a505bf0] main audio output warning: playback too late (107083): up-sampling
[000056417a505bf0] main audio output warning: playback way too late (235778): flushing buffers
[00007fcce0001cc0] egl_x11 gl error: cannot select OpenGL API
[000056417a505bf0] main audio output warning: playback way too early (-657714): playing silence
[000056417a505bf0] main audio output warning: playback way too late (238668): flushing buffers
[00007fccf8160b40] main video output warning: picture is too late to be displayed (missing 691 ms)
[00007fccf8160b40] main video output warning: picture is too late to be displayed (missing 491 ms)
[00007fccf8160b40] main video output warning: picture is too late to be displayed (missing 290 ms)
[00007fccf8160b40] main video output warning: picture is too late to be displayed (missing 89 ms)
[000056417a505bf0] main audio output warning: playback way too early (-652182): playing silence
[000056417a505bf0] main audio output warning: playback too late (72927): up-sampling
[000056417a505bf0] main audio output warning: playback too late (98876): up-sampling
[000056417a4da540] main playlist: end of playlist, exiting
In the provided example I was trying to transcode a 4K h264 source to a 1080p h264 output using Nvidia's Hardware acceleration.
Relevant information:
ffmpeg version git-2017-12-25-613f789 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
libavutil 56. 7.100 / 56. 7.100
libavcodec 58. 9.100 / 58. 9.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 7.100 / 7. 7.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Command used:
ffmpeg -c:v h264_cuvid -i "4K_input.mp4" -c:v h264_nvenc -preset slow -s 1920x1080 -c:a copy output.mkv
Relevant PC Specs:
GPU: (Gigabyte) GeForce GTX 1070 Ti
CPU: Intel Core i7 7700K
Memory: 8GB DDR4 2400MHz Single Channel.
SSD: Crucial CT525MX3
While the Nvidia Desktop recording has absolutely no issues to record live h264 video in up to 50Mbps bitrates, this encoding at below 2600kbps was extremely slow utilizing barely 35% GPU.
I was unable to utilize 100% of the GPU on any video parameters.
This is why I could use some advice concerning how to identify a (suspected) bottleneck.
"GPU" transcoding does not work that way. There are fixed function circuits dedicated to h264 encoding on Nvidia GPUs that are not part of the vector unit pool. This is why you specify h264_nvenc (nvenc is Nvidia specific) and not a generic gpu encoder.
TLDR, you won't reach 100% GPU because its not really using the GPU. Its using a separate component that comes with your GPU.
I am trying to change the framerate of a Video of mine. Below there is the example Input and the Output. I Built ffmpeg myself and I'm pretty sure I miss the right decoder/demuxer but I have no Idea what I need. I thought --enable-libtheora would be enough to enable, muxers, demuxers, encoder and decoder, but apperently there is somehting missing. Does anybody have an idea about this?
I have inserted path-to-ffmpeg to make this shorter, the Path itself is okay, so no worries about that.
*path-to-ffmpeg*\ffmpeg>ffmpeg -i Video.ogg -filter "minterpolate='fps=60'" out.ogg
ffmpeg version 3.3.git Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (x86_64-posix-seh-rev2, Built by MinGW-W64 project)
configuration: --disable-encoders --disable-decoder=hevc --disable-decoder=raw
video --disable-decoder=ac3 --disable-decoder=flac --disable-decoder=ffwavesynth
--disable-decoder=libcelt --disable-decoder=libgsm --disable-decoder=libilbc --
disable-decoder=libopus --disable-decoder=dvbsub --disable-decoder=dvdsub --disa
ble-hwaccels --disable-parsers --disable-bsfs --disable-protocols --disable-inde
vs --disable-outdevs --disable-devices --disable-filters --disable-muxers --disa
ble-demuxers --enable-muxer=ogg --enable-zlib --enable-libtheora --enable-libvor
bis --enable-shared --enable-encoder=libtheora --enable-encoder=libvorbis --enab
le-demuxer=image2 --enable-filter=framerate --enable-protocol=file --enable-filt
er=minterpolate --enable-filter=scale
libavutil 55. 61.100 / 55. 61.100
libavcodec 57. 93.100 / 57. 93.100
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 85.100 / 6. 85.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
Video.ogg: Invalid data found when processing input
Yeah, you have --disable-demuxers but no --enable-demuxer=ogg after that. Depending on what the Oggs contain, your build may still be crippled.
I want to take snapshots periodically of a RTMP live video stream.
I can see the rtmp video stream using VLC. This is the rtmp url:
rtmp://antena3fms35livefs.fplive.net/antena3fms35live-live/stream-antena3_1
I'm using the following command to capture the snapshots, according to the official FFmpeg site here:
ffmpeg -i rtmp://antena3fms35livefs.fplive.net/antena3fms35live-live/stream-antena3_1 -f image2 -vf fps=fps=1 out%d.png
The command produces the following output:
ffmpeg version N-64667-gd595361 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 14 2014 22:09:48 with gcc 4.8.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzl
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amr
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --ena
libavutil 52. 92.100 / 52. 92.100
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 47.100 / 55. 47.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 10.100 / 4. 10.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
HandShake: client signature does not match!
Closing connection: NetStream.Play.StreamNotFound
rtmp://antena3fms35livefs.fplive.net/antena3fms35live-live/stream-antena3_1: Unknown error occurred
I've tried it with another rmtp streams, but I'm still getting the exact same error.
What could be the problem?
Thank you!
I just tried your command and it worked fine for me. Maybe it is something about your FFMPEG installation? I am using version 2.4 on a Mac (tessus build).
I know other/older versions used "librtmp" for rtmp connections, which required some extra options behind the stream URL. See ffmpeg docs here:
ffmpeg documentation on librtmp
And librtmp docs here:
librtmp documentation
For an unprotected live stream, you may want to try quoting the stream URL and appending " live=1" within the quotes:
ffmpeg -i "rtmp://antena3fms35livefs.fplive.net/antena3fms35live-live/stream-antena3_1 live=1" -f image2 -vf fps=fps=1 out%d.png