
Recherche avancée
Autres articles (104)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (8115)
-
Is there any way to change file FPS in javascript browser or prepare wav conventer to 60FPS videos ?
16 novembre 2020, par SZtyroI'm making web application which stores short audio files that have been cut from large video files. User uploads .mp4 file, chooses sound length and here's a little trick. Cutting audio can only be done in backend (correct me if I'm wrong) and sending 700MB data is not good option, so I use code below to decode audio data from .mp4 and then I send it with start and stop params. Backend (Node.js) use's FFMPEG to cut audio and save's it.


This part works, but i realised that decoded audio from 60FPS video doesn't sound good (not terrible but totally useless in my app). My goal is to avoid third party, especially desktop, apps (like audacity) and allow user to cut revelant part of audio from any mp4 video. Is there any way to convert 60FPS video to 30FPS video (ArrayBuffer) in browser and then decode audio ?


fileInput.onchange = event => {
 this.file = event.target["files"][0];
 //.mp4 file
 this.fileURL = URL.createObjectURL(this.file)

 let baseAudioContext = new AudioContext();
 this.file.arrayBuffer().then(buff => {

 baseAudioContext.decodeAudioData(buff,
 success => {
 console.log(success)
 this.bufferToWave(success, 0, success.length);
 },
 err => console.log(err));
 })
 }

 bufferToWave(abuffer, offset, len) {

 var numOfChan = abuffer.numberOfChannels,
 length = len * numOfChan * 2 + 44,
 buffer = new ArrayBuffer(length),
 view = new DataView(buffer),
 channels = [], i, sample,
 pos = 0;

 // write WAVE header
 setUint32(0x46464952); // "RIFF"
 setUint32(length - 8); // file length - 8
 setUint32(0x45564157); // "WAVE"

 setUint32(0x20746d66); // "fmt " chunk
 setUint32(16); // length = 16
 setUint16(1); // PCM (uncompressed)
 setUint16(numOfChan);
 setUint32(abuffer.sampleRate);
 setUint32(abuffer.sampleRate * 2 * numOfChan); // avg. bytes/sec
 setUint16(numOfChan * 2); // block-align
 setUint16(16); // 16-bit (hardcoded in this demo)

 setUint32(0x61746164); // "data" - chunk
 setUint32(length - pos - 4); // chunk length

 // write interleaved data
 for (i = 0; i < abuffer.numberOfChannels; i++)
 channels.push(abuffer.getChannelData(i));

 while (pos < length) {
 for (i = 0; i < numOfChan; i++) { // interleave channels
 sample = Math.max(-1, Math.min(1, channels[i][offset])); // clamp
 sample = (0.5 + sample < 0 ? sample * 32768 : sample * 32767) | 0; // scale to 16-bit signed int
 view.setInt16(pos, sample, true); // update data chunk
 pos += 2;
 }
 offset++ // next source sample
 }

 // create Blob
 //return (URL || webkitURL).createObjectURL(new Blob([buffer], { type: "audio/wav" }));
 var u = (URL || webkitURL).createObjectURL(new Blob([buffer], { type: "audio/wav" }));

 //temporary part
 //downloading file to check quality
 //in this part sound is already broken, no need to show backend code
 const a = document.createElement('a');
 a.style.display = 'none';
 a.href = u;
 a.download = name;
 document.body.appendChild(a);
 a.click();



 function setUint16(data) {
 view.setUint16(pos, data, true);
 pos += 2;
 }

 function setUint32(data) {
 view.setUint32(pos, data, true);
 pos += 4;
 }
 }



-
Restreaming another nginx rtmp stream
9 novembre 2019, par Amar KalabićFirst of all, I’ll explain what I want to achieve, because there might be even better way to achieve this.
I am looking at making 2 streams work, one is pushing to twitch.tv and youtube with delay and other one is live (without delay) that can be watched using VLC or whatever.I am able to achieve this partially, but "live" stream just breaks sometimes randomly with this error :
Failed to update header with correct duration.
Failed to update header with correct filesize.Before, I had "Could not find codec parameters" error, but I solved it by adding this to my ffmpeg command :
-analyzeduration 2147483647 -probesize 2147483647
What I’ve already done is :
I made these rtmp server and apps in my nginx.conf
rtmp {
server {
listen 1935;
chunk_size 4096;
application delay_live {
live on;
record off;
push_reconnect 500ms;
push rtmp://live-vie.twitch.tv/app/my_stream_key;
push rtmp://a.rtmp.youtube.com/live2/my_stream_key;
}
application live {
live on;
record off;
}
application delay {
live on;
record all;
record_path /tmp/nginx;
# Work with timestamp to know when to continue streaming
record_suffix .flv;
record_unique on;
# Work with signals to know when to continue streaming
#record_append on;
exec_publish sudo sh /home/start.sh;
}
exec_static mkdir /tmp/nginx; #Working dir. Must be consistend with the delayer.py
}
}On
exec_publish
I run this .sh script :sudo screen -dmS delay bash -c "python /usr/local/nginx/sbin/delay/rtmp_stream_delayer.py; sleep 9999";
sleep 0.5;
sudo screen -dmS live bash -c "python /usr/local/nginx/sbin/live/rtmp_stream_live.py; sleep 9999";Those two python scripts are a little bit changed script from this git :
https://github.com/sistason/rtmp_stream_delayer
Few things I changed there is I used ffmpeg instead of avconv to call the commands, and insidertmp_stream_live.py
I’ve set the same directory/file asrtmp_stream_delayer.py
(so it basically uses same .flv file to stream live).rtmp_stream_live.py
has delay set to 0. Also I added-analyzeduration 2147483647 -probesize 2147483647
to my live stream ffmpeg call to avoid codec errors I previously had.Full ffmpeg calls that I use :
rtmp_stream_delayer.py
subprocess.check_output('ffmpeg -re -i {0} -codec copy -f flv {1}'.format(filename, "rtmp://my_ip:port/delay_live").split())
rtmp_stream_live.py
subprocess.check_output('ffmpeg -re -analyzeduration 2147483647 -probesize 2147483647 -i /tmp/nginx/{0} -codec copy -f {1}'.format(filename, STREAM_DESTINATION).split())
I tried adding this ffmpeg flag, but it didn’t help at all (codec errors are back again) :
flv -flvflags no_duration_filesize
Delay stream works like a charm and without any problems, but live stream randomly stops with update header errors, I haven’t been able to trigger it myself, it just happens randomly !
Thanks in advance !
-
Command build failed ndk
1er janvier 2021, par ALI RAZAI want to integrate ffmpeg lib in my android app . So i am using ndk ,but i am stuck on this issue,I dont know why the error is appearing ,Thanks in advance ;


It is the gradle code that i am using in my app and also the ffmpeg-android-maker path is provided


plugins {
id 'com.android.application'





android 
compileSdkVersion 30
buildToolsVersion "30.0.3"


defaultConfig {
 applicationId "com.reactive.myapplication"
 minSdkVersion 16
 targetSdkVersion 30
 versionCode 1
 versionName "1.0"

 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 externalNativeBuild {
 cmake {
 cppFlags ""
 }
 }
}
flavorDimensions "market"
productFlavors {
 google {
 dimension "market"
 ndk {
 // Since the App Bundle is used, there is no problem in packaging all these ABIs
 abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
 }
 }
 amazon {
 dimension "market"
 applicationIdSuffix ".amzn"
 ndk {
 // Amazon Appstore doesn't support multiple APKs for non-Amazon devices.
 // There is no point in x86 support here, as the majority of devices with the
 // Amazon Appstore are ARM-based. And it seems to be a common practice for other
 // apps in this market.
 abiFilters 'armeabi-v7a'
 }
 }
 huawei {
 dimension "market"
 applicationIdSuffix ".huawei"
 ndk {
 // Huawei App Gallery supports App Bundle format
 abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
 }
 }
}
sourceSets {
 main {
 // let gradle pack the shared library into the apk
 jniLibs.srcDirs = ['../ffmpeg-android-maker/output/lib']
 }
}

bundle {
 language {
 enableSplit = true
 }
 density {
 enableSplit = true
 }
 abi {
 enableSplit = true
 }
}

buildTypes {
 release {
 minifyEnabled false
 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
 }
}
externalNativeBuild {
 cmake {
 path "src/main/cpp/CMakeLists.txt"
 version "3.10.2"
 }
}
compileOptions {
 sourceCompatibility JavaVersion.VERSION_1_8

 targetCompatibility JavaVersion.VERSION_1_8
}





dependencies


implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'







And this is error i am facing :
Build command failed.
Error while executing process /home/ali/Android/Sdk/cmake/3.10.2.4988404/bin/ninja with arguments -C /home/ali/AndroidStudioProjects/FfmpegApp/app/.cxx/cmake/amazonDebug/armeabi-v7a native-lib
ninja : Entering directory `/home/ali/AndroidStudioProjects/FfmpegApp/app/.cxx/cmake/amazonDebug/armeabi-v7a'


ninja : error : '/home/ali/AndroidStudioProjects/FfmpegApp/app/src/main/ffmpeg-android-maker/output/lib/armeabi-v7a/libavutil.so', needed by '/home/ali/AndroidStudioProjects/FfmpegApp/app/build/intermediates/cmake/amazonDebug/obj/armeabi-v7a/libnative-lib.so', missing and no known rule to make it