Jump to content

FFMPEG Transcoding of m3u8 fails. No streams available


surprisejedi

Recommended Posts

surprisejedi

I have a .m3u8 file that looks something like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=614000,AVERAGE-BANDWIDTH=564000,RESOLUTION=480x270,CODECS="avc1.77.30,mp4a.40.2"
https://example.com/270/prog_index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1118000,AVERAGE-BANDWIDTH=1028000,RESOLUTION=640x360,CODECS="avc1.77.30,mp4a.40.2"
https://example.com/360/prog_index.m3u8

This is a valid streaming file and the servers are responding. The file works in VLC and using ffmpeg command line. However when trying to play the file in Emby it fails.

 

 

No compatible streams are currently available. Please try again later or contact your system administrator for details.

Here is my log (where [EXAMPLE_FILE] is emby's .mp4 output):

2019-12-02 21:28:36.671 Info App: ProcessRun 'StreamTranscode 3931b4' Execute: /opt/emby-server/bin/ffmpeg -loglevel +timing -f mp4 -i file:"/home/[EXAMPLE_FILE].mp4" -threads 0 -map 0:0 -map 0:1 -sn -c:v:0 libx264 -pix_fmt yuv420p  -maxrate 2914608 -bufsize 5829216 -preset veryfast -profile:v:0 high -level:v:0 4.1 -crf 23 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -g:v:0 72 -keyint_min:v:0 72 -sc_threshold:v:0 0  -copyts -vsync -1 -codec:a:0 libmp3lame -disposition:a:0 default -ac:a:0 2 -ab:a:0 63903  -f segment -max_delay 5000000 -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_write_temp 1 -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/emby/transcoding-temp/cea4a7824123e700ac386c08c4969e3c.m3u8" -y "/var/lib/emby/transcoding-temp/cea4a7824123e700ac386c08c4969e3c%d.ts"
2019-12-02 21:28:36.759 Info App: ProcessRun 'StreamTranscode 3931b4' Process exited with code 1
2019-12-02 21:28:36.798 Error HttpServer: Error processing request
	*** Error Report ***
	Version: 4.3.0.30
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Unix 5.2.0.2
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 2
	Program data path: /var/lib/emby
	Application directory: /opt/emby-server/system
	System.Exception: System.Exception: Error starting ffmpeg
	   at Emby.Server.MediaEncoding.Api.BaseStreamingService.StartFfMpeg(StreamState state, String outputPath, CancellationTokenSource cancellationTokenSource, Boolean acquireResources)
	   at Emby.Server.MediaEncoding.Api.Hls.DynamicHlsService.GetDynamicSegment(StreamRequest request, String playlistId, String segmentId, Int32 subtitleStreamIndex)
	   at Emby.Server.Implementations.Services.ServiceController.GetTaskResult(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
	Source: Emby.Server.MediaEncoding
	TargetSite: Void MoveNext()

I know the correct ffmpeg command for this (similar example):

ffmpeg -protocol_whitelist file,http,https,tcp,tls -i "org_file.m3u8" -c copy -bsf:a aac_adtstoasc output.mp4

If all else fails I can change the source code to match the above code.

 

Link to comment
Share on other sites

Hi, currently this is a known issue if the m3u8 contains m3u8 hls streams. This is resolved for the next release. Thanks.

  • Like 1
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...