
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (102)
-
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. -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (8197)
-
Play AAC in SoundManager2 won't start
27 novembre 2012, par sasaI converted audio file MP4 to AAC and then want to play that file in SoundManager2. If I use some software for Windows for convert, everying is fine, audio is playing well. But, on server side when MP4 file is converted to AAC using ffmpeg, file is loaded in SM2, but playing is not started.
I use this command :
ffmpeg -i in.mp4 out.aac
Here is SoundManager2 log :
-- SoundManager 2: HTML5 support tests (/^(probably|maybe)$/i): mp3: true (preferring flash), mp4: true (preferring flash), ogg: true, wav: true -- soundmanager2.js:1156
-- SoundManager 2 V2.97a.20120916 (AS3/Flash 9) + HTML5 audio, high performance mode, custom (1ms) polling, wmode: transparent, flash debug mode, flashBlock mode -- soundmanager2.js:1156
soundManager::createMovie(): Trying to load /soundmanager/swf/soundmanager2_flash9_debug.swf soundmanager2.js:1156
soundManager::initMovie(): Waiting for ExternalInterface call from Flash... soundmanager2.js:1158
soundManager::externalInterfaceOK() (~0 ms) soundmanager2.js:1158
soundManager::init() soundmanager2.js:1158
soundManager: Attempting JS to Flash call... soundmanager2.js:1158
(Flash): SM2 SWF V2.97a.20120916 (AS3/Flash 9) soundmanager2.js:1158
Flash security sandbox type: remote soundmanager2.js:1158
(Flash): JS to/from Flash OK soundmanager2.js:1158
(Flash): Enabling polling, 1 ms interval soundmanager2.js:1158
-- SoundManager 2 loaded (OK) -- soundmanager2.js:1156
soundManager: Firing 1 onready() item soundmanager2.js:1158
threeSixtyPlayer.init() soundmanager2.js:1158
threeSixtyPlayer.init(): Found 1 relevant items. soundmanager2.js:1158
handleClick() soundmanager2.js:1158
soundManager.createSound(): ui360Sound0 (http://[private url]/out.aac?v=1350309261) soundmanager2.js:1156
soundManager.createSound(): Enabling usePolicyFile for data access soundmanager2.js:1158
SMSound() merged options: {
id: ui360Sound0,
url: http://[private url]/out.aac?v=1350309261,
onplay: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onstop: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onpause: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onresume: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onfinish: { var nextLink; pl.removeClass(this._360data.oUIBox,this._360data... },
onbufferchange: { if (this.isBuffering) { pl.addClass(this._360data.oUIBox,pl.css... },
whileloading: { if (this.paused) { self.updatePlaying.apply(this); } }... },
whileplaying: { self.updatePlaying.apply(this); this._360data.fps++; }... },
useWaveformData: false,
useEQData: false,
usePeakData: true,
autoLoad: false,
autoPlay: false,
loops: 1,
multiShot: true,
multiShotEvents: false,
pan: 0,
stream: true,
usePolicyFile: true,
volume: 50,
useMovieStar: false,
isMovieStar: false,
bufferTime: 3
} soundmanager2.js:1158
(Flash): SoundManager2_SMSound_AS3: Got duration: 0, autoPlay: false soundmanager2.js:1158
SMSound.play(): Attempting to load "ui360Sound0" soundmanager2.js:1156
SMSound.load(): http://[private url]/out.aac?v=1350309261 soundmanager2.js:1156
SMSound.play(): "ui360Sound0" is starting to play soundmanager2.js:1158
fanOut: ui360Sound0: http://[private url]/out.aac?v=1350309261 soundmanager2.js:1158
(Flash): start (ui360Sound0): 0 soundmanager2.js:1158
SMSound._onbufferchange(): 1 soundmanager2.js:1158
SMSound._onbufferchange(): 0 soundmanager2.js:1158
SMSound._onload(): "ui360Sound0" loaded.What can be a problem ?
-
How can I use ffmpeg inside my wpf application
6 avril 2022, par KanotoI'm having some issue about using ffmpeg in my wpf project, I dunno why but it seems to not work inside msvc.




But it seems to work just fine in cmd.
I'm trying to use it in GoProControl project.
I already added path, $PATH with "C :\FFmpeg" and "C :\FFmpeg\bin" as well.
I have no idea why it doesn't work.


using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace GoProControl
{
 /// <summary>
 /// Logique d'interaction pour MainWindow.xaml
 /// </summary>
 public partial class GoProWindowsControl : Window
 {
 bool VERBOSE = false;

 //Sends Record command to GoPro Camera, must be in Video mode!
 bool RECORD = true;

 //Converts GoPro camera live stream via FFMPEG to a local source, must be in Video mode!
 bool STREAM = false;

 //Saves the feed to a custom location
 bool SAVE = false;

 private bool m_status;

 WebClient myWebClient;


 public GoProWindowsControl()
 {
 myWebClient = new WebClient();
 m_status = false;
 InitializeComponent();

 InitializeMainWindow();

 InitializeFFME();
 }

 private void InitializeMainWindow()
 {

 PreviewKeyDown += OnWindowKeyDown;

 }

 private void InitializeFFME()
 {
 Unosquare.FFME.Library.FFmpegDirectory = @"C:\FFmpeg";
 if (VERBOSE == false)
 Unosquare.FFME.Library.FFmpegLogLevel = FFmpeg.AutoGen.ffmpeg.AV_LOG_PANIC;
 else
 Unosquare.FFME.Library.FFmpegLogLevel = FFmpeg.AutoGen.ffmpeg.AV_LOG_ERROR;
 Unosquare.FFME.Library.FFmpegLoadModeFlags = FFmpeg.AutoGen.FFmpegLoadMode.VideoOnly;

 Unosquare.FFME.Library.LoadFFmpeg();
 }



-
How to create a MPEG4 file using FFMPEG : avcodec_send_frame() indicates error 2
15 janvier 2024, par SummitI am trying to create a MPEG4 file using FFMPEG , the initialize function is successful but the :writeFrame(unsigned char* imageData) function return error code of 2 at this line


if (avcodec_send_frame(m_CodecContext, frame) < 0)



This is my code.


FFmpegVideoWriter::FFmpegVideoWriter()
 : m_Initialized(false)
{

}

FFmpegVideoWriter::~FFmpegVideoWriter()
{
 //dispose();
}

bool FFmpegVideoWriter::init(const std::string& filename, int width, int height, int fps)
{
 if (m_Initialized){
 return false;
 }

 avcodec_register_all();
 m_Codec = avcodec_find_encoder(AV_CODEC_ID_MPEG4);
 if (!m_Codec) {
 qDebug() << "Codec not found";
 return false;
 }

 m_CodecContext = avcodec_alloc_context3(m_Codec);
 m_CodecContext->bit_rate = 4000000;
 m_CodecContext->width = width;
 m_CodecContext->height = height;
 m_CodecContext->time_base = { 1, fps };
 m_CodecContext->framerate = { fps, 1 };
 m_CodecContext->gop_size = 10;
 m_CodecContext->max_b_frames = 1;
 m_CodecContext->pix_fmt = AV_PIX_FMT_YUV420P;

 if (avcodec_open2(m_CodecContext, m_Codec, nullptr) < 0) {
 qDebug() << "Could not open the codec";
 return false;
 }

 frame = av_frame_alloc();
 if (!frame) {
 qDebug() << "Could not allocate the frame";
 return false;
 }

 frame->format = m_CodecContext->pix_fmt;
 frame->width = m_CodecContext->width;
 frame->height = m_CodecContext->height;

 if (av_frame_get_buffer(frame, 32) < 0) {
 qDebug() << "Could not allocate the video frame data";
 return false;
 }

 struct stat buffer;
 if (stat(filename.c_str(), &buffer) == 0) {
 // File exists , ask for overwrite confirmation
 QMessageBox msgBox;
 msgBox.setText("The file already exists");
 msgBox.setInformativeText("Do you want to overwrite it?");
 msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
 msgBox.setDefaultButton(QMessageBox::Yes);

 int ret = msgBox.exec();
 if (ret == QMessageBox::No) {
 // User chose not to overwrite , return false
 return false;
 }
 // If Yes , Proceed further
 }

 file = fopen(filename.c_str(), "wb");
 if (!file) {
 qDebug() << "Could not open or crate output file";
 return false;
 }
 else
 qDebug() << "File Opened";

 av_init_packet(&m_Pkt);
 m_Pkt.data = nullptr;
 m_Pkt.size = 0;
 m_Initialized = true;
 qDebug() << "AVI WRITER IS INITIALIZED";
 return true;
}

bool FFmpegVideoWriter::writeFrame(unsigned char* imageData) {
 qDebug() << "Making frame writable " << av_frame_make_writable(frame);
 // Input image is in RGBA format
 cv::Mat rgbaFrame(m_CodecContext->height, m_CodecContext->width, CV_8UC4, imageData);
 cv::Mat yuvFrame;
 cv::cvtColor(rgbaFrame, yuvFrame, cv::COLOR_RGBA2YUV_I420);

 // Fill the frame data
/* for (int i = 0; i < m_CodecContext->height; ++i) {
 std::memcpy(frame->data[0] + i * frame->linesize[0], yuvFrame.data + i * yuvFrame.step, m_CodecContext->width);
 }*/

 // Fill the frame data with red color
 for (int i = 0; i < m_CodecContext->height; ++i) {
 // Assuming YUV format, set U and V components to 128 (midpoint for red color)
 std::memset(frame->data[0] + i * frame->linesize[0], 255, m_CodecContext->width); // Y (luma)
 std::memset(frame->data[1] + i / 2 * frame->linesize[1], 128, m_CodecContext->width / 2); // U (chroma)
 std::memset(frame->data[2] + i / 2 * frame->linesize[2], 128, m_CodecContext->width / 2); // V (chroma)
 }

 frame->pts++;

 if (avcodec_send_frame(m_CodecContext, frame) < 0) {
 char errbuf[AV_ERROR_MAX_STRING_SIZE]; // Buffer to store error message
 av_strerror(errno, errbuf, AV_ERROR_MAX_STRING_SIZE);

 qDebug() << "Error: Could not send video frame for encoding - " << QString::fromUtf8(errbuf);
 qDebug() << "Could not send video frame for encoding";
 return false;
 }

 while (avcodec_receive_packet(m_CodecContext, &m_Pkt) == 0) {
 fwrite(m_Pkt.data, 1, m_Pkt.size, file);
 av_packet_unref(&m_Pkt);
 }

 return true;
}

void FFmpegVideoWriter::dispose() {
 if (m_Initialized) {
 avcodec_free_context(&m_CodecContext);
 av_frame_free(&frame);
 fclose(file);
 m_Initialized = false;
 }
}

bool FFmpegVideoWriter::IsInited() const
{
 return m_Initialized;
}