UI::HtmlDialog not playing MP4 video, UI::WebDialog does

I am trying to play a MP4 video in HTML with UI::HtmlDialog using the HTML5 standard way to embed it:

<video width="1280" height="720" controls>
  <source src="movie.mp4" type="video/mp4">
</video>

The video is not embedded properly, and I have to convert it to .ogg to make it work. This was working correctly with the deprecated UI::WebDialog, so I guess there is any problem either with the codecs or with the HTML5 usage.

the codex is most likely fine…

HtmlDialog uses CEF [Chrome Embedded Framework] so new rules apply…

video tag changes on chrome

john

Why not switch to using OGG? OGG is an open format that is freely redistributable, MP4 is not. If license types (free/non-free) are a limitation that is relevant for your use case, this should be motivation enough to support the side that works for you.

Apparently Chromium Embedded (CEF) needs to be compiled with include proprietary codecs.
We don’t know whether SketchUp compiled CEF with that option or not.

1 Like

@Aerilius eventually I will need to use OGG to deal with license types, that is why I am already converting some videos. But internally I save a lot of time by using MP4 for now.

It also seems to me that you point to the right issue, probably SketchUp didn’t compile CEF with include proprietary codecs in the new HtmlDialog class.

Can you report an issue with a complete example, including a video demonstrating what you observe?

yeh,

CEF in SU v18 loads an empty player for mp4’s…

drop the mp4 in the zip into Sketchup.temp_dir so that it’s relative to the [not yet created] html, and it won’t play…

add the .ogv and that will play…

anyone of you used ffmpeg2theora windows?

I used brew install ffmpeg2theora on the mac…

it’s very fast but drops the last few frames on this short clips…

@tt_su you know I’m rubbish at putting stuff on github…

dlg = UI::HtmlDialog.new(
	dialog_title:    'local mp4 or ogv?',
	preferences_key: 'com.local.mp4',
	scrollable:       true,
	resizable:        true,
	width:            800,
	height:           450,
	style:            UI::HtmlDialog::STYLE_WINDOW
)

  html = <<-HTML
	<!DOCTYPE html> 
	<html> 
	<body> 
	<video width="400" controls autoplay>
		<source src="pencil.mp4" type="video/mp4" />
		<source src="pencil.ogv" type="video/ogg" />
	</video>
	</body> 
	</html>
	HTML

  dlg.set_html(html)
  dlg.center
  dlg.show

pencil.zip (28.2 KB)

clippy

“Looks like you are trying to log an issue!”

3 Likes

We need to hack together a discourse bot for that!

1 Like

The deprecated dialog uses OS provided browser and proprietary video codecs, while the shipped Chromium-based dialog does not. However with HtmlDialog, we can guarantee the consistency of video codecs you will find in SketchUp.

3 Likes

So these codecs are the default ones from Chromium? And Chrome itself provides an extended set? Or does that also tap into system installed codecs?

The embedded chrome has this fixed set, on both platforms. It does not reach for proprietary codec’s that may exist within the operating system.