Skip to content

Instantly share code, notes, and snippets.

View anselmobattisti's full-sized avatar
🇧🇷
Aqui é Brasil!

Anselmo Battisti anselmobattisti

🇧🇷
Aqui é Brasil!
View GitHub Profile
// here works!
// this code will set display error in php in a very good way!
// ----------------------------------------------------------------------------------------------------
// - Display Errors
// ----------------------------------------------------------------------------------------------------
ini_set('display_errors', 'On');
ini_set('html_errors', 0);
// ----------------------------------------------------------------------------------------------------
@anselmobattisti
anselmobattisti / email.php
Created February 19, 2019 19:40
send email using joomla
# Invoke JMail Class
$mailer = JFactory::getMailer();
# Set sender array so that my name will show up neatly in your inbox
$mailer->setSender($data[‘mailfrom’]);
# Add a recipient — this can be a single address (string) or an array of addresses
$mailer->addRecipient($user->email);
@anselmobattisti
anselmobattisti / gsteramer_get_name.c
Created July 24, 2019 21:49
Get the name os an object gstreamer
#include <glib.h>
#include <gst/gst.h>
int main(int argc, char *argv[]) {
gst_init (&argc, &argv);
GstElement *element;
element = gst_element_factory_make("fakesrc","source");
@anselmobattisti
anselmobattisti / ogg-audio-udp-gstreamer
Created August 20, 2019 00:56
Send oggaudio via udp gstreamer
Server
gst-launch-1.0 -v filesrc location=../../../samples/musica.ogg ! oggdemux ! vorbisdec ! audioconvert ! rtpL24pay ! udpsink host=localhost auto-multicast=true port=5000
Client
gst-launch-1.0 -v udpsrc uri=udp://localhost:5000 caps="application/x-rtp,channels=(int)2,format=(string)S16LE,media=(string)audio,payload=(int)96,clock-rate=(int)44100,encoding-name=(string)L24" ! rtpL24depay ! audioconvert ! autoaudiosink sync=false
@anselmobattisti
anselmobattisti / gstreamer-audio-ogg.c
Created August 20, 2019 22:15
Simple program in c that uses gstreamer to play a ogg audio
#include <gst/gst.h>
// gst-launch-1.0 videotestsrc ! videobalance saturation=0 ! x264enc ! video/x-h264, stream-format=byte-stream ! rtph264pay ! udpsink host=35.153.160.117 port=5000
int main (int argc, char *argv[]) {
GstElement *pipeline, *src;
GstElement *x264enc;
// GstElement *x264enc,
// GstElement *rtph264pay,
GstElement *autovideosink;
@anselmobattisti
anselmobattisti / gstreaner_udp_cast_ogg_music.c
Created August 20, 2019 22:32
Gstremaer udp cast ogg audio
/*
Plugin Name: Foward
What it do: This is the simplest plugins that can be done. It's unique function is delivery a stream
to an application via UDP. It's use gstreamer
Pipeline: SRC -> Forward -> Application
Parameters:
- DEST: The IP and PORT that the stream must be delivered
sudo docker run -ti busybox ping google.com
sudo docker run -ti busybox ping google.com
docker inspect <container_name> | egrep IPAddress
gst-discoverer-1.0 rtsp://192.168.0.110:8080/h264_ulaw.sdp