Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] Upgrade to CEF3239 (Chromium 63) #611

Closed
wants to merge 2,718 commits into from

Conversation

@Julusian
Copy link
Member

commented Jul 10, 2017

This upgrades the HTML producer to a more modern version of Chromium (CEF3239 / Chromium 63).

This builds on the work from @AndreasWilladsen and @sesse. Any additional tweaks or tests to run are appreciated. I have labelled this PR as a WIP as performance is not yet perfect and some frames appear to be being lost, however the same is true of the current version

Improvements:

  • Newer chromium. Gives new features and makes template dev much easier at it matched current versions of chrome
  • Font smoothing
  • 3D CSS

Missing:

Forum post: https://casparcg.com/forum/viewtopic.php?f=3&t=4681&p=29526

Builds: https://caspar.julusian.co.uk/cef-upgrade/

Helge Norberg added some commits Oct 4, 2016

Helge Norberg
[ffmpeg] Recompiled FFmpeg on Linux with --enable-libv4l2 and allow i…
…t to be used just as with dshow in Windows with for example v4l2:///dev/video0
Helge Norberg
[ffmpeg] Remove redundant av_frame_alloc()/av_frame_free() RAII pairs…
… all over the code and use ffmpeg::create_frame() instead which encapsulates that creation.
Helge Norberg
[ffmpeg_producer] Resolved problem where video decoders having CODEC_…
…CAP_DELAY needs to be fed "null" packets at EOF until no more frames can be decoded. Possible related issue #473
Helge Norberg
[osc] Added possibility to completely disable sending OSC to connecte…
…d AMCP clients, only sending to predefined-clients. The option is disable-send-to-amcp-clients under the osc element in casparcg.config.
@vimlesh1975

This comment has been minimized.

Copy link

commented on 9a9d384 Oct 9, 2016

This is good feature. Once one single client was getting OSC from two different network casparcg servers. And thus confusing the client.

Helge Norberg added some commits Oct 10, 2016

Helge Norberg
[ffmpeg] Reimplemented support for playing all audio streams in a cli…
…p and treating all audio channels in each stream as if they where part of one single stream.
@vimlesh1975

This comment has been minimized.

Copy link

commented on 009816d Oct 13, 2016

Very Nice.

This comment has been minimized.

Copy link

replied Oct 17, 2016

Nice, but how can i play an audiostream?

This comment has been minimized.

Copy link
Contributor

replied Oct 17, 2016

All streams are treated as one so for example if you have 2 stereo streams it will be treated as one 4 channel stream. So depending on what you want and how the video channel playing on is set up you might have to do some tweaking. What is your use case?

This comment has been minimized.

Copy link
Contributor

replied Oct 17, 2016

for example if the video channel is set to channel-layout stereo then you could do

PLAY 1-10 clip_with_dual_stereo CHANNEL_LAYOUT "stereo:_ _ FL FR"

to ignore channel 1 and 2 and map 3 to front left (FL) and 4 to front right (FR)

Helge Norberg and others added some commits Oct 13, 2016

Helge Norberg
Created a consumer that provides sync to a channel based on the pace …
…of another channel. I called it syncto_consumer. It solves problems where the rendering pace of a routed from channel (without a decklink consumer) differs from the routed to channel.
Helge Norberg
[general] Abstracted the concept of a key only frame so that readers …
…of const_frame can be transparently tricked into accessing key only data.
Helge Norberg
[streaming_consumer] Started the process of retiring ffmpeg_consumer …
…so that streaming_consumer can finally take its place as both FILE and STREAM consumer.
Merge pull request #493 from dimitry-ishenko-casparcg/2.1.0
[ffmpeg_producer] Constrain SEEK values
@walterav1984

This comment has been minimized.

Copy link
Contributor

commented on c4e32e6 Nov 4, 2016

Very cool feature adding support for v4l2 devices, this adds a lot of input flexability!!!

Request:
FFmpeg also has great support for direct FireWire/1394 capture/streaming of "DV/HDV" if compiled with flag "enable libiec61883 " and dependencies on the host. Could this feature also be enabled for the 2.1.0 release? Its very easy to use, stable and has very few parameters to setup(mostly auto).

https://ffmpeg.org/ffmpeg-devices.html#toc-iec61883

Ubuntu 16.04 ships a ffmpeg version with native support of this flag and this works fine even with melt (mlt framework).

This comment has been minimized.

Copy link
Contributor

replied Nov 4, 2016

PS: The FireWire GUID is the most important/mandatory feature to setup. This lets you specify a unique camera / recorder among multiple active connected ones.

@baltedewit

This comment has been minimized.

Copy link
Member

commented Jan 9, 2018

Getting the following error in linux after keeping a template open for a few minutes.

[0109/084502.122481:FATAL:cef_ref_counted.h(333)] Assert failed: ptr_ != __null. 

#0 0x7f1e3f4dc207 base::debug::StackTrace::StackTrace()
#1 0x7f1e3f4f2ce1 logging::LogMessage::~LogMessage()
#2 0x7f1e3f40f32c cef_log
#3 0x000000bfa7dc cef::logging::LogMessage::~LogMessage()
#4 0x000000bc0d35 scoped_refptr<>::operator->()
#5 0x000000bc8681 caspar::html::html_producer::on_interaction()
#6 0x000000a1af5b caspar::core::interaction_aggregator::translate_and_send()
#7 0x000000a24ced _ZZN6caspar4core5stage4implclERKNS0_17video_format_descEENKUlvE_clEv
#8 0x000000a2520a _ZNSt17_Function_handlerIFSt3mapIiN6caspar4core10draw_frameESt4lessIiESaISt4pairIKiS3_EEEvESt17reference_wrapperISt12_Bind_simpleIFSC_IZNS1_8executor21internal_begin_invokeIZNS2_5stage4implclERKNS2_17video_format_descEEUlvE_EESt6futureIDTclfp_EEEOT_NS1_13task_priorityEEUlvE_EvEEEE9_M_invokeERKSt9_Any_data
#9 0x000000a1b9af std::_Function_handler<>::_M_invoke()
#10 0x0000008c540e std::__future_base::_State_base::_M_do_set()
#11 0x7f1e3a9d9a99 __pthread_once_slow
#12 0x0000008f8850 _ZSt9call_onceIMNSt13__future_base11_State_baseEFvRSt8functionIFSt10unique_ptrINS0_12_Result_baseENS4_8_DeleterEEvEERbEJKPS1_St17reference_wrapperIS8_ESF_IbEEEvRSt9once_flagOT_DpOT0_
#13 0x000000a09c2d std::__future_base::_State_base::_M_set_result()
#14 0x000000a41605 _ZNSt13__future_base11_Task_stateIZN6caspar8executor21internal_begin_invokeIZNS1_4core5stage4implclERKNS4_17video_format_descEEUlvE_EESt6futureIDTclfp_EEEOT_NS1_13task_priorityEEUlvE_SaIiEFSt3mapIiNS4_10draw_frameESt4lessIiESaISt4pairIKiSK_EEEvEE6_M_runEv
#15 0x000000a1a6b0 _ZNSt17_Function_handlerIFvvEZN6caspar8executor21internal_begin_invokeIZNS1_4core5stage4implclERKNS4_17video_format_descEEUlvE_EESt6futureIDTclfp_EEEOT_NS1_13task_priorityEEUlvE0_E9_M_invokeERKSt9_Any_data
#16 0x000000918154 caspar::executor::run()
#17 0x000000ca43cf thread_proxy
#18 0x7f1e3a9d26ba start_thread
#19 0x7f1e397c73dd clone

Received signal 6
#0 0x7f1e3f4dc207 base::debug::StackTrace::StackTrace()
#1 0x7f1e3f4dbd6f base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x7f1e3a9dc390 <unknown>
#3 0x7f1e396f5428 gsignal
#4 0x7f1e396f702a abort
#5 0x7f1e3f4da5b2 base::debug::BreakDebugger()
#6 0x7f1e3f4f30ca logging::LogMessage::~LogMessage()
#7 0x7f1e3f40f32c cef_log
#8 0x000000bfa7dc cef::logging::LogMessage::~LogMessage()
#9 0x000000bc0d35 scoped_refptr<>::operator->()
#10 0x000000bc8681 caspar::html::html_producer::on_interaction()
#11 0x000000a1af5b caspar::core::interaction_aggregator::translate_and_send()
#12 0x000000a24ced _ZZN6caspar4core5stage4implclERKNS0_17video_format_descEENKUlvE_clEv
#13 0x000000a2520a _ZNSt17_Function_handlerIFSt3mapIiN6caspar4core10draw_frameESt4lessIiESaISt4pairIKiS3_EEEvESt17reference_wrapperISt12_Bind_simpleIFSC_IZNS1_8executor21internal_begin_invokeIZNS2_5stage4implclERKNS2_17video_format_descEEUlvE_EESt6futureIDTclfp_EEEOT_NS1_13task_priorityEEUlvE_EvEEEE9_M_invokeERKSt9_Any_data
#14 0x000000a1b9af std::_Function_handler<>::_M_invoke()
#15 0x0000008c540e std::__future_base::_State_base::_M_do_set()
#16 0x7f1e3a9d9a99 __pthread_once_slow
#17 0x0000008f8850 _ZSt9call_onceIMNSt13__future_base11_State_baseEFvRSt8functionIFSt10unique_ptrINS0_12_Result_baseENS4_8_DeleterEEvEERbEJKPS1_St17reference_wrapperIS8_ESF_IbEEEvRSt9once_flagOT_DpOT0_
#18 0x000000a09c2d std::__future_base::_State_base::_M_set_result()
#19 0x000000a41605 _ZNSt13__future_base11_Task_stateIZN6caspar8executor21internal_begin_invokeIZNS1_4core5stage4implclERKNS4_17video_format_descEEUlvE_EESt6futureIDTclfp_EEEOT_NS1_13task_priorityEEUlvE_SaIiEFSt3mapIiNS4_10draw_frameESt4lessIiESaISt4pairIKiSK_EEEvEE6_M_runEv
#20 0x000000a1a6b0 _ZNSt17_Function_handlerIFvvEZN6caspar8executor21internal_begin_invokeIZNS1_4core5stage4implclERKNS4_17video_format_descEEUlvE_EESt6futureIDTclfp_EEEOT_NS1_13task_priorityEEUlvE0_E9_M_invokeERKSt9_Any_data
#21 0x000000918154 caspar::executor::run()
#22 0x000000ca43cf thread_proxy
#23 0x7f1e3a9d26ba start_thread
#24 0x7f1e397c73dd clone
  r8: 00007f1e09266a50  r9: 00007f1e09268700 r10: 0000000000000008 r11: 0000000000000202
 r12: 00007f1e09266ea0 r13: 0000000000000052 r14: 00007f1e09266e98 r15: 00007f1e09266e90
  di: 00000000000003b9  si: 00000000000003e0  bp: 00007f1e09266a50  bx: 00007f1e09266a50
  dx: 0000000000000006  ax: 0000000000000000  cx: 00007f1e396f5428  sp: 00007f1e092668a8
  ip: 00007f1e396f5428 efl: 0000000000000202 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.

Template contains a webm video with alpha channel, and and svg. animations through animejs.
This error is not appended to log file, just to console.
OS is Ubuntu 16.04, machine is an xps 9560.

I am also getting a few of the errors below, but they don't seem to hurt anyone:

[0109/084329.252598:ERROR:object_proxy.cc(573)] Failed to call method: org.gnome.SessionManager.Uninhibit: object_path= /org/gnome/SessionManager: org.gnome.SessionManager.GeneralError: Unable to uninhibit: Invalid cookie
[0109/084329.253476:ERROR:power_save_blocker_x11.cc(408)] No response to Uninhibit() request!
@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 9, 2018

@baltedewit do you consistently get this issue? I cant reproduce it on Ubuntu 14.04 myself.
I have attempted a fix based on the stack trace you posted, are you able to try it with this build? https://caspar.julusian.co.uk/cef-upgrade-potential-fix/
Interestingly the stack trace suggests it is an issue with interaction being sent to a destroyed html producer. Does this sound correct based on what you had been doing?

@baltedewit

This comment has been minimized.

Copy link
Member

commented Jan 10, 2018

I have tried your patch, and I can confirm that this is an issue in the interaction module in your normal build. It only occurs in this specific template.

Steps to reproduce:

  1. CG PLAY the template
  2. CG STOP the template
  3. Click anywhere in the screen consumer

In your latest patch however, it will crash after step 2. But it will not crash at all if I play other templates or just a plain HTML page.

I have uploaded the full template, including dependencies, here: https://balte.stackstorage.com/s/8c2z7vAjTohKTSf

Edit: just figured out what code in the template causes the crash. I am using a window.close() in the template after a CG STOP command.

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 10, 2018

@baltedewit Thanks for posting the template and STR, that made it really easy to find the issue.

A new build that fixes this will be up soon: https://caspar.julusian.co.uk/cef-upgrade/

@ronag ronag closed this Jan 16, 2018

@ronag ronag force-pushed the CasparCG:2.1.0 branch from a967354 to 84e99cb Jan 16, 2018

@ronag ronag added the forced label Jan 16, 2018

@ronag

This comment has been minimized.

Copy link
Member

commented Jan 16, 2018

This PR is not closed. However, we've force pushed the 2.1.0 branch in order to convert the history to LFS. Hopefully, this should reduce the repo size from several gigs to a several megs.

@Julusian just keep working and I will cherry-pick this into 2.1.0.

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 17, 2018

@ronag This is ready for you to take a look at. I am happy with it and it has been running fine in my testing.

@ronag

This comment has been minimized.

Copy link
Member

commented Jan 17, 2018

@Julusian perfect. It's on my list for next week.

@baltedewit

This comment has been minimized.

Copy link
Member

commented Jan 17, 2018

Would it be non-trivial to have gpu acceleration as an option in the config file?
There are some projects/ideas where we don't want to give up on WebGL.

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 17, 2018

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 18, 2018

@baltedewit I have done that now. Build should be up in ~10 minutes

@ronag

This comment has been minimized.

Copy link
Member

commented Jan 27, 2018

@Julusian does this fix #523?

@ronag

This comment has been minimized.

Copy link
Member

commented Jan 27, 2018

@Julusian Could you do a new PR based on 2.2.0?

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 27, 2018

Im not sure, I havent tested on any distro other than ubuntu 14.04.
Yes, I can rebase this then check it on 16.04, which is what someone had that issue on

@baltedewit

This comment has been minimized.

Copy link
Member

commented Jan 27, 2018

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 27, 2018

Can confirm this issue is still apparent on 16.04, the modification to the run script also still works.

OK, then it should really be added to the run script as 16.04 is now the supported version. I can do that whilst rebasing

@ronag

This comment has been minimized.

Copy link
Member

commented Jan 27, 2018

I'll merge ASAP there is a PR for 2.2.0. Could u do the same with #644?

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 27, 2018

sure. Ill do it as one PR for them both then

@ronag

This comment has been minimized.

Copy link
Member

commented Jan 29, 2018

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Jan 29, 2018

Yes, It was merged before I updated to CEF3239. It partially helped, but there is now a bottleneck within cef where it pulls frames from the gpu.
https://bitbucket.org/chromiumembedded/cef/issues/1006 looks to be another issue to watch to solve that

@pascoual

This comment has been minimized.

Copy link

commented Oct 5, 2018

@Julusian seem that the chromium Pull Request / Issue 1006 was manually merged one week ago.

Support external textures in OSR mode - revisted (issue #1006)

Marshall Greenblatt
This PR has been manually merged in master revisions 713eebc and 1e6b870 with minor style and documentation fixes.
Please create issues in the CEF issue tracker for any remaining problems related to this PR.

See here.

New Chromium version 71.0.3567.0 (#595360) from 4 October (2 days ago) have it.

@Julusian

This comment has been minimized.

Copy link
Member Author

commented Oct 8, 2018

@pascoual that is good to hear.

However as the latest stable release of CEF/Chromium is 69, we probably still want to wait until it is stable before we use it (unless we want to use a custom built copy of CEF). Hopefully I will have some time soon to give it a try though

@pascoual

This comment has been minimized.

Copy link

commented Dec 6, 2018

@juliusian Chromium 71 seem to be released as stable :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.