
Recherche avancée
Médias (3)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (99)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
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.
Sur d’autres sites (10805)
-
Video Encoding issue
6 octobre 2014, par pbellemaI’m making an app that records small videos and concatenates them together (like Vine).
If I record a video without concatenation there are no problems.
But if I assemble recordings, two problems appear : records disappear or they are cut out.When I start to record :
private boolean prepareVideoRecorder(){
if (mCamera != null) {
mMediaRecorder = new MediaRecorder();
Camera.Parameters p = mCamera.getParameters();
CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
// Step 1: Unlock and set camera to MediaRecorder
mCamera.unlock();
mMediaRecorder.setCamera(mCamera);
//mMediaRecorder.setOrientationHint(90);
Log.i("MY_LOG", "set preview display");
mMediaRecorder.setMaxDuration(8000);
// Step 2: Set sources
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
// Step 3: Set a CamcorderProfile (requires API Level 8 or higher)
mMediaRecorder.setProfile(profile);
mMediaRecorder.setVideoSize(profile.videoFrameWidth,profile.videoFrameHeight);
// Step 4: Set output file
mMediaRecorder.setOutputFile(getOutputMediaFile().toString());
if (mFrontCamera) {
mMediaRecorder.setPreviewDisplay(mFrontPreview.getHolder().getSurface());
} else {
mMediaRecorder.setPreviewDisplay(mBackPreview.getHolder().getSurface());
}
// Step 6: Prepare configured MediaRecorder
try {
mMediaRecorder.prepare();
} catch (IllegalStateException e) {
Log.d("MY_LOG", "IllegalStateException preparing MediaRecorder: " + e.getMessage());
releaseMediaRecorder();
return false;
} catch (IOException e) {
Log.d("MY_LOG", "IOException preparing MediaRecorder: " + e.getMessage());
releaseMediaRecorder();
return false;
}
return true;
} else {
Log.i("MY_LOG", "camera null");
return false;
}And when I stop :
private void stopRecording(boolean forcedStop) {
mRecording = false;
try {
mMediaRecorder.stop();
releaseMediaRecorder();
mCamera.lock();
rotateVideo(mPaths.size() - 1, mFrontCamera);
if (forcedStop) manageVideos(forcedStop);
} catch (RuntimeException e) {
Log.i("MY_LOG", "Exception" + e.toString());
}
}and when I finish, those are my concatenation functions :
private void manageVideos(boolean forcedStop) {
if (mPaths.size() > 1 || forcedStop) {
String mediaStorageDirPath = Helper.getMediaStorageDirPath();
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
final String path = mediaStorageDirPath + File.separator +
"APPEND_"+ timeStamp + ".mp4";
finalVideo = path;
ffmpegAppend(path);
} else {
finalVideo = mPaths.get(0);
if (!isProcessingFFmpeg) {
goToSubtitleFragment(finalVideo);
}
}
}
private void ffmpegAppend(String path) {
String mediaStorageDirPath = Helper.getMediaStorageDirPath();
String filePath = mediaStorageDirPath + File.separator + "append.txt";
try {
File f = new File(filePath);
OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(f));
BufferedWriter writer = new BufferedWriter(out);
for (int i = 0; i < mPaths.size(); i++) {
writer.write("file '" + mPaths.get(i) + "'");
writer.newLine();
}
writer.close();
String cmd = "ffmpeg -f concat -i " + filePath + " -c copy " + path;
mCmd.add(cmd);
manageCommands();
} catch (Exception e) {
}
}
private void manageCommands() {
if (!isProcessingFFmpeg && mCmd.size() > 0) {
new FFmpegTask().execute(mCmd.get(0));
}
}
private class FFmpegTask extends AsyncTask {
protected Integer doInBackground(String... cmd) {
isProcessingFFmpeg = true;
int fileCount = cmd.length;
Processor p = new Processor(Helper.getEncodingLibraryPath(getActivity()), getActivity());
for (String c : cmd) {
String[] strArr = c.split(" ");
p.process(strArr);
}
return fileCount;
}
protected void onProgressUpdate(Integer... progress) {
}
protected void onPostExecute(Integer result) {
StackTraceElement[] ste = Thread.currentThread().getStackTrace();
isProcessingFFmpeg = false;
if (mCmd.size() > 0) {
mCmd.remove(0);
}
if (mCmd.size() > 0) {
new FFmpegTask().execute(mCmd.get(0));
} else if (isFinished) {
goToSubtitleFragment(finalVideo);
}
}
}Do you see where the problems might be coming from ?
Thanks to you. -
React Native (Android) : Download mp3 file
21 février 2024, par Batuhan FındıkI get the youtube video link from the ui. I download the video from this link and convert it to mp3. I download it to my phone as mp3. The song opens on WhatsApp on the phone. but it doesn't open on the mp3 player. The song is not broken because it opens on WhatsApp too. Why do you think the mp3 player doesn't open ? Could it be from the file information ? I tried to enter some file information but it still won't open. For example, there is from information in songs played on an mp3 player. There is no from information in my song file. I tried to add it but it wasn't added.


.net 8 api return :


[HttpPost("ConvertVideoToMp3")]
public async Task<iactionresult> ConvertVideoToMp3(Mp3 data)
{
 try
 {
 string videoId = GetYoutubeVideoId(data.VideoUrl);

 var streamInfoSet = await _youtubeClient.Videos.Streams.GetManifestAsync(videoId);
 var videoStreamInfo = streamInfoSet.GetAudioOnlyStreams().GetWithHighestBitrate();

 if (videoStreamInfo != null)
 {
 var videoStream = await _youtubeClient.Videos.Streams.GetAsync(videoStreamInfo);
 var memoryStream = new MemoryStream();

 await videoStream.CopyToAsync(memoryStream);
 memoryStream.Seek(0, SeekOrigin.Begin);

 var videoFilePath = $"{videoId}.mp4";
 await System.IO.File.WriteAllBytesAsync(videoFilePath, memoryStream.ToArray());

 var mp3FilePath = $"{videoId}.mp3";
 var ffmpegProcess = Process.Start(new ProcessStartInfo
 {
 FileName = "ffmpeg",
 Arguments = $"-i \"{videoFilePath}\" -vn -acodec libmp3lame -ab 128k -id3v2_version 3 -metadata artist=\"YourArtistName\" -metadata title=\"YourTitle\" -metadata from=\"youtube\" \"{mp3FilePath}\"",
 RedirectStandardError = true,
 UseShellExecute = false,
 CreateNoWindow = true
 });

 await ffmpegProcess.WaitForExitAsync();

 var file = TagLib.File.Create(mp3FilePath);

 
 file.Tag.Artists = new string [] { "YourArtistName"};
 file.Tag.Title = "YourTitle";
 file.Tag.Album = "YourAlbumName"; 
 file.Tag.Comment = "Source: youtube";
 

 file.Save();

 var mp3Bytes = await System.IO.File.ReadAllBytesAsync(mp3FilePath);

 System.IO.File.Delete(videoFilePath);
 System.IO.File.Delete(mp3FilePath);

 return File(mp3Bytes, "audio/mpeg", $"{videoId}.mp3");
 }
 else
 {
 return NotFound("Video stream not found");
 }
 }
 catch (Exception ex)
 {
 return StatusCode(500, $"An error occurred: {ex.Message}");
 }
}
</iactionresult>


React Native :


const handleConvertAndDownload = async () => {
 try {
 const url = 'http://192.168.1.5:8080/api/Mp3/ConvertVideoToMp3';
 const fileName = 'example';
 const newFileName = generateUniqueSongName(fileName);
 const filePath = RNFS.DownloadDirectoryPath + '/'+newFileName;

 fetch(url, {
 method: 'POST',
 headers: {
 'Content-Type': 'application/json',
 },
 body: JSON.stringify({videoUrl:videoUrl}),
 })
 .then((response) => {
 if (!response.ok) {
 Alert.alert('Error', 'Network');
 throw new Error('Network response was not ok');
 }
 return response.blob();
 })
 .then((blob) => {
 return new Promise((resolve, reject) => {
 const reader = new FileReader();
 reader.onloadend = () => {
 resolve(reader.result.split(',')[1]); 
 };
 reader.onerror = reject;
 reader.readAsDataURL(blob);
 });
 })
 .then((base64Data) => {
 // Dosyanın varlığını kontrol et
 return RNFS.exists(filePath)
 .then((exists) => {
 if (exists) {
 console.log('File already exists');
 return RNFS.writeFile(filePath, base64Data, 'base64', 'append');
 } else {
 console.log('File does not exist');
 return RNFS.writeFile(filePath, base64Data, 'base64');
 }
 })
 .catch((error) => {
 console.error('Error checking file existence:', error);
 throw error;
 });
 })
 .then(() => {
 Alert.alert('Success', 'MP3 file downloaded successfully.');
 console.log('File downloaded successfully!');
 })
 .catch((error) => {
 Alert.alert('Error', error.message);
 console.error('Error downloading file:', error);
 });
 } catch (error) {
 Alert.alert('Error', error.message);
 console.error(error);
 }
 };



-
ServletOutputStream failed to flush :
18 septembre 2024, par DawidI try to convert m3u8 file to WebM using ffmpeg and stream it onto browser.
I want it to play on browser without using any javascript.
Stream video method :


public void streamVideo(OutputStream os ){

 String url = "m3u8file.m3u8";


 byte[] bytes = new byte[BUFFER];
 int bytesRead = -1;

 ProcessBuilder pb = new ProcessBuilder(
 "ffmpeg",
 "-i", url,
 "-c:v", "libvpx-vp9", 
 "-b:v", "1M", 
 "-c:a", "libopus", 
 "-b:a", "128k",
 "-f", "webm", 
 "pipe:1" 
 );
 pb.redirectErrorStream(true);

 try {
 Process process = pb.start();
 try (
 InputStream is = process.getInputStream()){

 while((bytesRead = is.read(bytes)) != -1){
 os.write(bytes, 0 , bytesRead);
 os.flush();
 }


 }catch (IOException ex){
 ex.printStackTrace();
 }


 }catch (IOException ex){
 ex.printStackTrace();
 }



 }


}



Web Controller



 @Autowired
 private VideoService videoService;

 @GetMapping("/stream")
 public ResponseEntity<streamingresponsebody> streamVideo(@RequestHeader(value = "Range", required = false) String rangeHeader) {
 HttpHeaders headers = new HttpHeaders();

 headers.add("Content-Type", "video/webm");
 headers.add("Accept-Ranges", "bytes");

 StreamingResponseBody responseStream = os ->{
 videoService.streamVideo(os);
 };
 return new ResponseEntity<>(responseStream, headers, HttpStatus.PARTIAL_CONTENT);
 }
</streamingresponsebody>


When I open the /stream I get an error on spring application


"ServletOutputStream failed to flush : java.io.IOException : An established connection was aborted by the software in your host machine"


- 

-
On firefox in console I got 2 errors
Cant decode multimedia resource :
And Cant decode multimedia resource:Error Code : NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006)
And the window which video will be showing says "No video with supported format and MIME type found"


-
On Chrome just nothing happens


-
And on firefox when i open the view-source i see the stream information and then there is jibberish which i suppose are bytes from the video the. The jibberish stops when i got the ServletOutputStream failed to flush : in console in Spring










Sorry if error codes translation is hard to understand


-