
Recherche avancée
Autres articles (51)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
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 ;
-
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (12774)
-
Unable to split audio using easy_audio_trimmer
27 juillet 2023, par Sana Wasimcan we use the easy_audio_trimmer package to split an audio ? I tried using the ffmpeg but it is conflicting with the above package and not work.


I tried splitting by using these functions and it gave an error at the FlutterFFmpeg() method and i cant find an alternative also the duration(filePath) in the command final durationResult = await flutterSound.duration(filePath) ; shows an error


Future<void> _splitAudio() async {
 setState(() {
 _progressVisibility = true;
 });

 // Get the application documents directory
 final appDocumentsDirectory = await getApplicationDocumentsDirectory();

 // Get the input audio file path
 final inputAudioPath = widget.file.path;

 // Get the output file names for the two parts
 final outputFileName1 = 'split_audio_part1.mp3';
 final outputFileName2 = 'split_audio_part2.mp3';

 // Get the output file paths for the two parts
 final outputPath1 = '${appDocumentsDirectory.path}/$outputFileName1';
 final outputPath2 = '${appDocumentsDirectory.path}/$outputFileName2';

 // Calculate the duration of the original audio
 final originalDuration = await _getAudioDuration(inputAudioPath);

 // Calculate the durations of the two parts
 final part1Duration = _startValue;
 final part2Duration = originalDuration - _endValue;

 // Construct the FFmpeg command to split the audio
 final ffmpeg = FlutterFFmpeg();
 final splitCommand = '-i $inputAudioPath -ss 0 -t $part1Duration -c copy $outputPath1 -ss $_endValue -t $part2Duration -c copy $outputPath2';

 try {
 // Execute the FFmpeg command to split the audio
 final int result = await ffmpeg.execute(splitCommand);

 if (result == 0) {
 setState(() {
 _progressVisibility = false;
 });
 debugPrint('Audio split successfully.');
 } else {
 setState(() {
 _progressVisibility = false;
 });
 debugPrint('Failed to split audio.');
 }
 } catch (error) {
 setState(() {
 _progressVisibility = false;
 });
 debugPrint('Error while splitting audio: $error');
 }
 }

 Future<int> _getAudioDuration(String filePath) async {
 final flutterSound = FlutterSound();
 final durationResult = await flutterSound.duration(filePath);
 return durationResult.inMilliseconds;
 }
</int></void>


Dependencies


path_provider: ^2.0.15
 ffmpeg_kit_flutter: ^5.1.0
 audioplayers: ^4.1.0
 flutter_sound: ^9.2.13



-
FFMPEG : Converting from raw audio to audio/mp4 (audio is being converted with slow speed)
29 décembre 2017, par ValdirIf I convert from mp3 to mp4 directly everything works perfectly. But if I try to convert from raw pcm, the audio speed is slowed down.
I’ve tried the following (this works) :
ffmpeg -i mp3/1.mp3 -strict -2 final.mp4
This doesn’t work as expected :
ffmpeg -f s16le -i final.raw -strict -2 -r 26 final.mp4
With the following output :
Input #0, s16le, from 'final.raw':
Duration: 00:08:37.38, bitrate: 705 kb/s
Stream #0:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
File 'final.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'final.mp4':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 128 kb/s
Metadata:
encoder : Lavc56.60.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
size= 8273kB time=00:08:37.38 bitrate= 131.0kbits/s
video:0kB audio:8185kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.073808%I’ve tried to set parameters like :
ffmpeg -ar 44100 -f s16le -i final.raw -strict -2 -r 26 final.mp4
With no luck.
In order to get the PCM from mp3 I’m using nodejs lame decoder :
var decoder = new lame.Decoder({
channels: 2,
bitDepth: 16,
sampleRate: 44100,
bitRate: 128,
outSampleRate: 44100, // 22050
mode: lame.STEREO
}); -
i am getting when i am trying to run Ffmpegrabberframe on alpine image [closed]
18 mars 2020, par avinash tiwari# # A fatal error has been detected by the Java Runtime Environment :
# SIGSEGV (0xb) at pc=0x000000000000dc56, pid=446, tid=0x00007fd3c478db20 # # JRE version : OpenJDK Runtime Environment
(8.0_242-b08) (build 1.8.0_242-b08) # Java VM : OpenJDK 64-Bit Server
VM (25.242-b08 mixed mode linux-amd64 compressed oops) # Derivative :
IcedTea 3.15.0 # Distribution : Custom build (Wed Jan 29 10:43:50 UTC
2020) # Problematic frame : # C 0x000000000000dc56 # # Failed to
write core dump. Core dumps have been disabled. To enable core
dumping, try "ulimit -c unlimited" before starting Java again # # An
error report file with more information is saved as : #
/builds/had/tip/asset-delivery/firstgen-ingestion---backend/hs_err_pid446.log# If you would like to submit a bug report, please include # instructions on how to reproduce the bug and visit : #
https://icedtea.classpath.org/bugzilla # Exception in thread
"Thread-8" java.io.EOFException at
java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:3015)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1576)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:465)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:423)
at
org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1$React.react(Framework.scala:818)
at
org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1.run(Framework.scala:807)def extractAVI(rawDrivePath: String): List[String] = {
var errorList: List[String] = List.empty
FileUtils.listFiles(new File(rawDrivePath), new SuffixFileFilter(".avi"), TrueFileFilter.INSTANCE)
.asScala.toList.foreach(aviFile => {
var grabber: FFmpegFrameGrabber = null
var aviStream: InputStream = null
var isFailedExtraction: Boolean = false
try {
LOGGER.info(s"--------inside try----------${aviFile.getAbsolutePath}")
aviStream = new FileInputStream(aviFile.getAbsolutePath)
LOGGER.info("--------create grabber----------")
grabber = new FFmpegFrameGrabber(aviStream)
LOGGER.info("--------created grabber extraction of drives----------")
grabber.start()
LOGGER.info("--------start grabber of drives----------")
var count: Int = 1
for (frame <- Iterator.continually(grabber.grabImage()).takeWhile(_ != null)) {
ImageIO.write(converter.convert(frame), "jpg", new File(aviFile.getParent, "capture-" + count + ".jpg"))
count += 1
}
grabber.stop()
} catch {
case ex: Exception => {
LOGGER.info(s"Error while extracting images for ${aviFile.getAbsolutePath} {}", ex)
errorList :+= s"${aviFile.getAbsolutePath.replace(rawDrivePath, "")} -> ${ex.getMessage}"
isFailedExtraction = true
LOGGER.info("last inside catch")
}
} finally {
// Close the video file
LOGGER.info(s"inside finally ")
if (grabber != null)
grabber.release()
if (aviStream != null)
aviStream.close()
if (aviFile.exists() && !isFailedExtraction) {
LOGGER.debug(s"Deleting ${aviFile.getAbsolutePath}")
FileUtils.deleteQuietly(aviFile)
}
}
})