Jump to content

ffmpeg fails to access rtsp (vlc works fine)


joeseph

Recommended Posts

joeseph

I have a nice camera that provides a RTSP feed that works with VLC, and various other android ONVIF/RTSP viewers using this URL:

rtsp://192.168.1.168:80/

 

However, ffmpeg seems to be failing?

Any idea?

 

 

 

2018-07-29 00:14:32.040 Error HttpServer: Error processing request
    *** Error Report ***
    Version: 3.5.1.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 4.15.0.29
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Processor count: 4
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.Exception: Error starting ffmpeg
       at Emby.Server.MediaEncoding.Api.BaseStreamingService.StartFfMpeg(StreamState state, String outputPath, EncodingOptions encodingOptions, CancellationTokenSource cancellationTokenSource, Boolean acquireResources)
       at Emby.Server.MediaEncoding.Api.Hls.BaseHlsService.ProcessRequest(StreamRequest request)
       at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task)
       at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
       at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
    System.Exception
       at Emby.Server.MediaEncoding.Api.BaseStreamingService.StartFfMpeg(StreamState state, String outputPath, EncodingOptions encodingOptions, CancellationTokenSource cancellationTokenSource, Boolean acquireResources)
       at Emby.Server.MediaEncoding.Api.Hls.BaseHlsService.ProcessRequest(StreamRequest request)
       at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task)
       at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
       at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)

 

Link to comment
Share on other sites

Hi there, can you please attach the complete emby server log, and ffmpeg log if there was one? thanks.

Link to comment
Share on other sites

pünktchen

The RTSP protocol isn't enabled anymore in the default ffmpeg package. At least this is true for the windows version.

Link to comment
Share on other sites

joeseph

Ah, thanks for the pointer to the ffmpeg log. I see it had a 401 unauthorized error.

This surprised me because vlc didn't have an auth issue.

 

I added the username:password@ in the url and tried again.

The emby server.log really does just repeat what I pasted above. It's pretty large.

Maybe you wanted the info at the start of the log? I pasted that at the end...

(Sorry if I'm being difficult by not pasting the whole thing - I really will if you like :-) )

 

** ffmpeg log file **

Note that there are no more errors...

 

Last note: if RTSP isn't compiled into ffmpeg anymore (as

pünktchen mentioned) then I understand we can't do much :-)

 

2018-07-29 10:52:24.210
Application version: 3.5.1.0

http://linux:8096/emby/videos/97b46c7c72cfade63fdb6350cd12ad07/live.m3u8?DeviceId=TW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTAuMTM7IHJ2OjYxLjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvNjEuMHwxNTMyODMzMDQ2NTUx&MediaSourceId=97dd209e3d4155253a0c54187075458b&VideoCodec=h264&AudioCodec=aac&VideoBitrate=139808000&AudioBitrate=192000&PlaySessionId=a74de8a3b711475e9395d82b2f2cbca6&api_key=85bc6a9affd641b985ec37a974ee0f43&TranscodingMaxAudioChannels=2&RequireAvc=false&SegmentContainer=ts&MinSegments=2&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&TranscodeReasons=ContainerNotSupported

{"Protocol":"Rtsp","Id":"97dd209e3d4155253a0c54187075458b","Path":"http://username:password@@192.168.1.168:80/","Type":"Default","Name":"97dd209e3d4155253a0c54187075458b","IsRemote":true,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":false,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":true,"MediaStreams":[],"Formats":[],"RequiredHttpHeaders":{}}

User policy for emby: EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

/opt/emby-server/bin/ffmpeg -rtsp_transport tcp -rtsp_transport udp -rtsp_flags prefer_tcp -i "http://username:password@@192.168.1.168:80/"-map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 139808000 -bufsize 279616000 -profile:v high -level 4.1 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -flags -global_header -vsync -1 -codec:a:0 aac -strict experimental -ac 2 -ab 192000  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/1d5ad6ef09a623342b6cc58941676fea/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/emby/transcoding-temp/1d5ad6ef09a623342b6cc58941676fea.m3u8" -y "/var/lib/emby/transcoding-temp/1d5ad6ef09a623342b6cc58941676fea%d.ts"

ffmpeg version 4.0.1 Copyright © 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (crosstool-NG crosstool-ng-1.23.0)
  configuration: --enable-cross-compile --cross-prefix=x86_64-pc-linux-gnu- --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --arch=x86_64 --prefix=/home/embybuilder/Buildbot-master/x64/ffmpeg-x64/staging --pkg-config=pkg-config --disable-doc --disable-ffplay --disable-xlib --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libwebp --enable-libx264 --enable-libzvbi --enable-version3 --extra-libs='-ldl -lexpat -lfreetype -lfribidi -lfontconfig -liconv -lpng -luuid -lz -lvorbis -logg -lnettle -lhogweed -lgmp -laddns-samba4 -lasn1util-samba4 -lauthkrb5-samba4 -lCHARSET3-samba4 -lcliauth-samba4 -lcli-cldap-samba4 -lcli-ldap-common-samba4 -lcli-nbt-samba4 -lcli-smb-common-samba4 -lcom_err -lcommon-auth-samba4 -ldbwrap-samba4 -ldcerpc-binding -ldcerpc-samba-samba4 -lflag-mapping-samba4 -lgenrand-samba4 -lgensec-samba4 -lgse-samba4 -lgssapi_krb5 -llibcli-lsa3-samba4 -llibsmb-samba4 -linterfaces-samba4 -liov-buf-samba4 -lk5crypto -lkrb5 -lkrb5samba-samba4 -lkrb5support -lldb -lldbsamba-samba4 -lmessages-dgm-samba4 -lmessages-util-samba4 -lmsghdr-samba4 -lmsrpc3-samba4 -lndr -lndr-krb5pac -lndr-nbt -lndr-samba-samba4 -lndr-standard -lreplace-samba4 -lsamba-cluster-support-samba4 -lsamba-credentials -lsamba-debug-samba4 -lsamba-errors -lsamba-hostconfig -lsamba-modules-samba4 -lsamba-security-samba4 -lsamba-sockets-samba4 -lsamba-util -lsamba3-util-samba4 -lsamdb -lsamdb-common-samba4 -lsecrets3-samba4 -lserver-id-db-samba4 -lserver-role-samba4 -lsmbconf -lsmbd-shim-samba4 -lsmb-transport-samba4 -lsocket-blocking-samba4 -lsys-rw-samba4 -ltalloc -ltalloc-report-samba4 -ltdb -ltdb-wrap-samba4 -ltevent -ltevent-util -ltime-basic-samba4 -lutil-cmdline-samba4 -lutil-reg-samba4 -lutil-setid-samba4 -lutil-tdb-samba4 -lwbclient -lwinbind-client-samba4 -ldrm' --target-os=linux --enable-shared --disable-static --enable-libsmbclient --enable-cuda --enable-cuvid --enable-nvenc --enable-vaapi
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100

 

 

** embyserver.txt **

2018-07-29 10:50:38.732 Info Main: Application path: /opt/emby-server/system/EmbyServer.dll
2018-07-29 10:50:38.740 Info Main: Emby
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 4.15.0.29
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Processor count: 4
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
2018-07-29 10:50:38.916 Info App: Application version: 3.5.1.0
2018-07-29 10:50:38.918 Info App: Loading assemblies
2018-07-29 10:50:38.937 Info App: File /var/lib/emby/plugins/IMVDb.dll has version 1.0.1.0
2018-07-29 10:50:38.937 Info App: File /opt/emby-server/system/plugins/IMVDb.dll has version 1.0.1.0
2018-07-29 10:50:38.939 Info App: File /var/lib/emby/plugins/OpenSubtitles.dll has version 1.0.2.0
2018-07-29 10:50:38.939 Info App: File /opt/emby-server/system/plugins/OpenSubtitles.dll has version 1.0.2.0
2018-07-29 10:50:38.939 Info App: File /var/lib/emby/plugins/Emby.Server.CinemaMode.dll has version 1.0.2.0
2018-07-29 10:50:38.939 Info App: File /opt/emby-server/system/plugins/Emby.Server.CinemaMode.dll has version 1.0.2.0
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.Channels.IPTV, Version=1.1.4.0, Culture=neutral, PublicKeyToken=null from /var/lib/emby/plugins/MediaBrowser.Channels.IPTV.dll
2018-07-29 10:50:38.948 Info App: Loading IMVDb, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null from /var/lib/emby/plugins/IMVDb.dll
2018-07-29 10:50:38.948 Info App: Loading OpenSubtitles, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null from /var/lib/emby/plugins/OpenSubtitles.dll
2018-07-29 10:50:38.948 Info App: Loading Emby.Server.CinemaMode, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null from /var/lib/emby/plugins/Emby.Server.CinemaMode.dll
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.Api, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.WebDashboard, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.Model, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.Common, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.Controller, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.Providers, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading Emby.Photos, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading Emby.Server.Implementations, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading Emby.Server.MediaEncoding, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading Emby.Dlna, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.LocalMetadata, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading Emby.Notifications, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading MediaBrowser.XbmcMetadata, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading Emby.Server.Connect, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:38.948 Info App: Loading Emby.Server.Sync, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null
2018-07-29 10:50:39.138 Info SqliteUserRepository: Sqlite version: 3.24.0
2018-07-29 10:50:39.138 Info SqliteUserRepository: Sqlite compiler options: COMPILER=gcc-6.3.0,ENABLE_COLUMN_METADATA,ENABLE_DBSTAT_VTAB,ENABLE_FTS3,ENABLE_FTS3_PARENTHESIS,ENABLE_FTS3_TOKENIZER,ENABLE_FTS5,ENABLE_JSON1,ENABLE_PREUPDATE_HOOK,ENABLE_RTREE,ENABLE_SESSION,ENABLE_UNLOCK_NOTIFY,ENABLE_UPDATE_DELETE_LIMIT,LIKE_DOESNT_MATCH_BLOBS,MAX_SCHEMA_RETRY=25,MAX_VARIABLE_NUMBER=250000,OMIT_LOOKASIDE,SECURE_DELETE,THREADSAFE=1
2018-07-29 10:50:39.164 Info SqliteUserRepository: Default journal_mode for /var/lib/emby/data/users.db is wal
2018-07-29 10:50:39.167 Info SqliteUserRepository: PRAGMA synchronous=1
2018-07-29 10:50:39.180 Info AuthenticationRepository: Default journal_mode for /var/lib/emby/data/authentication.db is wal
2018-07-29 10:50:39.180 Info AuthenticationRepository: PRAGMA synchronous=1
2018-07-29 10:50:39.255 Info ActivityRepository: Default journal_mode for /var/lib/emby/data/activitylog.db is wal
2018-07-29 10:50:39.255 Info ActivityRepository: PRAGMA synchronous=1
2018-07-29 10:50:39.257 Info SqliteDisplayPreferencesRepository: Default journal_mode for /var/lib/emby/data/displaypreferences.db is wal
2018-07-29 10:50:39.258 Info SqliteDisplayPreferencesRepository: PRAGMA synchronous=1
2018-07-29 10:50:39.389 Info SqliteItemRepository: Default journal_mode for /var/lib/emby/data/library.db is wal
2018-07-29 10:50:39.390 Info SqliteItemRepository: PRAGMA synchronous=1
2018-07-29 10:50:39.553 Info HttpServer: Calling ServiceStack AppHost.Init
2018-07-29 10:50:39.961 Info HttpServer: Adding HttpListener prefix http://+:8096/
2018-07-29 10:50:39.962 Info HttpServer: Adding HttpListener prefix https://+:8920/
2018-07-29 10:50:40.088 Info HttpServer: HTTP SUBSCRIBE http://192.168.1.186:8096/dlna/8949fc6cb92d4b88934758fb222d8d9f/contentdirectory/events. UserAgent:
2018-07-29 10:50:40.100 Info HttpServer: HTTP SUBSCRIBE http://192.168.1.186:8096/dlna/8949fc6cb92d4b88934758fb222d8d9f/contentdirectory/events. UserAgent:
2018-07-29 10:50:40.110 Info HttpServer: HTTP Response 503 to 192.168.1.176. Time: 31ms. http://192.168.1.186:8096/dlna/8949fc6cb92d4b88934758fb222d8d9f/contentdirectory/events
2018-07-29 10:50:40.110 Info HttpServer: HTTP Response 503 to 192.168.1.176. Time: 9ms. http://192.168.1.186:8096/dlna/8949fc6cb92d4b88934758fb222d8d9f/contentdirectory/events
2018-07-29 10:50:40.206 Info Skia: SkiaSharp version: 1.60.0.0
2018-07-29 10:50:40.242 Info TaskManager: Daily trigger for Chapter image extraction set to fire at 7/30/18 2:00:00 AM, which is 909.329300346667 minutes from now.
2018-07-29 10:50:40.249 Info TaskManager: Daily trigger for Rotate log file set to fire at 7/30/18 12:00:00 AM, which is 789.329183496667 minutes from now.
2018-07-29 10:50:40.255 Info MediaEncoder: FFMpeg: /opt/emby-server/bin/ffmpeg
2018-07-29 10:50:40.255 Info MediaEncoder: FFProbe: /opt/emby-server/bin/ffprobe
2018-07-29 10:50:40.255 Info MediaEncoder: Validating media encoder at /opt/emby-server/bin/ffmpeg
2018-07-29 10:50:40.257 Info MediaEncoder: Running /opt/emby-server/bin/ffmpeg -decoders
2018-07-29 10:50:40.296 Info MediaEncoder: Decoder available: mpeg2video
2018-07-29 10:50:40.300 Info MediaEncoder: Decoder available: h264_cuvid
2018-07-29 10:50:40.300 Info MediaEncoder: Decoder available: hevc_cuvid
2018-07-29 10:50:40.300 Info MediaEncoder: Decoder available: mpeg2_cuvid
2018-07-29 10:50:40.300 Info MediaEncoder: Decoder available: mpeg4_cuvid
2018-07-29 10:50:40.301 Info MediaEncoder: Decoder available: vc1_cuvid
2018-07-29 10:50:40.301 Info MediaEncoder: Decoder available: vp8_cuvid
2018-07-29 10:50:40.302 Info MediaEncoder: Decoder available: vp9_cuvid
2018-07-29 10:50:40.306 Info MediaEncoder: Decoder available: ac3

2018-07-29 10:50:40.306 Info MediaEncoder: Decoder available: aac
2018-07-29 10:50:40.306 Info MediaEncoder: Decoder available: mp3
2018-07-29 10:50:40.306 Info MediaEncoder: Decoder available: h264
2018-07-29 10:50:40.306 Info MediaEncoder: Decoder available: hevc
2018-07-29 10:50:40.310 Info MediaEncoder: Running /opt/emby-server/bin/ffmpeg -encoders
2018-07-29 10:50:40.344 Info MediaEncoder: Encoder available: libx264
2018-07-29 10:50:40.344 Info MediaEncoder: Encoder available: mpeg4
2018-07-29 10:50:40.344 Info MediaEncoder: Encoder available: msmpeg4
2018-07-29 10:50:40.345 Info MediaEncoder: Encoder available: aac
2018-07-29 10:50:40.346 Info MediaEncoder: Encoder available: libmp3lame
2018-07-29 10:50:40.346 Info MediaEncoder: Encoder available: libopus
2018-07-29 10:50:40.346 Info MediaEncoder: Encoder available: libvorbis
2018-07-29 10:50:40.347 Info MediaEncoder: Encoder available: srt
2018-07-29 10:50:40.347 Info MediaEncoder: Encoder available: h264_nvenc
2018-07-29 10:50:40.347 Info MediaEncoder: Encoder available: hevc_nvenc
2018-07-29 10:50:40.349 Info MediaEncoder: Encoder available: h264_vaapi
2018-07-29 10:50:40.349 Info MediaEncoder: Encoder available: hevc_vaapi
2018-07-29 10:50:40.349 Info MediaEncoder: Encoder available: h264_v4l2m2m
2018-07-29 10:50:40.350 Info MediaEncoder: Encoder available: libwebp
2018-07-29 10:50:40.350 Info MediaEncoder: Encoder available: ac3
2018-07-29 10:50:40.353 Info MediaEncoder: Running /opt/emby-server/bin/ffmpeg -protocols
2018-07-29 10:50:40.383 Info MediaEncoder: Encoder validation complete
2018-07-29 10:50:40.383 Info MediaEncoder: ffmpeg supported protocols: async,cache,concat,crypto,data,ffrtmphttp,file,ftp,gopher,hls,http,httpproxy,https,mmsh,mmst,pipe,rtmp,rtmps,rtmpt,rtmpts,rtp,srtp,subfile,tcp,tls,udp,udplite,unix,smb
2018-07-29 10:50:40.385 Info App: ServerId: 8949fc6cb92d4b88934758fb222d8d9f
2018-07-29 10:50:40.432 Info App: Starting entry point MediaBrowser.WebDashboard.ServerEntryPoint
2018-07-29 10:50:40.433 Info App: Entry point completed: MediaBrowser.WebDashboard.ServerEntryPoint. Duration: 0.0007499 seconds

Link to comment
Share on other sites

The RTSP protocol isn't enabled anymore in the default ffmpeg package. At least this is true for the windows version.

 

He's on Linux, but yes for Windows it appears you're right. I guess that means we'll have to start building our own ffmpeg for Windows now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...