
Recherche avancée
Autres articles (49)
-
Les thèmes de MediaSpip
4 juin 20133 thèmes sont proposés à l’origine par MédiaSPIP. L’utilisateur MédiaSPIP peut rajouter des thèmes selon ses besoins.
Thèmes MediaSPIP
3 thèmes ont été développés au départ pour MediaSPIP : * SPIPeo : thème par défaut de MédiaSPIP. Il met en avant la présentation du site et les documents média les plus récents ( le type de tri peut être modifié - titre, popularité, date) . * Arscenic : il s’agit du thème utilisé sur le site officiel du projet, constitué notamment d’un bandeau rouge en début de page. La structure (...) -
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (4501)
-
Why storage access functions not working on android 10 API-29 ? error=13, Permission denied ?
8 janvier 2021, par Rpatel

This example code is to create video from images and music.
Code running on till API level 28 but when I just upgrade to
Build version 29 then it starts crashing. I tried the most solution
but could not find the proper reason and solution.

Please let me know...



2


021-01-08 19:48:16.045 18413-19578/com.example.photovideomaker E/audio: io
 java.io.IOException: Cannot run program "/data/user/0/com.example.photovideomaker/files/ffmpeg": error=13, Permission denied
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)
 at java.lang.Runtime.exec(Runtime.java:698)
 at java.lang.Runtime.exec(Runtime.java:563)
 at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252)
 at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89)
 at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83)
 at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)
 at android.os.Handler.dispatchMessage(Handler.java:107)
 at android.os.Looper.loop(Looper.java:214)
 at android.os.HandlerThread.run(HandlerThread.java:67)
 Caused by: java.io.IOException: error=13, Permission denied
 at java.lang.UNIXProcess.forkAndExec(Native Method)
 at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)
 at java.lang.ProcessImpl.start(ProcessImpl.java:141)
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
 at java.lang.Runtime.exec(Runtime.java:698) 
 at java.lang.Runtime.exec(Runtime.java:563) 
 at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252) 
 at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89) 
 at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83) 
 at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78) 
 at android.os.Handler.dispatchMessage(Handler.java:107) 
 at android.os.Looper.loop(Looper.java:214) 
 at android.os.HandlerThread.run(HandlerThread.java:67) 
</init>




This function throwing the error "On Process.runtime"




private void createVideo() {
 long startTime = System.currentTimeMillis();
 toatalSecond = (application.getSecond() * ((float) application.getSelectedImages().size())) - DEFAULT_FONT_SCALE;
 joinAudio();
 while (true) {
 if (ImageCreatorService.isImageComplate) {
 Log.e("image creation ", " complte");

 break;
 }else {
 Log.e("image creation ", "not complte");
 }
 }
 Log.e("createVideo", "video create start");
 new File(FileUtils.TEMP_DIRECTORY, "video.txt").delete();
 for (int i = 0; i < application.videoImages.size(); i++) {
 appendVideoLog(String.format("file '%s'", application.videoImages.get(i)));
 }

 File r0=new File(FileUtils.TEMP_DIRECTORY, "video.txt");
 String videoPath = new File(FileUtils.APP_DIRECTORY, getVideoName()).getAbsolutePath();
 String[] inputCode = application.getMusicData() != null ? new String[]{
 FileUtils.getFFmpeg(this), "-r",
 String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),
 "-f", "concat", "-safe", "0", "-i", r0.getAbsolutePath(), "-i",
 audioFile.getAbsolutePath(), "-strict", "experimental", "-r", "30",
 "-t", String.valueOf(toatalSecond), "-c:v", "libx264", "-preset",
 "ultrafast", "-pix_fmt", "yuv420p", "-ac", "2", videoPath}
 : new String[]{FileUtils.getFFmpeg(this),
 "-r", String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),
 "-f", "concat", "-i", r0.getAbsolutePath(), "-r", "30", "-c:v", "libx264", "-preset", "ultrafast", "-pix_fmt", "yuv420p", videoPath};

 System.gc();
 Process process = null;
 try {
 process = Runtime.getRuntime().exec(inputCode);
 while (!Util.isProcessCompleted(process)) {
 BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
 while (true) {
 String line = reader.readLine();
 if (line != null) {
 Log.e("process", line);
 appendLog(line);
 final int incr = durationToprogtess(line);
 new Handler(Looper.getMainLooper()).post(new Runnable() {
 public void run() {
 if (receiver != null) {
 receiver.onVideoProgressUpdate(incr);
 }
 }
 });
 mBuilder.setProgress(100, ((int) ((75.0f * ((float) incr)) / 100.0f)) + 25, false);
 mNotifyManager.notify(1001, mBuilder.build());
 }else {
 break;
 }
 }
 }
 } catch (IOException e) {
 e.printStackTrace();
 } finally {
 Util.destroyProcess(process);
 }
 mBuilder.setContentText("Video created :" + FileUtils.getDuration(System.currentTimeMillis() - startTime)).setProgress(0, 0, false);
 mNotifyManager.notify(1001, mBuilder.build());
 try {
 long fileSize = new File(videoPath).length();
 String artist = getResources().getString(R.string.artist_name);
 ContentValues values = new ContentValues();
 values.put("_data", videoPath);
 values.put("_size", Long.valueOf(fileSize));
 values.put("mime_type", "video/mp4");
 values.put("artist", artist);
 values.put("duration", Float.valueOf(toatalSecond * 1000.0f));
 getContentResolver().insert(Media.getContentUriForPath(videoPath), values);
 } catch (Exception e2) {
 e2.printStackTrace();
 }
 try {
 sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(new File(videoPath))));
 } catch (Exception e3) {
 e3.printStackTrace();
 }

 buildNotification(videoPath);
 final String str = videoPath;
 new Handler(Looper.getMainLooper()).post(new Runnable() {
 public void run() {
 if (receiver != null) {
 receiver.onVideoProgressUpdate(100);
 receiver.onProgressFinish(str);
 }
 }
 });
 FileUtils.deleteTempDir();
 stopSelf();
 }



I have tried checking the directory in storage and check mkdir is working or not but this function purely works for creating video from a collection of images, themes, and audio. as per android


-
Playing 120fps in browser between original and re-made video, original is normal speed, new video is slo-mo
1er mars 2023, par Patrick VelliaI used my GoPro Hero10 to record at 4k 120fps on a green screen. This original video plays slo-mo in QuickTime but "normal" speed in the browser. I want it playing normal speed, and if end user wants to slow it down they have the extra frames for that to maintain clarity, which is why I record at 120.


I then used FFMPEG to create an image sequence of the video.


Then I ran Image Magic to create the transparent frames.


Then I put it back together with the following command for a HEVC mov file :


ffmpeg -r 120 -f image2 -i transparent/image_transparent_%08d.png -vcodec hevc_videotoolbox -crf 28 -alpha_quality 1 -tag:v hvc1 output.mov



I am still on an Intel MacBook Pro running FFMPEG 4.6 (as I've found 5+ was buggy with one of my commands a few months ago but can't remember which one, I think it was the videotoolbox).


The GoPro video has the following stream data as input to the FFMPEG :


Duration: 00:00:08.15, start: 0.000000, bitrate: 60160 kb/s
 Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 59891 kb/s, 119.88 fps, 119.88 tbr, 120k tbn, 119.88 tbc (default)
 Metadata:
 creation_time : 2023-02-28T19:06:41.000000Z
 handler_name : GoPro H.265
 vendor_id : [0][0][0][0]
 encoder : GoPro H.265 encoder
 timecode : 19:05:32:105
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
 Metadata:
 creation_time : 2023-02-28T19:06:41.000000Z
 handler_name : GoPro AAC 
 vendor_id : [0][0][0][0]
 timecode : 19:05:32:105
 Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
 Metadata:
 creation_time : 2023-02-28T19:06:41.000000Z
 handler_name : GoPro TCD 
 timecode : 19:05:32:105
 Stream #0:3(eng): Data: bin_data (gpmd / 0x646D7067), 76 kb/s (default)
 Metadata:
 creation_time : 2023-02-28T19:06:41.000000Z
 handler_name : GoPro MET 



Whereas the re-constructed video has the following data :


Duration: 00:00:08.13, start: 0.000000, bitrate: 763650 kb/s
 Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 763696 kb/s, 120 fps, 120 tbr, 15360 tbn, 15360 tbc (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 encoder : Lavc58.134.100 hevc_videotoolbo



When this re-constructed video plays in the browser, it is in slow-mo and I need to set the playbackRate to 4.0 for it to play "normally".


Is there something I need to add to the video for the browser to play it at "normal" speed ?


-
how to get 120fps encoded video to play at "normal" speed instead of slow mo
1er mars 2023, par Patrick VelliaI used my GoPro Hero10 to record at 4k 120fps on a green screen. This original video plays slo-mo in QuickTime but "normal" speed in the browser. I want it playing normal speed, and if end user wants to slow it down they have the extra frames for that to maintain clarity, which is why I record at 120.


I then used FFMPEG to create an image sequence of the video.


Then I ran Image Magic to create the transparent frames.


Then I put it back together with the following command for a HEVC mov file :


ffmpeg -r 120 -f image2 -i transparent/image_transparent_%08d.png -vcodec hevc_videotoolbox -crf 28 -alpha_quality 1 -tag:v hvc1 output.mov



I am still on an Intel MacBook Pro running FFMPEG 4.6 (as I've found 5+ was buggy with one of my commands a few months ago but can't remember which one, I think it was the videotoolbox).


The GoPro video has the following stream data as input to the FFMPEG :


Duration: 00:00:08.15, start: 0.000000, bitrate: 60160 kb/s
 Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 59891 kb/s, 119.88 fps, 119.88 tbr, 120k tbn, 119.88 tbc (default)
 Metadata:
 creation_time : 2023-02-28T19:06:41.000000Z
 handler_name : GoPro H.265
 vendor_id : [0][0][0][0]
 encoder : GoPro H.265 encoder
 timecode : 19:05:32:105
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
 Metadata:
 creation_time : 2023-02-28T19:06:41.000000Z
 handler_name : GoPro AAC 
 vendor_id : [0][0][0][0]
 timecode : 19:05:32:105
 Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
 Metadata:
 creation_time : 2023-02-28T19:06:41.000000Z
 handler_name : GoPro TCD 
 timecode : 19:05:32:105
 Stream #0:3(eng): Data: bin_data (gpmd / 0x646D7067), 76 kb/s (default)
 Metadata:
 creation_time : 2023-02-28T19:06:41.000000Z
 handler_name : GoPro MET 



Whereas the re-constructed video has the following data :


Duration: 00:00:08.13, start: 0.000000, bitrate: 763650 kb/s
 Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 763696 kb/s, 120 fps, 120 tbr, 15360 tbn, 15360 tbc (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 encoder : Lavc58.134.100 hevc_videotoolbo



When this re-constructed video plays in the browser, it is in slow-mo and I need to set the playbackRate to 4.0 for it to play "normally".


Is there something I need to add to the video for the browser to play it at "normal" speed ?


EDIT


I just compared the two video streams :


original:
Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 59891 kb/s, 119.88 fps, 119.88 tbr, 120k tbn, 119.88 tbc (default)

Reconstructed:
 Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 763696 kb/s, 120 fps, 120 tbr, 15360 tbn, 15360 tbc (default)



I don't quit understand all of this though. so here's what I notice :


original. reconstructed
--------------------------------
bt709 progressive
89871 kb/s. 763696 kb/s
119.88 fps. 120 fps
119.88 tbr. 120 tbr
120k tbr. 15360 tbr
11960 tbr. 15360 tbc



Hmm. I suspect it has something to do with tbr and tbc whatever those are, or perhaps the progressive vs the bt709 ? the pirates are also vastly different.