Git Product home page Git Product logo

Comments (14)

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

A priori, multiple audio sources should be exposed as multiple pads on the cef demuxer. You can then perform mixing at your discretion with eg audiomixer. Can you confirm you do get multiple audio pads in your case?

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

Also for reference re pulse, that was the original design of the larger application I use this element in, as audio support hadn't yet been merged upstream at the time, but being able to switch to the new CEFAudioHandler made things decidedly simpler and easier to integrate.

Note that I wouldn't object to merging a higher-level bin that would take care of instantiating both the source and the demuxer, and perhaps expose a property to allow performing mixing of the audio streams, eg mix-audio-streams. One could make that bin implement the GstChildProxy interface as well, so that the user can also set the mix-matrix property if more control is desired over how to perform audio mixing.

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

ping @thierrygayet :)

from gstcefsrc.

thierrygayet avatar thierrygayet commented on August 11, 2024

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

export LD_PRELOAD=/overlay/cef-gstreamer/Release/libcef.so

You need to do that when you don't use the appropriate option when building CEF / chromium yourself. The spotify builds that are used by default are built with that option, I'm afraid I don't remember how to set it however, you can probably find this in the CEF forums.

Futhermore, i have also generated the dot files used a debug and converted
to PDF.

That should let you verify how many audio pads were exposed by cefdemux, you can upload the dot files here if you want me to take a look.

In general, if you want to use this element with an arbitrary number of audio streams, I would recommend either writing a simple application around it, or implementing a wrapper bin as I suggested in my earlier comment, I'll be happy to review / upstream it :)

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

from https://magpcss.org/ceforum/viewtopic.php?f=6&t=14122:

The CEF binaries are built with tcmalloc by default. You need to either run with LD_PRELOAD=libcef.so or build CEF locally without tcmalloc. See https://bitbucket.org/chromiumembedded/cef/issues/1827 for additional details.

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

@thierrygayet you also haven't attached your html file anywhere that I can see ;)

from gstcefsrc.

thierrygayet avatar thierrygayet commented on August 11, 2024

yes i know but html if not a supported extension on github.

That's why i have sent them by email directly.

Here is a sample of html file :

  <html>
  <body style="background-color:aliceblue;">
  <embed type="video/mp4"  src="Comptines_et_chansons_pour_enfants.mp4" autostart="true" width="600" height="720" volume="1"/>
  <embed type="video/webm" src="Volcano_Lava_Sample.webm"               autostart="true" width="400" height="720" volume="0.3"/>
  </body>
  </html>

BR
Thierry

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

OK so with the spotify build, the video stream for "Comptines_et_chansons_pour_enfants.mp4" never starts, and the "Volcano_Lava_Sample.webm" starts but pauses immediatley, so I can't really reproduce your issue here, afaict their binaries are not necessarily built with the ffmpeg backend, didn't look further.

Regarding playback of multiple audio streams however, when using wave files things seem to work as expected:

gst-launch-1.0 audiotestsrc num-buffers=3000 ! audio/x-raw, channels=2 ! wavenc ! filesink location=sine.wav
gst-launch-1.0 audiotestsrc num-buffers=3000 wave=white-noise ! audio/x-raw, channels=2 ! wavenc ! filesink location=snow.wav
<html>
                <body style="background-color:aliceblue;">
                  <embed autostart="true" type="audio/wav" src="sine.wav" />
                  <embed autostart="true" type="audio/wav" src="snow.wav" />
                </body>     
</html>
gst-launch-1.0 -v cefsrc url="file:///home/meh/Downloads/foo.html" ! queue ! cefdemux name=d d.video ! video/x-raw ! queue ! videoconvert ! xvimagesink d.audio_1 ! audio/x-raw ! queue ! audioconvert ! pulsesink volume=1.0 async=false d.audio_2 ! audio/x-raw ! queue ! audioconvert ! pulsesink volume=1.0 async=false

Both streams are output to the audio sinks :)

from gstcefsrc.

thierrygayet avatar thierrygayet commented on August 11, 2024

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

I would try to make an audio mix while gstreamer without having to go through pulse audio as I work environment server.

+1 to this, if you manage to make your use case work that way it's definitely the nicer solution :)

Closing this as I think we've come to a conclusion here, please reopen if the original issue statement (can't mix several audio sources) still gives you problems :)

from gstcefsrc.

thierryg avatar thierryg commented on August 11, 2024

Hi Matthew,

I had a question when there are several different audio in a web page. The last tests showed that we got two audio pads (audio_0 and audio_1).

My question, if you will answer it to continue the discussion we had, would be to know, if dynamically, it would be possible to manage on the fly, several pads.

When I mean dynamically, I mean that the proof of concept page could create different audio. So the question is whether a pipeline written in python for example could dynamically manage an additional pqd or add a module without disturbing the stream.

BR
Thierry

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on August 11, 2024

Yes, it is possible for an application written in any language to properly manage a dynamic GStreamer pipeline.

from gstcefsrc.

thierryg avatar thierryg commented on August 11, 2024

Indeed, this is what I have seen on this website that shows several examples in python's script:
https://github.com/MaZderMind/dynamic-gstreamer-pipelines-cookbook.git

from gstcefsrc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.