pünktchen 1258 Posted September 16, 2019 Share Posted September 16, 2019 @@softworkz I want to create a new Emby plugin. But before i spend my time into coding something that will not work, i'm evaluating what's possible in Emby. The plugin will take a m3u playlist as input file, so for testing purposes i'm utilizing the IPTV plugin to verify playback. Unfortunately this doesn't work. I only get errors in Emby's log. If i use the command line from the log in a command window i get this: C:\Users\Administrator>D:\Emby\system\ffprobe.exe -i file:"D:\Emby\programdata\plugins\channel.m3u" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data ffprobe version 4.0.3-emby_2019_04_09-g5abbb1430d+449 Copyright (c) 2007-2018 the FFmpeg developers and softworkz for Emby LLC built with gcc 8.3.0 (Rev2, Built by MSYS2 project) { [hls,applehttp @ 000001aa656c0400] Opening 'http://localhost:8096/emby/Videos/498/stream?static=true&api_key=b7a75a5091f7414fbcaca593f5659535' for reading [http @ 000001aa656ca080] Protocol 'http' not on whitelist 'file,crypto'! [hls,applehttp @ 000001aa656c0400] Failed to open segment 0 of playlist 0 [hls,applehttp @ 000001aa656c0400] Error when loading first segment 'http://localhost:8096/emby/Videos/498/stream?static=true&api_key=123456789' file:D:\Emby\programdata\plugins\channel.m3u: Invalid data found when processing input } This error can be solved by putting a whitelist parameter before the input parameter: D:\Emby\system\ffprobe.exe -protocol_whitelist "file,http,https,tcp,tls" -i file:"D:\Emby\programdata\plugins\channel.m3u" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data I don't know, maybe it's also possible to compile ffprobe with the witelist already included. The same also happens with ffmpeg, but there's also another error: C:\Users\Administrator>D:\Emby\system\ffmpeg.exe -f m3u -i file:"D:\Emby\programdata\plugins\channel.m3u" -map_metadata -1 -map_chapters -1 -threads 1 -sn -c:v:0 libx264 -pix_fmt yuv420p -maxrate 139808000 -bufsize 279616000 -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 -force_key_frames "expr:gte(t,n_forced*3)" -vsync -1 -codec:a:0 libmp3lame -disposition:a:0 default -ac:a:0 2 -ab:a:0 192000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_write_temp 1 -segment_list_entry_prefix "hls/389eb89f812f025dcff2e0c8f0ec3ff0/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "D:\Emby\programdata\transcoding-temp\389eb89f812f025dcff2e0c8f0ec3ff0.m3u8" -y "D:\Emby\programdata\transcoding-temp\389eb89f812f025dcff2e0c8f0ec3ff0%d.ts" ffmpeg version 4.0.3-emby_2019_04_09-g5abbb1430d+449 Copyright (c) 2000-2018 the FFmpeg developers and softworkz for Emby LLC built with gcc 8.3.0 (Rev2, Built by MSYS2 project) Local Time: 17:49:21 T=0.000s T=0.031s Unknown input format: 'm3u' So either you omit the -f parameter when the file extension is m3u or m3u8, or you use -f hls. @@Luke Can you please make the existing entries in the configuration screen of the IPTV plugin editable? Right now one has to delete "false" entries and start from scratch. Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 16, 2019 Share Posted September 16, 2019 Can you please make the existing entries in the configuration screen of the IPTV plugin editable? Right now one has to delete "false" entries and start from scratch. That makes sense but I'm not sure when I'll be able to get to that. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted September 20, 2019 Author Share Posted September 20, 2019 @@softworkz is there something to test for me with Emby 4.3.0.9? Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 20, 2019 Share Posted September 20, 2019 related to this? Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted September 20, 2019 Author Share Posted September 20, 2019 Of course. Link to comment Share on other sites More sharing options...
softworkz 3335 Posted September 20, 2019 Share Posted September 20, 2019 @@softworkz is there something to test for me with Emby 4.3.0.9? I'm not sure whether I understand the first post. You explain problems for which you already know the solutions.. But I must admit that I don't really know the iptv plugin.. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted September 21, 2019 Author Share Posted September 21, 2019 I'm not sure whether I understand the first post. You explain problems for which you already know the solutions.. But I must admit that I don't really know the iptv plugin.. But i cannot set the necessary ffmpeg parameters. It has to be done in Emby's code. Link to comment Share on other sites More sharing options...
softworkz 3335 Posted September 21, 2019 Share Posted September 21, 2019 Emby handles m3u playlists in the context of live tv. It extracts "channels" from master playlists and individual streams ("channels") must be either constant mpegts streams or hls playlists. It does not support any other kind of m3u use in that context - specifically not creating a sequence of different media parts. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted September 21, 2019 Author Share Posted September 21, 2019 Mmh, so maybe i should ask a different question: Is there an Emby api endpoint that allows to stream multiple video items one after the other? Or is it possible to stream a complete Emby playlist? Link to comment Share on other sites More sharing options...
softworkz 3335 Posted September 21, 2019 Share Posted September 21, 2019 Emby-integrated playlists would be the way to go, but it will never be a single (seamless) stream. It will always be like starting a new playback - just that it's happening automatically. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted September 21, 2019 Author Share Posted September 21, 2019 And what would be the api call? The streaming endpoint doesn't seem to work with the playlist id. Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 21, 2019 Share Posted September 21, 2019 This won't work as a channel plugin, which is what the IPTV plugin is I think you are better off generating an m3u that users could then feed into the m3u tuner feature. And then of course xml for matching guide data. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted September 21, 2019 Author Share Posted September 21, 2019 This won't work as a channel plugin, which is what the IPTV plugin is I think you are better off generating an m3u that users could then feed into the m3u tuner feature. And then of course xml for matching guide data.Forget the IPTV plugin. I've tried to open ...stream/{playlistId}/static=true?apikey={myapikey} (cannot remember the exact syntax and cannot look at swagger right now) in VLC, but only got an error. Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 21, 2019 Share Posted September 21, 2019 Right that won't work. You can only open streams On media files. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted September 21, 2019 Author Share Posted September 21, 2019 Then again: Is it possible to open an Emby playlist as a stream somehow? Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 21, 2019 Share Posted September 21, 2019 Then again: Is it possible to open an Emby playlist as a stream somehow? No. What you can do is get the list of items and then open them up one at a time. Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 21, 2019 Share Posted September 21, 2019 Based on your stated end goal of PseudoTV, I think your best bet is to implement ITunerHost to provide the content. Granted, it is not yet fully supported to implement a tuner host in a plugin, but it's on my to do list to move some of our current ones to plugins. But I'll support you, and if this is what you want to do, i can try and look at that soon. Link to comment Share on other sites More sharing options...
softworkz 3335 Posted September 21, 2019 Share Posted September 21, 2019 I don't want to play the bad guy here, but TV is meant for playing tv streams. Those are limited to a small range of formats and codecs for video, audio and subtitles. That "small range" allows us to do things in the area of live tv that we can't do generally for all media formats. Opening up the TV feature for playback of arbitrary media formats is something that we should think about carefully. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted September 21, 2019 Author Share Posted September 21, 2019 @@softworkz Don't be a poor sport! @@Luke Thanks! But i know you have so many other things on your radar, so i will try some other approach first to solve the problem. Link to comment Share on other sites More sharing options...
softworkz 3335 Posted September 21, 2019 Share Posted September 21, 2019 @@softworkz Don't be a poor sport! I'm just trying to avoid opening Pandora's box - for both, yours and ours sake... :-) Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted October 9, 2019 Author Share Posted October 9, 2019 @@softworkz to get continous playback i want to use ffmpeg's complex concat filter like this: ffmpeg.exe -re -i "input1.mkv" -re -i "input2.mkv" -filter_complex "[0:v]scale=w=1920:h=1080:interl=-1:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1/1,setpts=PTS-STARTPTS,yadif=0:-1:0[v0]; [1:v]scale=w=1920:h=1080:interl=-1:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1/1,setpts=PTS-STARTPTS,yadif=0:-1:0[v1]; [v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx265 -crf 26 -preset superfast -c:a aac -ab 256k -ac 6 -r 24 output.mp4 To minimize processor usage i'm using "-re" (read input at native framerate). But there seems to be a bug in ffmpeg, because "-re" is only applied for the first item. As you are already providing custom ffmpeg buils for Emby, maybe you could fix there? Link to comment Share on other sites More sharing options...
Luke 37060 Posted October 9, 2019 Share Posted October 9, 2019 This approach would never fly with end users because you're going to be forcing content through ffmpeg on the server when it could otherwise potentially direct play. That's why if you instead follow the approach i mentioned earlier, then although it will have quirks, we can gradually help you with core support if you're able to build up users. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted October 9, 2019 Author Share Posted October 9, 2019 This approach would never fly with end users because you're going to be forcing content through ffmpeg on the server when it could otherwise potentially direct play. That's why if you instead follow the approach i mentioned earlier, then although it will have quirks, we can gradually help you with core support if you're able to build up users. You mean to implement ITunerHost? What would be the advantages and what are the quirks? Right now i do not even know where to start with ITunerHost, where should i implement it? Link to comment Share on other sites More sharing options...
softworkz 3335 Posted October 10, 2019 Share Posted October 10, 2019 @@softworkz to get continous playback i want to use ffmpeg's complex concat filter like this: ffmpeg.exe -re -i "input1.mkv" -re -i "input2.mkv" -filter_complex "[0:v]scale=w=1920:h=1080:interl=-1:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1/1,setpts=PTS-STARTPTS,yadif=0:-1:0[v0]; [1:v]scale=w=1920:h=1080:interl=-1:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1/1,setpts=PTS-STARTPTS,yadif=0:-1:0[v1]; [v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx265 -crf 26 -preset superfast -c:a aac -ab 256k -ac 6 -r 24 output.mp4 To minimize processor usage i'm using "-re" (read input at native framerate). But there seems to be a bug in ffmpeg, because "-re" is only applied for the first item.As you are already providing custom ffmpeg buils for Emby, maybe you could fix there? There is no bug in ffmpeg. ffmpeg supports multiple inputs primarily for sequential rather than for simultaneous reading. It (let's say the "input module") cannot know that your second input will only be needed after the first one is completely read. Anyway, the concat filter is not the right approach. What you would need is the "concat demuxer". Please note, there are three "concat things" in ffmpeg: concat demuxer concat filter concat protocol Don't spend time with the "concat protocol". It requires all files to be of the same structure. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted October 10, 2019 Author Share Posted October 10, 2019 Anyway, the concat filter is not the right approach. What you would need is the "concat demuxer". Please note, there are three "concat things" in ffmpeg: concat demuxer concat filter concat protocol Don't spend time with the "concat protocol". It requires all files to be of the same structure. It's the other way: http://ffmpeg.org/ffmpeg-formats.html#concat "All files must have the same streams (same codecs, same time base, etc.)." Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now