
Recherche avancée
Autres articles (90)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (4303)
-
System.AccessViolationException on avcodec_open2 using FFMpeg.AutoGen
5 décembre 2024, par forlayoI am using FFMpeg.AutoGen (v6.0.0.2) with hwencode support for Nvidia cards, and in few devices (for example on NVIDIA GeForce MX350) when I am doing fffmpeg.avcodec_open2 I got the following ffmpeg message in logs :


[h264_nvenc @ 000001f473fcc480] OpenEncodeSessionEx failed: unsupported device (2): (no details)




And then it crashes with the following crash :


Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
 at FFmpeg.AutoGen.DynamicallyLoadedBindings+<>c.<initialize>b__2_494(FFmpeg.AutoGen.AVCodecContext*, FFmpeg.AutoGen.AVCodec*, FFmpeg.AutoGen.AVDictionary**)
 at FFmpeg.AutoGen.ffmpeg.avcodec_open2(FFmpeg.AutoGen.AVCodecContext*, FFmpeg.AutoGen.AVCodec*, FFmpeg.AutoGen.AVDictionary**)
 at GraphicsCheck.FfmpegChecker.StartEncoder(Omni.Platforms.Windows.Services.AV.CodecInfo, Int32, Int32, Int32)
 at GraphicsCheck.FfmpegChecker.CheckConfig(CodecConfig)
 at Program.<main>$(System.String[])
</main></initialize>


I created a sample app to demo this issue. And following the path of the calls..


- 

- That happens at nvenc_open_session and is called here
- That would cause going to fail2 routine, which is this one :






fail2:
 CHECK_CU(dl_fn->cuda_dl->cuCtxDestroy(ctx->cu_context_internal));
 ctx->cu_context_internal = NULL;



- 

- ctx->cu_context_internal comes from (in same method) then I suppose it was created properly (as otherwise wouldn't continue).




ret = CHECK_CU(dl_fn->cuda_dl->cuCtxCreate(&ctx->cu_context_internal, 0, cu_device));
 if (ret < 0)
 goto fail;



- 

- ctx in that method is the priv_data of AVCodecContext as we can see here :




static av_cold int nvenc_check_device(AVCodecContext *avctx, int idx)
{
 NvencContext *ctx = avctx->priv_data;



- 

- Also the act of printing the error message, on nvenc_print_error, is interacting with context.




static int nvenc_print_error(AVCodecContext *avctx, NVENCSTATUS err,
 const char *error_string)
{
 const char *desc;
 const char *details = "(no details)";
 int ret = nvenc_map_error(err, &desc);

#ifdef NVENC_HAVE_GETLASTERRORSTRING
 NvencContext *ctx = avctx->priv_data;
 NV_ENCODE_API_FUNCTION_LIST *p_nvenc = &ctx->nvenc_dload_funcs.nvenc_funcs;

 if (p_nvenc && ctx->nvencoder)
 details = p_nvenc->nvEncGetLastErrorString(ctx->nvencoder);
#endif

 av_log(avctx, AV_LOG_ERROR, "%s: %s (%d): %s\n", error_string, desc, err, details);

 return ret;
}



- 

-
av_log is executed as we can see the error message on logs then the other lines shouldn't be a problem.


-
Seeing the other calls, when nvenc_check_device fails the error is going up to nvenc_check_device -> nvenc_setup_device but we aren't seeing more logs then the issue may be on nvenc_check_device on fail2 routine or on nvenc_print_error








Any thoughts ?


-
How can upload audio on dropbox after converted it from the video format using ffmpeg in nodejs and angular
21 septembre 2021, par Amir Shahzadnodejs server side code


This is my nodejs server side where i want to convert the video into the audio format and then want to upload the converted audio on the dropbox is there any way to do that ??


const express = require('express'),
path = require('path'),
cors = require('cors'),
ffmpeg = require('fluent-ffmpeg'),
fs = require("fs"),
access_token = "My-Access-Token";

ffmpeg.setFfmpegPath('/usr/bin/ffmpeg');

const app = express();
app.use(cors());
app.use(express.json());
app.use(express.urlencoded({
 extended: false
}));


app.post('/api/upload', upload.single('mp4'), function (req, res) {
 if (!req.file) {
 console.log("No file is available!");
 return res.send({
 success: false
 });

 } else {
 function convert(input, output, callback) {
 ffmpeg(input)
 .output(output)
 .on('end', function() { 
 console.log('conversion ended');
 callback(null);
 }).on('error', function(err){
 console.log('error: ', err);
 callback(err);
 }).run();
 }
 const filepath = req.file.path;
 var content = fs.readFileSync(filepath);

 options = {
 method: "POST",
 url: 'https://content.dropboxapi.com/2/files/upload',
 headers: {
 "Content-Type": "text/plain; charset=dropbox-cors-hack" ,
 "Authorization": "Bearer " + access_token,
 "Dropbox-API-Arg": "{\"path\": \"/youtube- 
 radio/"+req.file.originalname+"\",\"mode\": \"overwrite\",\"autorename\": 
 true,\"mute\": false}",
 },
 body:content
};
convert(filepath, options+'.mp3', function(err,res, body){
 if(!err) {
 console.log('File Name is',req.file.originalname);
 console.log('File Path Is = ',req.file.path)
 console.log('conversion complete'); 
 console.log('ERR', err);
 }
});
console.log('File is available!');
return res.send({
 success: true
})
}
 });


 const PORT = process.env.PORT || 8080;
 const server = app.listen(PORT, () => {
 console.log('Connected to port ' + PORT)
 })



i have read many documentations of dropbox and ffmpeg and angular file upload but i could not understand Please anyone can resolve my code Thanks in advance


This is my typescript file


import { Component, OnInit } from '@angular/core';
import { FileUploader } from 'ng2-file-upload';
import { ToastrService } from 'ngx-toastr';
import { Track } from 'ngx-audio-player'; 
import { PlayerServiceService } from './services/player-service.service';


const URL = 'http://localhost:8080/api/upload';

@Component({
 selector: 'app-root',
 templateUrl: './app.component.html',
 styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{

public uploader: FileUploader = new FileUploader({
 url: URL,
 itemAlias: 'mp4'
});
 constructor(private toastr: ToastrService,
 private playerService: PlayerServiceService) { }

 ngOnInit(): void {
 this.uploader.onAfterAddingFile = (file) => {
 file.withCredentials = false;
 };
 this.uploader.onCompleteItem = (item: any, status: any) => {
 console.log('Uploaded File Details:', item);
 this.toastr.success('File successfully uploaded!');
 };

}
}



This is html code


<div class="container mt-5">
 <div class="file-upload">
 <input type="file" ng2fileselect="ng2fileselect" />
 <button type="button" class="btn btn-info">
 Upload
 </button>
 </div>
</div>



-
Problems with ffmpeg command line on android
17 mai 2017, par user2193172I managed to compile the ffmpeg Static build. But when I am trying to call the ffmpeg command line I get a Java IOException : No such file or Directory.
My code is as follows :
public void merge_video(View view){
if(ffmpeg_file.exists()){
Log.d(null, "ffmpeg exists");
}else{
Log.d(null, "Could not locate ffmpeg in the folder");
}
File file1 = new File("/mnt/sdcard/com.ffmpeg_test/VID_3_25_2013_12_22.mp4");
if(file1.exists()){
Log.d(null,"File 1 exists");
}
File file2 = new File("/mnt/sdcard/com.ffmpeg_test/VID_3_25_2013_12_28.mp4");
if(file2.exists()){
Log.d(null,"File 2 exists");
}
String[] ffmpegCommand = new String[5];
ffmpegCommand[0] = "/mnt/sdcard/com.ffmpeg_test/ffmpeg";
ffmpegCommand[1] = "-i";
ffmpegCommand[2] = "concat:/mnt/sdcard/com.ffmpeg_test/VID_3_25_2013_12_22.mp4|/mnt/sdcard/com.ffmpeg_test/VID_3_25_2013_12_28.mp4";
ffmpegCommand[3] = "copy";
ffmpegCommand[4] = "/mnt/sdcard/com.ffmpeg_test/output.mp4";
try {
Process ffmpegProcess = new ProcessBuilder(ffmpegCommand).redirectErrorStream(true).start();
String line;
BufferedReader reader = new BufferedReader(new InputStreamReader(ffmpegProcess.getInputStream()));
Log.d(null, "*******Starting FFMPEG");
while((line = reader.readLine())!=null){
Log.d(null, "***"+line+"***");
}
Log.d(null,"****ending FFMPEG****");
} catch (IOException e) {
e.printStackTrace();
}
}The LogCat print is as follows :
03-27 20:41:10.522: W/System.err(24709): java.io.IOException: Error running exec(). Command: [/mnt/sdcard/com.ffmpeg_test/ffmpeg, -i, concat:/mnt/sdcard/com.ffmpeg_test/VID_3_25_2013_12_22.mp4|/mnt/sdcard/com.ffmpeg_test/VID_3_25_2013_12_28.mp4, copy, /mnt/sdcard/com.ffmpeg_test/output.mp4] Working Directory: null Environment: [ANDROID_SOCKET_zygote=13, TMPDIR=/data/local/tmp, 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/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar, USBHOST_STORAGE=/mnt/sdcard/usbStorage, ANDROID_DATA=/data, LD_LIBRARY_PATH=/vendor/lib:/system/lib, ANDROID_ROOT=/system, ANDROID_PROPERTY_WORKSPACE=12,32768, EXTERNAL_STORAGE2=/mnt/sdcard/external_sd]
03-27 20:41:10.522: W/System.err(24709): at java.lang.ProcessManager.exec(ProcessManager.java:224)
03-27 20:41:10.522: W/System.err(24709): at java.lang.ProcessBuilder.start(ProcessBuilder.java:202)
03-27 20:41:10.522: W/System.err(24709): at com.example.ffmpeg_test.MainActivity.merge_video(MainActivity.java:106)
03-27 20:41:10.522: W/System.err(24709): at java.lang.reflect.Method.invokeNative(Native Method)
03-27 20:41:10.522: W/System.err(24709): at java.lang.reflect.Method.invoke(Method.java:507)
03-27 20:41:10.527: W/System.err(24709): at android.view.View$1.onClick(View.java:2149)
03-27 20:41:10.527: W/System.err(24709): at android.view.View.performClick(View.java:2538)
03-27 20:41:10.527: W/System.err(24709): at android.view.View$PerformClick.run(View.java:9152)
03-27 20:41:10.527: W/System.err(24709): at android.os.Handler.handleCallback(Handler.java:587)
03-27 20:41:10.527: W/System.err(24709): at android.os.Handler.dispatchMessage(Handler.java:92)
03-27 20:41:10.527: W/System.err(24709): at android.os.Looper.loop(Looper.java:123)
03-27 20:41:10.527: W/System.err(24709): at android.app.ActivityThread.main(ActivityThread.java:3691)
03-27 20:41:10.527: W/System.err(24709): at java.lang.reflect.Method.invokeNative(Native Method)
03-27 20:41:10.527: W/System.err(24709): at java.lang.reflect.Method.invoke(Method.java:507)
03-27 20:41:10.532: W/System.err(24709): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
03-27 20:41:10.532: W/System.err(24709): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
03-27 20:41:10.537: W/System.err(24709): at dalvik.system.NativeStart.main(Native Method)
03-27 20:41:10.537: W/System.err(24709): Caused by: java.io.IOException: No such file or directory
03-27 20:41:10.537: W/System.err(24709): at java.lang.ProcessManager.exec(Native Method)
03-27 20:41:10.537: W/System.err(24709): at java.lang.ProcessManager.exec(ProcessManager.java:222)
03-27 20:41:10.537: W/System.err(24709): ... 16 more
03-27 20:41:36.057: W/KeyCharacterMap(24709): No keyboard for id 0
03-27 20:41:36.057: W/KeyCharacterMap(24709): Using default keymap: /system/usr/keychars/qwerty.kcm.bin