Gstreamer 1.0 strange pipeline behavior - pipeline

I'm have pipeline. It takes RTSP stream from camera, saves HLS segments and frames every minute:
gst-launch-1.0 rtspsrc latency=2000 location=rtsp://192.168.1.16/live2.sdp name=src ! queue ! rtpmp4vdepay ! decodebin ! videorate ! video/x-raw,framerate=15/1,format=I420 ! videoconvert ! tee name=tv
tv. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videoscale ! video/x-raw,width=320,height=240 ! videorate ! video/x-raw,framerate=1/60,format=I420 ! jpegenc quality=20 ! multifilesink location=/tmp/%06d-low.jpg
tv. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videorate ! video/x-raw,framerate=1/60,format=I420 ! jpegenc quality=60 ! multifilesink location=/tmp/%06d-mid.jpg
tv. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videoscale ! video/x-raw,width=320,height=240 ! x264enc bframes=0 bitrate=240 speed-preset=superfast ! mpegtsmux ! multifilesink location=/tmp/%06d-low.ts next-file=2
tv. ! queue ! videoparse width=640 height=480 framerate=15/1 ! x264enc bframes=0 key-int-max=15 bitrate=460 speed-preset=superfast ! mpegtsmux ! multifilesink location=/tmp/%06d-mid.ts next-file=2
It's works. But if I try to change x264enc speed-preset to better than superfast, pipeline not works (no errors, but no files appear).
It starts to work if I'm delete JPG parts and leave only TS.
Maybe I'm doing something wrong? How do I make video quality better?

I'm solved it. I added tee tv1 for images and tv2 for video.
---- queue leaky=1 ! tee name=tv1
/
tee ----
\
---- queue leaky=1 ! tee name=tv2
gst-launch-1.0 rtspsrc latency=2000 location=rtsp://192.168.1.16/live2.sdp name=src ! queue ! rtpmp4vdepay ! decodebin ! videorate ! video/x-raw,framerate=15/1,format=I420 ! videoconvert ! tee name=tv tv. ! queue leaky=1 ! videoparse width=640 height=480 framerate=15/1 ! tee name=tv1 tv. ! queue leaky=1 ! videoparse width=640 height=480 framerate=15/1 ! tee name=tv2
tv1. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videoscale ! video/x-raw,width=320,height=240 ! videorate ! video/x-raw,framerate=1/60,format=I420 ! jpegenc quality=20 ! multifilesink location=/tmp/%06d-low.jpg
tv1. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videorate ! video/x-raw,framerate=1/60,format=I420 ! jpegenc quality=60 ! multifilesink location=/tmp/%06d-mid.jpg
tv2. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videoscale ! video/x-raw,width=320,height=240 ! x264enc bframes=0 bitrate=240 speed-preset=superfast ! mpegtsmux ! multifilesink location=/tmp/%06d-low.ts next-file=2
tv2. ! queue ! videoparse width=640 height=480 framerate=15/1 ! x264enc bframes=0 key-int-max=15 bitrate=460 speed-preset=superfast ! mpegtsmux ! multifilesink location=/tmp/%06d-mid.ts next-file=2

Related

Woocommerce: How can I use Stripe ONLY for single payments? I want to turn it off for subscriptions payments

I am trying to disable Stripe for subscription payments and show it for ONLY single payments, as in one time payments only.
I came across the below code, but this does the opposite. I need it doing so it hides for subscriptions and shows for single payments (one time payments)
function so23120782_maybe_remove_stripe( $available_gateways ) {
if ( class_exists( 'WC_Subscriptions_Cart' ) && ( ! WC_Subscriptions_Cart::cart_contains_subscription() || ( isset( $_GET['order_id'] ) && ! WC_Subscriptions_Order::order_contains_subscription( $_GET['order_id'] ) ) ) ) {
if ( isset( $available_gateways['stripe'] ) ) {
unset( $available_gateways['stripe'] );
}
}
return $available_gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'so23120782_maybe_remove_stripe', 11 );
Maybe just change the condition when to unset stripe:
if ( class_exists( 'WC_Subscriptions_Cart' ) && ( WC_Subscriptions_Cart::cart_contains_subscription() || ( isset( $_GET['order_id'] ) && WC_Subscriptions_Order::order_contains_subscription( $_GET['order_id'] ) ) ) ) {
(I have removed the "not" -- ! -- from the conditions, which should be fine)

Parameter must be an array or an object metaboxes-framework/init.php

Need help please!
metaboxes-framework/init.php
// if it's an array of one, extract it
elseif ( is_array( $meta_box['pages'] ) && count( $meta_box['pages'] === 1 ) )
$type = is_string( end( $meta_box['pages'] ) ) ? end( $meta_box['pages'] ) : false;
Parameter must be an array or an object metaboxes-framework/init.php
How can I correct this so that I don't get this error?
This is the correct way:
// if it's an array of one, extract it
elseif ( is_array( $meta_box['pages'] ) && count( $meta_box['pages']) === 1 )
$type = is_string( end( $meta_box['pages'] ) ) ? end( $meta_box['pages'] ) : false;
The closing parenthesis needs to be after the closing bracket, the way it's written originally means that it tries to count a boolean because the argument passed to count is $meta_box['pages] === 1
Funny thing is that I had exactly the same error in a WP plugin I installed and I didn't see it in my code editor so came across this question and immediately spotted the mistake :D

Redirected non-admin users. Now after deleting the code non-admins still can't login

I have used the following code to redirect non-admin users to the home page. Now after deleting the code, the effect is irreversible. non-admins still redirecting after login.
add_action( 'init', 'restrict_wp_dashboard_init' );
function restrict_wp_dashboard_init() {
if ( is_admin() && ! current_user_can( 'administrator' ) &&
!( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
wp_redirect( home_url() );
exit;
}
}
Help !!!

mkdir() error in wordpress: Permission denied ReduxCore

I'm hosting a wordpress website on godaddy, but late renewal cause hosting is being remove, after i recover, i get this error:
Warning: mkdir(): Permission denied in /home/mickaeladmin/public_html/en/wp-content/themes/getphoto/admin/redux-framework/ReduxCore/inc/class.redux_filesystem.php on line 104
and i found the line of the code is
elseif ( $action == 'copy' && ! isset( $this->filesystem->killswitch ) ) {
$res = $wp_filesystem->copy( $file, $destination, $overwrite, $chmod );
if ( ! $res ) {
$res = copy( $file, $destination );
if ( $res ) {
chmod( $destination, $chmod );
}
}
}
can i know what is the error? and how to fix it?
Basicly the error means that there are some missing permissions
you can change the user permission of a folder with an FTP Cllient. Detailed information can be found here
you should check the permissions and either set them on 775 or 664, Depends on what kind of permissions are needed precisly.
Hope this helps!

WordPress Admin Restricted access

The following code to restrict access to wp-login.php and wp-admin works for me, but could someone tell me if I miss something? I placed it in my function.php
if ( ! is_super_admin() && ! preg_match( '#admin-ajax\.php#', $_SERVER[ 'REQUEST_URI' ] ) ) {
if ( preg_match( '#^/wp-#', $_SERVER[ 'REQUEST_URI' ] ) || preg_match( '#wp-admin#', $_SERVER[ 'REQUEST_URI' ] ) ) {
wp_safe_redirect( 'https://...' );
exit;
}
}

Resources