
Recherche avancée
Autres articles (46)
-
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...)
Sur d’autres sites (4778)
-
ffmpeg trim video works on emulator but fails on arm (real device)
21 octobre 2017, par fthopkinsI’m trimming the videos with
ffmpeg
that is bigger than 10 seconds. On myJNI
edit
function i usecommands
to trim video. I try to debug but as you all know debugging onJNI
function is not like native androidJAVA
function. Maybe it is.. but not for my knowledge. Also i used coffecatch library to catch exception but didn’t succeeded. I did go for error step by step and reached the this line offfmpeg
main
function.EDIT
current_time = ti = getutime(); // edited : lastly can print message on here.
if (transcode() < 0) // transcode() < 0 => true and run exit_program(1).
exit_program(1);
ti = getutime() - ti;On emulator everything is working good and fast. But on real device it gives some kind of error but i couldn’t catch it. When i check the
Android Monitor
ofAndroid Studio
my JNIedit
function’s logs appear but disappear in a second. It is weird. Also when i check the output path on device, ffmpeg gives an trimmed video output (but very slow). So it is working on background and gives a trimmed video. It is very weird too because app crashes whilemain
method is working. I need help to figure it out. I stucked.My video edit JNI function
JNIEXPORT jint JNICALL
Java_com_farukest_app_library_AppVideoEditer_natives_VideoEditer_edit
(JNIEnv *env,jclass someclass, jstring inputFile, jstring outFile, jint
startTime,jint endTime, jstring fileSize, jboolean mustCompress) {
log_message("Starting to cut");
int numberOfArgs = 19;
char** $commands = calloc(numberOfArgs, sizeof(char*));
char start[5], end[5];
const char *in, *out, *fileSz;
itoa(startTime, start);
itoa(endTime, end);
in = (*env)->GetStringUTFChars(env, inputFile, 0);
out = (*env)->GetStringUTFChars(env, outFile, 0);
fileSz = (*env)->GetStringUTFChars(env, fileSize, 0);
$commands[0] = "ffmpeg";
$commands[1] = "-ss";
$commands[2] = start;
$commands[3] = "-y";
$commands[4] = "-i";
$commands[5] = in;
$commands[6] = "-t";
$commands[7] = end;
$commands[8] = "-vcodec";
$commands[9] = "mpeg4";
$commands[10] = "-b:v";
if(mustCompress){
$commands[11] = "3072000"; // 3mb
}else{
$commands[11] = fileSz;
}
$commands[12] = "-b:a";
$commands[13] = "48000";
$commands[14] = "-ac";
$commands[15] = "2";
$commands[16] = "-ar";
$commands[17] = "22050";
$commands[18] = out;
int i;
for (i = 0; i < numberOfArgs; i++) {
log_message($commands[i]);
}
log_message("Printed all"); // lastly prints on here
main(numberOfArgs, $commands); // stuck on here
log_message("Finished cutting"); // not reach here
free($commands);
(*env)->ReleaseStringUTFChars(env, inputFile, in);
(*env)->ReleaseStringUTFChars(env, outFile, out);
return 0;
}FFMPEG main function
int main(int argc, char **argv)
{
int i, ret;
int64_t ti;
init_dynload();
register_exit(ffmpeg_cleanup);
setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */
av_log_set_flags(AV_LOG_SKIP_REPEATED);
parse_loglevel(argc, argv, options);
if(argc>1 && !strcmp(argv[1], "-d")){
run_as_daemon=1;
av_log_set_callback(log_callback_null);
argc--;
argv++;
}
avcodec_register_all();
# if CONFIG_AVDEVICE
avdevice_register_all();
#endif
avfilter_register_all();
av_register_all();
avformat_network_init();
show_banner(argc, argv, options);
/* parse options and open all input/output files */
ret = ffmpeg_parse_options(argc, argv);
if (ret < 0)
exit_program(1);
if (nb_output_files <= 0 && nb_input_files == 0) {
show_usage();
av_log(NULL, AV_LOG_WARNING, "Use -h to get full help or, even better, run 'man %s'\n", program_name);
exit_program(1);
}
/* file converter / grab */
if (nb_output_files <= 0) {
av_log(NULL, AV_LOG_FATAL, "At least one output file must be specified\n");
exit_program(1);
}
// if (nb_input_files == 0) {
// av_log(NULL, AV_LOG_FATAL, "At least one input file must be specified\n");
// exit_program(1);
// }
for (i = 0; i < nb_output_files; i++) {
if (strcmp(output_files[i]->ctx->oformat->name, "rtp"))
want_sdp = 0;
}
current_time = ti = getutime();
if (transcode() < 0)
exit_program(1);
ti = getutime() - ti;
if (do_benchmark) {
av_log(NULL, AV_LOG_INFO, "bench: utime=%0.3fs\n", ti / 1000000.0);
}
av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" frames successfully decoded, %"PRIu64" decoding errors\n",
decode_error_stat[0], decode_error_stat[1]);
if ((decode_error_stat[0] + decode_error_stat[1]) * max_error_rate < decode_error_stat[1])
exit_program(69);
exit_program(received_nb_signals ? 255 : main_return_code);
return main_return_code;
}EDIT
I debugged and found which line exiting me from the app. It is
transcode() < 0
line But couldn’t find why ? Is there anyone to help me. I really need help. Can discuss and share more code. -
FFmpeg Executing command error
7 avril 2016, par Sanket990When I conversion mp4 to mp3 using ffmpeg command
FFmpeg command Execution error- Working directory null IOEXception
Executing below code.File path=Environment.getExternalStorageDirectory();
try {
String ffmpegCommand="ffmpeg -i "+path.getAbsolutePath()+"/test/1.mp4 -f avi -acodec mp3 "+path.getAbsolutePath()+"/Songss.avi";
Process ffmpegProcess = new ProcessBuilder(ffmpegCommand).redirectErrorStream(true).start();
String line;
BufferedReader reader = new BufferedReader(new InputStreamReader(ffmpegProcess.getInputStream()));
Log.d("tag", "*******Starting FFMPEG");
while((line = reader.readLine())!=null){
Log.d("tag", "***"+line+"***");
}
Log.d("tag","****ending FFMPEG****");
} catch (IOException e) {
e.printStackTrace(); }LogCat
java.io.IOException: Error running exec(). Command: [/data/data/com.example.ffmpegcommandexecute/ffmpeg -i /mnt/sdcard/Songs.mp4 -vn -s 00:00:10 -acodec libmp3lame output.mp3]
Working Directory: null Environment: [ANDROID_SOCKET_zygote=10, ANDROID_BOOTLOGO=1, EXTERNAL_STORAGE=/mnt/sdcard, ANDROID_ASSETS=/system/app, PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin, ASEC_MOUNTPOINT=/mnt/asec, LOOP_MOUNTPOINT=/mnt/obb, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar, EXTERNAL_STORAGE_SD=/mnt/ext_card, EXTERNAL_STORAGE_ALL=/mnt/sdcard:/mnt/ext_card, WTLE_VERSION=3.2.0.patch6.1, ANDROID_DATA=/data, LD_LIBRARY_PATH=/vendor/lib:/system/lib, ANDROID_ROOT=/system, ANDROID_PROPERTY_WORKSPACE=9,65536]
at java.lang.ProcessManager.exec(ProcessManager.java:211)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:195)
at com.example.ffmpegcommandexecute.MJPEGFFMPEGTest$ProcessVideo.doInBackground(MJPEGFFMPEGTest.java:301)
at com.example.ffmpegcommandexecute.MJPEGFFMPEGTest$ProcessVideo.doInBackground(MJPEGFFMPEGTest.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:264)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.io.IOException: No such file or directory
at java.lang.ProcessManager.exec(Native Method)
at java.lang.ProcessManager.exec(ProcessManager.java:209) -
Can open RTSP camera stream in FFMPEG but not in Gstreamer rtspsrc : Bad Request (400)
6 août 2022, par Joran ApixaI have a Panasonic WV-SW559 camera set up as an RTSP stream.


VLC can perfectly open the RTSP stream and display it, as well as FFMPEG.
However, when I try to set up a simple gstreamer pipeline, it does not want to open.
I execute the following command :


gst-launch-1.0 rtspsrc --gst-debug=rtspsrc:5 location="rtspt://admin:12345@192.168.2.148:554/MediaInput/h264/stream_1" ! fakesink



after which I get the following output :


0:00:00.063009504 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:8617:gst_rtspsrc_uri_set_uri:<rtspsrc0> parsing URI
0:00:00.063074922 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:8624:gst_rtspsrc_uri_set_uri:<rtspsrc0> configuring URI
0:00:00.063111485 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:8640:gst_rtspsrc_uri_set_uri:<rtspsrc0> set uri: rtspt://admin:12345@192.168.2.148:554/MediaInput/h264/stream_1
0:00:00.063136642 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:8642:gst_rtspsrc_uri_set_uri:<rtspsrc0> request uri is: rtsp://192.168.2.148:554/MediaInput/h264/stream_1
Setting pipeline to PAUSED ...
0:00:00.064752828 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:8391:gst_rtspsrc_start:<rtspsrc0> starting
0:00:00.064910956 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd OPEN
0:00:00.064938405 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:5598:gst_rtspsrc_loop_send_cmd:<rtspsrc0> not interrupting busy cmd unknown
Pipeline is live and does not need PREROLL ...
0:00:00.065145962 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:8346:gst_rtspsrc_thread:<rtspsrc0> got command OPEN
0:00:00.065182682 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
0:00:00.065214662 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4614:gst_rtsp_conninfo_connect:<rtspsrc0> creating connection (rtspt://admin:12345@192.168.2.148:554/MediaInput/h264/stream_1)...
Progress: (open) Opening Stream
0:00:00.065652329 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4625:gst_rtsp_conninfo_connect:<rtspsrc0> sanitized uri rtsp://192.168.2.148:554/MediaInput/h264/stream_1
0:00:00.065710611 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4659:gst_rtsp_conninfo_connect:<rtspsrc0> connecting (rtspt://admin:12345@192.168.2.148:554/MediaInput/h264/stream_1)...
Progress: (connect) Connecting to rtspt://admin:12345@192.168.2.148:554/MediaInput/h264/stream_1
0:00:00.081446411 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:7342:gst_rtspsrc_retrieve_sdp:<rtspsrc0> create options... (async)
0:00:00.081494537 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:7351:gst_rtspsrc_retrieve_sdp:<rtspsrc0> send options...
0:00:00.081575581 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
Progress: (open) Retrieving server options
0:00:00.081618707 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
0:00:00.081671521 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:5964:gst_rtspsrc_try_send:<rtspsrc0> sending message
0:00:00.088226524 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:5866:gst_rtsp_src_receive_response:<rtspsrc0> received response message
0:00:00.088280901 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:5885:gst_rtsp_src_receive_response:<rtspsrc0> got response message 400
0:00:00.088321370 23339 0x55cd528a30 WARN rtspsrc gstrtspsrc.c:6161:gst_rtspsrc_send:<rtspsrc0> error: Unhandled error
0:00:00.088335798 23339 0x55cd528a30 WARN rtspsrc gstrtspsrc.c:6161:gst_rtspsrc_send:<rtspsrc0> error: Bad Request (400)
0:00:00.088454915 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:7514:gst_rtspsrc_retrieve_sdp:<rtspsrc0> free connection
0:00:00.088526323 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4715:gst_rtsp_conninfo_close:<rtspsrc0> closing connection...
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unhandled error
Additional debug info:
gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Bad Request (400)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
0:00:00.088648097 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4721:gst_rtsp_conninfo_close:<rtspsrc0> freeing connection...
Setting pipeline to READY ...
0:00:00.088699505 23339 0x55cd528a30 WARN rtspsrc gstrtspsrc.c:7548:gst_rtspsrc_open:<rtspsrc0> can't get sdp
0:00:00.088747891 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:8346:gst_rtspsrc_thread:<rtspsrc0> got command LOOP
0:00:00.088786121 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
0:00:00.088812372 23339 0x55cd528a30 WARN rtspsrc gstrtspsrc.c:5628:gst_rtspsrc_loop:<rtspsrc0> we are not connected
0:00:00.088832841 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:5636:gst_rtspsrc_loop:<rtspsrc0> pausing task, reason flushing
0:00:00.088855394 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd WAIT
0:00:00.088885863 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:5585:gst_rtspsrc_loop_send_cmd:<rtspsrc0> cancel previous request LOOP
0:00:00.088905135 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:5593:gst_rtspsrc_loop_send_cmd:<rtspsrc0> connection flush busy LOOP
0:00:00.088923000 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 1
0:00:00.088996595 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd CLOSE
0:00:00.089030346 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:5593:gst_rtspsrc_loop_send_cmd:<rtspsrc0> connection flush busy WAIT
0:00:00.089045971 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 1
0:00:00.089085660 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:8346:gst_rtspsrc_thread:<rtspsrc0> got command CLOSE
0:00:00.089109462 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
0:00:00.089129619 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:7569:gst_rtspsrc_close:<rtspsrc0> TEARDOWN...
Setting pipeline to NULL ...
0:00:00.089211288 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:7574:gst_rtspsrc_close:<rtspsrc0> not ready, doing cleanup
0:00:00.089263997 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:7637:gst_rtspsrc_close:<rtspsrc0> closing connection...
0:00:00.089300769 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:8422:gst_rtspsrc_stop:<rtspsrc0> stopping
0:00:00.089330926 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd WAIT
0:00:00.089333374 23339 0x55cd528a30 DEBUG rtspsrc gstrtspsrc.c:2058:gst_rtspsrc_cleanup:<rtspsrc0> cleanup
0:00:00.089354260 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:5593:gst_rtspsrc_loop_send_cmd:<rtspsrc0> connection flush busy CLOSE
0:00:00.089419939 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 1
0:00:00.089493430 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:7569:gst_rtspsrc_close:<rtspsrc0> TEARDOWN...
0:00:00.089520931 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:7574:gst_rtspsrc_close:<rtspsrc0> not ready, doing cleanup
0:00:00.089539212 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:7637:gst_rtspsrc_close:<rtspsrc0> closing connection...
0:00:00.089556192 23339 0x55cd6d9180 DEBUG rtspsrc gstrtspsrc.c:2058:gst_rtspsrc_cleanup:<rtspsrc0> cleanup
Freeing pipeline ...
</rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0></rtspsrc0>


Does anyone have an idea on why this could occur ?