BreezeSharp entity properties binding with Xamarin Forms Entry - mvvm-light

We are developing mobile application using Xamarin Forms framework (only targeting Android for now). We structured our application to utilize MVVM pattern with help of MVVMLight toolkit. For data management we are using BreezeSharp (as we already have Breeze friendly server implemented for web client).
The issue we are dealing with is application crash when typing in Xamarin Forms Entry control which is bound to property of Breeze entity.
Entry control in Xaml view:
<Entry Text="{Binding SelectedCustomerAddress.AddressLine1}" />
Property in ViewModel (Set() is from MVVMLight ViewModelBase):
public CustomerAddress SelectedCustomerAddress
{
get { return this.selectedCustomerAddress; }
set { this.Set(() => this.SelectedCustomerAddress, ref this.selectedCustomerAddress, value);}
}
Property in Breeze CLR type:
public string AddressLine1
{
get { return this.GetValue<string>(); }
set { this.SetValue(value); }
}
After typing only few characters in entry field, application would crash with stack trace:
11-10 11:51:02.896 F/ ( 4924): * Assertion at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.18-series/3b7ef0a7/source/mono/mono/metadata/sgen-stw.c:68, condition `info->stack_start >= info->stack_start_limit && info->stack_start < info->stack_end' not met
11-10 11:51:02.900 E/mono-rt ( 4924): Stacktrace:
11-10 11:51:02.900 E/mono-rt ( 4924):
11-10 11:51:02.904 E/mono-rt ( 4924): at <unknown> <0xffffffff>
11-10 11:51:02.908 E/mono-rt ( 4924): at (wrapper managed-to-native) object.MemberwiseClone (object) <IL 0x0002d, 0xffffffff>
11-10 11:51:02.912 E/mono-rt ( 4924): at System.Delegate.Clone () <IL 0x00001, 0x00027>
11-10 11:51:02.916 E/mono-rt ( 4924): at System.MulticastDelegate.CombineImpl (System.Delegate) <IL 0x000be, 0x0037c>
11-10 11:51:02.916 E/mono-rt ( 4924): at System.Delegate.Combine (System.Delegate,System.Delegate) <IL 0x00062, 0x001f8>
11-10 11:51:02.920 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect.add_EntityPropertyChanged (System.ComponentModel.PropertyChangedEventHandler) <IL 0x0000b, 0x00057>
11-10 11:51:02.924 E/mono-rt ( 4924): at Breeze.Sharp.BaseEntity.System.ComponentModel.INotifyPropertyChanged.add_PropertyChanged (System.ComponentModel.PropertyChangedEventHandler) [0x00000] in c:\GitHub\breeze.sharp\Breeze.Sharp\BaseEntity.cs:74
11-10 11:51:02.928 E/mono-rt ( 4924): at Xamarin.Forms.BindingExpression.ApplyCore (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty,bool) <IL 0x00130, 0x0077f>
11-10 11:51:02.928 E/mono-rt ( 4924): at Xamarin.Forms.BindingExpression.Apply (bool) <IL 0x00041, 0x000f3>
11-10 11:51:02.932 E/mono-rt ( 4924): at Xamarin.Forms.BindingExpression/BindingExpressionPart.<PropertyChanged>b__12 () <IL 0x00007, 0x0002f>
11-10 11:51:02.932 E/mono-rt ( 4924): at Java.Lang.Thread/RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.18-series/3b7ef0a7/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36
11-10 11:51:02.932 E/mono-rt ( 4924): at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) [0x00009] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.18-series/3b7ef0a7/source/monodroid/src/Mono.Android/platforms/android-18/src/generated/Java.Lang.IRunnable.cs:71
11-10 11:51:02.932 E/mono-rt ( 4924): at (wrapper dynamic-method) object.39beb2b5-65b4-431f-a21a-3e626049fa1f (intptr,intptr) <IL 0x00011, 0x0001b>
11-10 11:51:02.932 E/mono-rt ( 4924): at (wrapper native-to-managed) object.39beb2b5-65b4-431f-a21a-3e626049fa1f (intptr,intptr) <IL 0x00022, 0xffffffff>
11-10 11:51:02.936 E/mono-rt ( 4924): at <unknown> <0xffffffff>
11-10 11:51:02.936 E/mono-rt ( 4924): at (wrapper managed-to-native) object.wrapper_native_0xb60a0eb0 (intptr,intptr,intptr,Android.Runtime.JValue[]) <IL 0x00120, 0xffffffff>
11-10 11:51:02.936 E/mono-rt ( 4924): at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00040] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.18-series/3b7ef0a7/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:504
11-10 11:51:02.940 E/mono-rt ( 4924): at Android.App.Activity.RunOnUiThread (Java.Lang.IRunnable) [0x0002d] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.18-series/3b7ef0a7/source/monodroid/src/Mono.Android/platforms/android-18/src/generated/Android.App.Activity.cs:4130
11-10 11:51:02.940 E/mono-rt ( 4924): at Android.App.Activity.RunOnUiThread (System.Action) [0x00000] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.18-series/3b7ef0a7/source/monodroid/src/Mono.Android/src/Android.App/Activity.cs:23
11-10 11:51:02.940 E/mono-rt ( 4924): at Xamarin.Forms.Forms/AndroidPlatformServices.BeginInvokeOnMainThread (System.Action) <IL 0x0000b, 0x00053>
11-10 11:51:02.940 E/mono-rt ( 4924): at Xamarin.Forms.Device.BeginInvokeOnMainThread (System.Action) <IL 0x00006, 0x00038>
11-10 11:51:02.940 E/mono-rt ( 4924): at Xamarin.Forms.BindingExpression/BindingExpressionPart.PropertyChanged (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x00087, 0x00313>
11-10 11:51:02.944 E/mono-rt ( 4924): at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x00027, 0x00042>
11-10 11:51:02.944 E/mono-rt ( 4924): at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x00027, 0x00042>
11-10 11:51:02.944 E/mono-rt ( 4924): at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x00027, 0x00042>
..... (2500 lines)
11-10 11:51:03.564 E/mono-rt ( 4924): at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x00059, 0xffffffff>
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect.OnPropertyChangedCore (System.ComponentModel.PropertyChangedEventArgs) [0x0000b] in c:\GitHub\breeze.sharp\Breeze.Sharp\EntityAspect.cs:1315
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect/<>c__DisplayClass4b.<OnPropertyChanged>b__4a () [0x00000] in c:\GitHub\breeze.sharp\Breeze.Sharp\EntityAspect.cs:1306
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect.QueueEvent (System.Action) [0x0003e] in c:\GitHub\breeze.sharp\Breeze.Sharp\EntityAspect.cs:1362
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect.OnPropertyChanged (System.ComponentModel.PropertyChangedEventArgs) [0x0003f] in c:\GitHub\breeze.sharp\Breeze.Sharp\EntityAspect.cs:1305
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect.SetValueWithEvents<T> (T,object,System.Action`3<T, object, object>) [0x00042] in c:\GitHub\breeze.sharp\Breeze.Sharp\EntityAspect.cs:563
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect.SetDpValue (Breeze.Sharp.DataProperty,object) [0x00000] in c:\GitHub\breeze.sharp\Breeze.Sharp\EntityAspect.cs:529
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect.SetValue (Breeze.Sharp.StructuralProperty,object) [0x00052] in c:\GitHub\breeze.sharp\Breeze.Sharp\EntityAspect.cs:522
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.EntityAspect.SetValue (string,object) [0x00031] in c:\GitHub\breeze.sharp\Breeze.Sharp\EntityAspect.cs:507
11-10 11:51:03.564 E/mono-rt ( 4924): at Breeze.Sharp.BaseEntity.SetValue (object,string) [0x00000] in c:\GitHub\breeze.sharp\Breeze.Sharp\BaseEntity.cs:37
11-10 11:51:03.564 E/mono-rt ( 4924): at Client.Common.Model.Proxy.CustomerAddress.set_AddressLine2 (string) [0x00001] in c:\Projects\Client\source\Client.Common\Model\Proxy\CustomerAddress.cs:26
11-10 11:51:03.564 E/mono-rt ( 4924): at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>
11-10 11:51:03.564 E/mono-rt ( 4924): at <unknown> <0xffffffff>
11-10 11:51:03.564 E/mono-rt ( 4924): at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <IL 0x00030, 0xffffffff>
11-10 11:51:03.564 E/mono-rt ( 4924): at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <IL 0x0004a, 0x0016f>
11-10 11:51:03.564 E/mono-rt ( 4924): at System.Reflection.MethodBase.Invoke (object,object[]) <IL 0x00006, 0x0004b>
11-10 11:51:03.564 E/mono-rt ( 4924): at Xamarin.Forms.BindingExpression.ApplyCore (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty,bool) <IL 0x002f4, 0x00fd3>
11-10 11:51:03.564 E/mono-rt ( 4924): at Xamarin.Forms.BindingExpression.Apply (bool) <IL 0x00041, 0x000f3>
11-10 11:51:03.564 E/mono-rt ( 4924): at Xamarin.Forms.Binding.Apply (bool) <IL 0x00027, 0x000db>
11-10 11:51:03.564 E/mono-rt ( 4924): at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,object,bool,bool,bool) <IL 0x00090, 0x00295>
11-10 11:51:03.564 E/mono-rt ( 4924): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,bool,bool,bool) <IL 0x00213, 0x007b7>
11-10 11:51:03.564 E/mono-rt ( 4924): at Xamarin.Forms.Platform.Android.EntryRenderer.Android.Text.ITextWatcher.OnTextChanged (Java.Lang.ICharSequence,int,int,int) <IL 0x00014, 0x00087>
11-10 11:51:03.564 E/mono-rt ( 4924): at Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III (intptr,intptr,intptr,int,int,int) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.18-series/3b7ef0a7/source/monodroid/src/Mono.Android/platforms/android-18/src/generated/Android.Text.ITextWatcher.cs:149
11-10 11:51:03.564 E/mono-rt ( 4924): at (wrapper dynamic-method) object.369fe85e-8bc0-4aec-88da-b1540ec93f9c (intptr,intptr,intptr,int,int,int) <IL 0x00029, 0x0003f>
11-10 11:51:03.564 E/mono-rt ( 4924): at (wrapper native-to-managed) object.369fe85e-8bc0-4aec-88da-b1540ec93f9c (intptr,intptr,intptr,int,int,int) <IL 0x00028, 0xffffffff>
11-10 11:51:03.564 E/mono-rt ( 4924):
11-10 11:51:03.564 E/mono-rt ( 4924): =================================================================
11-10 11:51:03.564 E/mono-rt ( 4924): Got a SIGSEGV while executing native code. This usually indicates
11-10 11:51:03.564 E/mono-rt ( 4924): a fatal error in the mono runtime or one of the native libraries
11-10 11:51:03.564 E/mono-rt ( 4924): used by your application.
11-10 11:51:03.564 E/mono-rt ( 4924): =================================================================
11-10 11:51:03.564 E/mono-rt ( 4924):
11-10 11:51:03.564 F/libc ( 4924): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 4924 (r.nimbus.mobile)
The program 'Mono' has exited with code 0 (0x0).
As it appears to me to much events are fired which causes event stack to overflow.
Entry is working fine when bound to non Breeze property. It is also working fine when bound to detached entity.
After digging into Breeze EntityAspect.cs code I found out that all comes to this function:
internal void OnPropertyChanged(PropertyChangedEventArgs pcArgs)
{
if (this.IsDetached || !this.EntityGroup.ChangeNotificationEnabled)
return;
pcArgs = pcArgs ?? EntityAspect.AllPropertiesChangedEventArgs;
this.QueueEvent((Action) (() =>
{
this.OnPropertyChangedCore(pcArgs);
this.OnEntityChangedCore(EntityAction.PropertyChange, (EventArgs) pcArgs);
}));
}
So I disabled raising events in Breeze using:
this.EntityManager.ChangeNotificationEnabled = false;
It appears that this solves our issue with entry binding, but we are not sure if this opens door for other issues.
What are consequences of this approach?
Are these EntityPropertyChanged and PropertyChanged events used by Breeze code or intended only for our code to attach on them?
Or do you see some other approach for this issue?
UPDATE:
Consequences are: if we have more that one element on UI bound to the same property and if we update that property on one place, change is not visible on other places.
Example: Select element from ListView and bound selected element to some entry fields (outside the ListView). When we update element through that entry fields, change is not visible on ListView (as ListView isn't notified).
With Breeze PropertyChanged mechanism enabled (EntityPropertyChanged and ForceEntityPropertyChanged) this would work out of the box, but as I mentioned above there is problem with the application crash.
We ended up implementing OnPropertyChanged and RaisePropertyChanged methods in our base entity (the one that inherits from Breeze BaseEntity). This technique is similar to MVVMLight implementation of ObservableObject.
This code works fine (without application crash):
public bool IsImportant
{
get { return this.GetValue<bool>(); }
set
{
this.SetValue(value);
this.OnPropertyChanged();
}
}
Also we are able to call RaisePropertyChanged whenever it is needed:
this.SelectedNote.RaisePropertyChanged("IsImportant");

I'm guessing there's a way to modify the binding to fire only after the user has finished editing the text, instead of every character change. Would that be sufficient for what you're trying to accomplish with your application? In WPF/Silverlight XAML there exists a property called UpdateSourceTrigger on the binding which you can set to dictate at which point changes are pushed. I'm in the process of contacting Xamarin to find out if they have an equivalent property.

Didn't test, but you can disable property notification on the EntityManager, so you can toggle this property on demand.

Related

gform_after_submission does not fire after form is submitted

I have tested my custom function, which works correctly on it's own when the form id and entry id are provided. But it never seems to fire when a form is submitted.
I am using the action add_action( 'gform_after_submission_14', 'after_submission', 10, 2 );
My form id is 14.
How can I troubleshoot this or correct the issue?
My code is:
add_action( 'gform_after_submission_14', 'after_submission', 10, 2 );
function after_submission($entry, $form){
global $wpdb;
include $_SERVER['DOCUMENT_ROOT'] . '/custom_config.php';
$data = RGFormsModel::get_lead($entry);
$eid = $data['id'];
$user_id = $data['created_by'];
$hotel = $data['33'];
$flight = $data['39'];
$car = $data['38'];
$parking = $data['37'];
$entertainment = $data['36'];
$other = $data['35'];
if($hotel!=''):
mysqli_query($link,"INSERT INTO reimbursements ( user_id, eid, amount, type ) VALUES ( '$user_id', '$eid', '$hotel', 'hotel' )");
print_r($link);
endif;
if($flight!=''):
mysqli_query($link,"INSERT INTO reimbursements ( user_id, eid, amount, type ) VALUES ( '$user_id', '$eid', '$flight', 'flight' )");
endif;
if($car!=''):
mysqli_query($link,"INSERT INTO reimbursements ( user_id, eid, amount, type ) VALUES ( '$user_id', '$eid', '$car', 'car' )");
endif;
if($parking!=''):
mysqli_query($link,"INSERT INTO reimbursements ( user_id, eid, amount, type ) VALUES ( '$user_id', '$eid', '$parking', 'parking' )");
endif;
if($entertainment!=''):
mysqli_query($link,"INSERT INTO reimbursements ( user_id, eid, amount, type ) VALUES ( '$user_id', '$eid', '$entertainment', 'entertainment' )");
endif;
if($other!=''):
mysqli_query($link,"INSERT INTO reimbursements ( user_id, eid, amount, type ) VALUES ( '$user_id', '$eid', '$other', 'other' )");
endif;
mysqli_close($link);
}
The problem was here:
$data = RGFormsModel::get_lead($entry);
$entry is already an array that is in use.
So rather than define them again as I did:
$eid = $data['id'];
I should have used:
$eid = $entry['id'];
The bigger part of this solution was figuring out the ability to troubleshoot it.
For that, I did the following:
Add GFCommon::log_debug( __METHOD__ . '(): running.' ); to the top of the function.
Enable logging as explained here (https://docs.gravityforms.com/logging-and-debugging/#enabling-logging)
View the error log of 'Gravity Forms Core' at 'Forms->Settings->Logging' This requires that 'logging' is check marked at the time the test is run.

getting error :Fatal error: Uncaught Error: Call to a member function get_queried_object() on null in wordpress

i have hosted my wordpress site to godaddy, i have configured all the things when i open my site, i am getting this error Fatal error: Uncaught Error: Call to a member function get_queried_object() on null in wp-includes/query.php on line 46 , i checked the query.php file, there is inbuilt function
function get_query_var( $var, $default = '' ) {
global $wp_query;
return $wp_query->get( $var, $default );
}
can anyone please help me how to resolve this issue ?

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

Woocommerce issue

so due to a business change I have un-installed the woo commerce plugin and than re-installed it.
now on the all the products I create it throws me this error( becaus it is public on the webpage no matter what I do)
Warning: sprintf(): Too few arguments in /home/xxxx/public_html/wp/wp-includes/functions.php on line 3829
Notice: in /home/xxxxxx/public_html/wp/wp-includes/functions.php on line 3829
Notice: ID was called incorrectly. Product properties should not be accessed directly. Please see Debugging in WordPress for more information. (This message was added in version 3.0.) in /home/xxxx/public_html/wp/wp-includes/functions.php on line 4137
the code at line 3289
* Filters whether to trigger an error for deprecated functions.
*
* #since 2.5.0
*
* #param bool $trigger Whether to trigger the error for deprecated
functions. Default true.
*/
if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
if ( ! is_null( $replacement ) ) {
/* translators: 1: PHP function name, 2: version number, 3: alternative function name */
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
} else {
/* translators: 1: PHP function name, 2: version number */
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
}
} else {
if ( ! is_null( $replacement ) ) {
trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $function, $version, $replacement ) );
} else {
trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ) );
}
and than at page 4137
#param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true.
*/
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
if ( is_null( $version ) ) {
$version = '';
} else {
/* translators: %s: version number */
$version = sprintf( __( '(This message was added in version %s.)' ), $version );
}
/* translators: %s: Codex URL */
$message .= ' ' . sprintf( __( 'Please see Debugging in WordPress for more information.' ),
__( 'https://codex.wordpress.org/Debugging_in_WordPress' )
);
/* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: Version information message */
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
} else {
if ( is_null( $version ) ) {
$version = '';
} else {
$version = sprintf( '(This message was added in version %s.)', $version );
}
$message .= sprintf( ' Please see Debugging in WordPress for more information.',
'https://codex.wordpress.org/Debugging_in_WordPress'
);
trigger_error( sprintf( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s', $function, $message, $version ) );
}
could somebody hint a possible resolution?

Gstreamer 1.0 strange pipeline behavior

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

Resources