
Recherche avancée
Autres articles (112)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
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 (12802)
-
ffmpeg converting RTSP to HLS stops working after hours
28 juin 2019, par lin wangI’m using ffmpeg to convert RTSP stream to HLS, here is the command :
ffmpeg -rtsp_transport tcp -i rtsp ://address/9012120.smil -vcodec copy -acodec copy -fflags +genpts -f hls -hls_wrap 5 -hls_list_size 2 -hls_time 3 /dev/shm/live/1/v.m3u8
It worked properly at the beginning, but after hours(sometimes 8 hours sometimes less),it just stopped updating .ts files but the ffmpeg process was still running, so the hls stream just stuck.
Check the log, no error log at the moment of the converting stopping,but before that there were some warning logs as below :[hls @ 0x57602c0] Non-monotonous DTS in output stream 0:1 ; previous : 5957536600,
current : 2744367719 ; changing to 5957536601. This may result in incorrect timestamps in the output file.Any idea how to fix this ?
-
Rust Win32 FFI : User-mode data execution prevention (DEP) violation
28 avril 2022, par TheElixI'm trying to pass a ID3D11Device instance from Rust to a C FFI Library (FFMPEG).


I made this sample code :


pub fn create_d3d11_device(&mut self, device: &mut Box, context: &mut Box) {
 let av_device : Box<avbufferref> = self.alloc(HwDeviceType::D3d11va);
 unsafe {
 let device_context = Box::from_raw(av_device.data as *mut AVHWDeviceContext);
 let mut d3d11_device_context = Box::from_raw(device_context.hwctx as *mut AVD3D11VADeviceContext);
 d3d11_device_context.device = device.as_mut() as *mut _;
 d3d11_device_context.device_context = context.as_mut() as *mut _;
 let avp = Box::into_raw(av_device);
 av_hwdevice_ctx_init(avp);
 self.av_hwdevice = Some(Box::from_raw(avp));
 }
 }
</avbufferref>


On the Rust side the Device does work, but on the C side, when FFMEPG calls
ID3D11DeviceContext_QueryInterface
the app crashes with the following error :Exception 0xc0000005 encountered at address 0x7ff9fb99ad38: User-mode data execution prevention (DEP) violation at location 0x7ff9fb99ad38


The address is actually the pointer for the lpVtbl of QueryInterface, like seen here :


The disassembly of the address also looks correct (this is done on an another debugging session) :


(lldb) disassemble --start-address 0x00007ffffdf3ad38
 0x7ffffdf3ad38: addb %ah, 0x7ffffd(%rdi,%riz,8)
 0x7ffffdf3ad3f: addb %al, (%rax)
 0x7ffffdf3ad41: movabsl -0x591fffff80000219, %eax
 0x7ffffdf3ad4a: outl %eax, $0xfd



Do you have any pointer to debug this further ?


EDIT : I made a Minimal Reproducion Sample. Interestingly this does not causes a DEP Violation, but simply a Segfault.


On the C side :


int test_ffi(ID3D11Device *device){
 ID3D11DeviceContext *context;
 device->lpVtbl->GetImmediateContext(device, &context);
 if (!context) return 1;
 return 0;
}



On the Rust side :


unsafe fn main_rust(){
 let mut device = None;
 let mut device_context = None;
 let _ = match windows::Win32::Graphics::Direct3D11::D3D11CreateDevice(None, D3D_DRIVER_TYPE_HARDWARE, OtherHinstance::default(), D3D11_CREATE_DEVICE_DEBUG, &[], D3D11_SDK_VERSION, &mut device, std::ptr::null_mut(), &mut device_context) {
 Ok(e) => e,
 Err(e) => panic!("Creation Failed: {}", e)
 };
 let mut device = match device {
 Some(e) => e,
 None => panic!("Creation Failed2")
 };
 let mut f2 : ID3D11Device = transmute_copy(&device); //Transmuting the WinAPI into a bindgen ID3D11Device
 test_ffi(&mut f2);
}



The bindgen build.rs :


extern crate bindgen;

use std::env;
use std::path::PathBuf;

fn main() {
 // Tell cargo to tell rustc to link the system bzip2
 // shared library.
 println!("cargo:rustc-link-lib=ffi_demoLIB");
 println!("cargo:rustc-link-lib=d3d11");

 // Tell cargo to invalidate the built crate whenever the wrapper changes
 println!("cargo:rerun-if-changed=library.h");

 // The bindgen::Builder is the main entry point
 // to bindgen, and lets you build up options for
 // the resulting bindings.
 let bindings = bindgen::Builder::default()
 // The input header we would like to generate
 // bindings for.
 .header("library.h")
 // Tell cargo to invalidate the built crate whenever any of the
 // included header files changed.
 .parse_callbacks(Box::new(bindgen::CargoCallbacks))
 .blacklist_type("_IMAGE_TLS_DIRECTORY64")
 .blacklist_type("IMAGE_TLS_DIRECTORY64")
 .blacklist_type("PIMAGE_TLS_DIRECTORY64")
 .blacklist_type("IMAGE_TLS_DIRECTORY")
 .blacklist_type("PIMAGE_TLS_DIRECTORY")
 // Finish the builder and generate the bindings.
 .generate()
 // Unwrap the Result and panic on failure.
 .expect("Unable to generate bindings");

 // Write the bindings to the $OUT_DIR/bindings.rs file.
 let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
 bindings
 .write_to_file(out_path.join("bindings.rs"))
 .expect("Couldn't write bindings!");
}



The Complete Repo can be found over here : https://github.com/TheElixZammuto/demo-ffi


-
imc : add required padding for GetBitContext buffer
8 juin 2015, par Janne Grunau