-
-
Notifications
You must be signed in to change notification settings - Fork 763
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
i can't streaming #1500
Comments
Hello, You can't stream because you are not rendering correctly the surface provided by VideoSource class (USBCameraSource). You are rendering the surface of the TextureView so you only have a preview and the stream never receive video data. You should render the surface provided inside USBCameraSource on the start method. You can try follow this post (you can use the last library version for it): |
package com.seoul.fire.usb.activity import android.content.Context class USBCameraSource(
} is this problam?? |
Yes, that class is not correct and for the same reason part of the code in USBActivity is wrong too. |
thank you for answer!!!! so i configured to my code import android.content.Context class USBCameraSource(
} this but it is error |
Hello, That error is related with the usb camera library. The library is not compiling correctly. The c++ Code of the library is missed |
i can't streaming rtsp
this is my code
package com.seoul.fire.usb.activity;
import com.jiangdg.ausbc.camera.CameraUvcStrategy;
import com.jiangdg.ausbc.camera.bean.CameraRequest;
import com.pedro.rtspserver.server.ClientListener;
import com.pedro.rtspserver.server.ServerClient;
import com.seoul.fire.rtsp.ExampleRtspActivity;
import com.seoul.fire.usb.activity.StreamingController;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.graphics.SurfaceTexture;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.os.Bundle;
import android.os.SystemClock;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SurfaceHolder;
import android.view.TextureView;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import com.google.gson.Gson;
import com.herohan.uvcapp.CameraHelper;
import com.herohan.uvcapp.ICameraHelper;
import com.herohan.uvcapp.ImageCapture;
import com.herohan.uvcapp.VideoCapture;
import com.hjq.permissions.XXPermissions;
import com.jiangdg.ausbc.CameraClient;
import com.pedro.common.ConnectChecker;
import com.pedro.encoder.input.video.CameraOpenException;
import com.pedro.encoder.utils.gl.AspectRatioMode;
import com.pedro.library.rtsp.RtspStream;
import com.pedro.library.util.sources.audio.MicrophoneSource;
import com.pedro.library.view.OrientationForced;
import com.seoul.fire.MyFusedLocationProvider;
import com.seoul.fire.R;
import com.seoul.fire.databinding.ActivityUsbBinding;
import com.seoul.fire.usb.fragment.CameraControlsDialogFragment;
import com.seoul.fire.usb.fragment.DeviceListDialogFragment;
import com.seoul.fire.usb.fragment.VideoFormatDialogFragment;
import com.seoul.fire.usb.utils.SaveHelper;
import com.serenegiant.opengl.renderer.MirrorMode;
import com.serenegiant.usb.IButtonCallback;
import com.serenegiant.usb.Size;
import com.serenegiant.usb.USBMonitor;
import com.serenegiant.utils.UriHelper;
import java.io.File;
import java.text.DecimalFormat;
import java.util.Timer;
import java.util.TimerTask;
public class USBActivity extends AppCompatActivity implements ClientListener, ConnectChecker {
// rtspStream.startPreview();
// 이 위치에서 CameraHelper 초기화를 먼저 수행
button = findViewById(R.id.usb_start_stop);
lockScreenButton= findViewById(R.id.usb_lock_screen);
// button.setOnClickListener(this);
myFusedLocationProvider = new MyFusedLocationProvider(this);
// rtspStream = new RtspStream(
// (Context) this,
// (ConnectChecker) this,
// new USBCameraSource(this,mCameraHelper),
// new MicrophoneSource()
//
// );
// rtspStream.getStreamClient().setReTries(10);
}
// startPreview( mBinding.viewMainPreview);
// mCameraHelper.setImageCaptureConfig(
// mCameraHelper.getImageCaptureConfig().setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY));
mCameraHelper.setImageCaptureConfig(
mCameraHelper.getImageCaptureConfig().setJpegCompressionQuality(90));
}
// .setAudioCaptureEnable(false)
.setBitRate((int) (1024 * 1024 * 25 * 0.25))
.setVideoFrameRate(25)
.setIFrameInterval(1));
}
}
and the log repeatly can you help me??
024-06-13 16:59:53.359 27273-27434 RtspClient com.seoul.fire I waiting for sps and pps
2024-06-13 16:59:58.354 27273-27441 RtspClient com.seoul.fire I write teardown success
2024-06-13 16:59:58.355 27273-27441 RtspClient com.seoul.fire E connection error
kotlinx.coroutines.JobCancellationException: StandaloneCoroutine was cancelled; job=StandaloneCoroutine{Cancelling}@eb32c3a
2024-06-13 16:59:58.365 27273-27391 RtspClient com.seoul.fire I write teardown success
2024-06-13 16:59:58.365 27273-27442 RtspClient com.seoul.fire E connection error
kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelling}@4a81e48
The text was updated successfully, but these errors were encountered: