[FFmpeg Web Video] videostream unnecesary transcoding?
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
[FFmpeg Web Video] videostream unnecesary transcoding?
I prepared an internal livestream via VLC that I want to distribute/be discovered via UMS. The VLC command includes:
And UMS.conf includes the line:
My Kalemsoft renderer supports that stream in the conf file, and that's reflected in the logs:
Problem is, that when ffmpeg is launched to treat that stream, it launches a full transcoding as per:
Is there any way to control ffmpeg behavior in Web Video mode and avoid transcoding, or if remuxing is needed, at most force video / audio streams to be copied as is and let the renderer handle them natively?
Ichecked https://github.com/UniversalMediaServer ... webfilters and https://github.com/UniversalMediaServer ... Video.java but couldn't find any tip in how/if additional configuration is needed.
Thx for any help, Wolf.
Code: Select all
:sout=#http{mux=ts,dst=:8082/} :sout-all :ttl=3 :sout-keepCode: Select all
videostream.Web,IPTVh8082=LiveHttp 8082,http://192.168.1.84:8082/Code: Select all
Matched support line f:mpegps|mpegts|mpg m:video/mpegCode: Select all
Starting D:\Program Files\Universal Media Server\win32\ffmpeg64.exe -y -loglevel info -i http://192.168.1.84:8082/ -c:a ac3 -c:v mpeg2video -f vob -g 5 -q:v 1 -qmin 2 -qmax 3 -q:a 3 \\.\pipe\ffmpegwebvideo_68_1452711823793Ichecked https://github.com/UniversalMediaServer ... webfilters and https://github.com/UniversalMediaServer ... Video.java but couldn't find any tip in how/if additional configuration is needed.
Thx for any help, Wolf.
- Attachments
-
- ums_dbg-httpstream.zip
- (66.04 KiB) Downloaded 746 times
-- UMS serving PS3, WDTV, Samsung H6400 + J5500 and Kalemsoft renderers! (no video transcoding but remuxing accepted
)
Re: [FFmpeg Web Video] videostream unnecesary transcoding?
I don't know anything about web streaming in UMS, but it doesn't seem like it even tries to match the "supported" lines. This line could be a hint:
I don't think UMS manages to find any information about the media, and thus it's not possible to check if it's supported or not. I'd give the "old mediaparser" a try and see if it does a better job with web streams. To enable that, set
in the renderer profile. I'm sure you know this, but that means the "supported" lines won't be read, and the old "TranscodeExtensions" and "StreamExtensions" come into play instead. But, there's no extension for a stream, so I don't know what it will do. It will probably transcode as well.
Code: Select all
TRACE 2016-01-13 15:43:10.025 [main] Could not match any format to ".84:8082/"Code: Select all
MediaInfo = falseRe: [FFmpeg Web Video] videostream unnecesary transcoding?
Thanks Nadahar for the catch, I didn't noticed the line:
That's weird as ".84:8082/" is the trail part of the URL declared in Web.conf
Will do a quick test with MediaInfo = false and see what happens then...
Thanks!
Code: Select all
TRACE 2016-01-13 15:43:10.025 [main] Could not match any format to ".84:8082/"Will do a quick test with MediaInfo = false and see what happens then...
Thanks!
-- UMS serving PS3, WDTV, Samsung H6400 + J5500 and Kalemsoft renderers! (no video transcoding but remuxing accepted
)
Re: [FFmpeg Web Video] videostream unnecesary transcoding?
For ffmpeg.webfilters, you could try to copy streams by adding a rule in the OPTIONS section like so:Wolfgan wrote:if remuxing is needed, at most force video / audio streams to be copied as is and let the renderer handle them natively?
...Ichecked ...ffmpeg.webfilters ... but couldn't find any tip in how/if additional configuration is needed.
Code: Select all
192.168.1.84:8082 | -c copy
Re: [FFmpeg Web Video] videostream unnecesary transcoding?
That worked (at least in light testing), thanks Infidel & Nadahar! The logs reflect ffmpeg mapping the streams in copy mode, no transcode involved.
What puzzles me now is that the live stream stops around 5 seconds after the start in all the renderers I tested. The metadata received reflects a (fake) file size of 8589934592.00 GB but just 04.08 seconds in time length.
Is there any other config option to touch and assign a longer fake 24hs length or so?
Thx, Wolf
What puzzles me now is that the live stream stops around 5 seconds after the start in all the renderers I tested. The metadata received reflects a (fake) file size of 8589934592.00 GB but just 04.08 seconds in time length.
Is there any other config option to touch and assign a longer fake 24hs length or so?
Thx, Wolf
- Attachments
-
- ums_dbg-httpstream2.zip
- (81.82 KiB) Downloaded 725 times
-- UMS serving PS3, WDTV, Samsung H6400 + J5500 and Kalemsoft renderers! (no video transcoding but remuxing accepted
)
Re: [FFmpeg Web Video] videostream unnecesary transcoding?
I tried it myself and I don't know whether this is the critical difference in your case, but on linux it wouldn't work until I streamed from vlc using a fake extension, per (possibly outdated?) caveat #1 in vlc wiki streaming how-to in order to avoid flv output:Wolfgan wrote:What puzzles me now is that the live stream stops around 5 seconds after the start in all the renderers I tested.
and:sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:http{dst=:8080/go.mpg} :sout-keep
Code: Select all
videostream.Web,VLC=test,http://127.0.0.1:8080/go.mpg
Re: [FFmpeg Web Video] videostream unnecesary transcoding?
Thanks Infidel. It seems is a matter of how the renderer interprets the received stream and the assigned size (9223372034707292159 sent by ffmpeg) / length (09:59:59 sent by ffmpeg), as I guess some renderers do their own stream analysis to assign the total length and cut after what they decide is the calculated end (and that's why I was able to watch just 5"). I need more testing on different renderers to see how they react.infidel wrote:I tried it myself and I don't know whether this is the critical difference in your case, but on linux it wouldn't work until I streamed from vlc using a fake extension, per (possibly outdated?) caveat #1 in vlc wiki streaming how-to in order to avoid flv output:Wolfgan wrote:What puzzles me now is that the live stream stops around 5 seconds after the start in all the renderers I tested.and:sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:http{dst=:8080/go.mpg} :sout-keepAnyhow it streams ok for me using vlc 2.2.1 and Kodi as renderer.Code: Select all
videostream.Web,VLC=test,http://127.0.0.1:8080/go.mpg
Do you know by any chance where those values come from? Are they fakely sent by any UMS module? (I suspect some old renderers like WDTV may get confused receiving numbers so big, or simply overflow the values)
Thx, Wolf
-- UMS serving PS3, WDTV, Samsung H6400 + J5500 and Kalemsoft renderers! (no video transcoding but remuxing accepted
)
Re: [FFmpeg Web Video] videostream unnecesary transcoding?
Yes, ums does it when there's no media info (afaik this dates back to early PMS days and spoofing the PS3 to accept transcoding). But I somehow doubt that this is why you're getting an abrupt termination.Wolfgan wrote:Do you know by any chance where those values come from? Are they fakely sent by any UMS module?
If fake extension had no effect for you, maybe try
Code: Select all
ChunkedTransfer=trueRe: [FFmpeg Web Video] videostream unnecesary transcoding?
Sorry to necro this thread, but it's really important. I tried adding a video stream to the OPTIONS section of my ffmpeg.webfilters:
It doesn't do anything. The video from this stream still gets transcoded using libx264. Does anyone know what's going on? This is on the latest version of UMS.
Code: Select all
# These are custom rules to fine-tune the behaviour of
# FFmpeg Web Video transcoding with respect to specific urls.
########################## EXCLUDE ##############################
# urls to be skipped (i.e. passed along to later engines)
# format: <regex to match>
#################################################################
EXCLUDE
# unresolved youtube urls
#gdata\.youtube\.com|youtube_gdata
# other unresolved urls
feeds\.feedburner\.com
www\.gameswelt\.de
eurogamer\.net
gametrailers\.com
giantbomb\.com
icanhascheezburger\.com
pcgames\.de
winfuture\.de
########################## OPTIONS ##############################
# urls requiring specific FFmpeg options.
# format: <regex to match> | <options to add>
#################################################################
OPTIONS
trailers\.apple\.com | -user-agent QuickTime/7.6.2
# uncomment the rule below if you experience audio problems with endgadget:
#www\.viddler\.com | -target ntsc-dvd
# THIS IS THE LINE THAT I ADDED
http://127\.0\.0\.1:8080/ | -c:v copy
########################## REPLACE ##############################
# urls to be modified (using capture groups).
# format: <regex to match> | <replacement regex>
# example: .*somewhere\.com.* | $0\?somevar=true
#################################################################
REPLACE
# no rules yetRe: [FFmpeg Web Video] videostream unnecesary transcoding?
I did not read much of this thread, just skimmed the OP, as it is very old and probably does not apply any more.
I know nothing about the web filters, I think these days UMS handles web streams a lot better and most often these use hls.
As I understand at a quick look I think you need to set a UMS option for that rule and "-c:v copy" is for FFmpeg.
I think what you meant to use here is CustomFFmpegOptions = -c:v copy but I have no idea if it would work.
I don't know if this is right or even if these filters are used in the current version.
The important thing to get right is your renderer conf so UMS knows whether to transcode or not.
Is this for your Sony TV where you made the conf tweaks? I don't think the changes you made would work for this.
If you are wanting to play from the web browser these will always be transcoded into h264 using hls as is the standard for html5, mainly because it does not have the downsides of normal transcoding like being unable to seek and not able to change audio/sub tracks.
What specifically are you trying to do?
I might be able to give better help if I could see your logs on why it is transcoding (see the section in red above).
I know nothing about the web filters, I think these days UMS handles web streams a lot better and most often these use hls.
As I understand at a quick look I think you need to set a UMS option for that rule and "-c:v copy" is for FFmpeg.
I think what you meant to use here is CustomFFmpegOptions = -c:v copy but I have no idea if it would work.
I don't know if this is right or even if these filters are used in the current version.
The important thing to get right is your renderer conf so UMS knows whether to transcode or not.
Is this for your Sony TV where you made the conf tweaks? I don't think the changes you made would work for this.
If you are wanting to play from the web browser these will always be transcoded into h264 using hls as is the standard for html5, mainly because it does not have the downsides of normal transcoding like being unable to seek and not able to change audio/sub tracks.
What specifically are you trying to do?
I might be able to give better help if I could see your logs on why it is transcoding (see the section in red above).
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
