
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 (24)
-
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 (...)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)
Sur d’autres sites (4979)
-
How to get a file converted by ffmpeg in Android : permission denied
2 juin 2021, par Omid.NI am trying to use FFmpeg in my android app. So I want to test it if it works before moving on. I use an external library : github link

The code looks like this :

package net.omidn.aslanmediaconverter;

import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.arthenica.ffmpegkit.ExecuteCallback;
import com.arthenica.ffmpegkit.FFmpegKit;
import com.arthenica.ffmpegkit.FFmpegSession;
import com.arthenica.ffmpegkit.Session;

import net.bramp.ffmpeg.job.FFmpegJob;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;


public class MainActivity extends AppCompatActivity {
 
 private static final String TAG = "MainActivity";
 FFmpegJob myjob;

 @Override
 protected void onCreate(Bundle savedInstanceState) {


 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);

 TextView textView = (TextView) findViewById(R.id.text_view);


 FFmpegJob job = null;

 File inFile = new File("/storage/emulated/0/video_2021-05-29_17-50-20.mp4");
 String inputName = Uri.fromFile(inFile).toString();
 Log.d(TAG, inputName);
 Log.d(TAG,"file exists : " + String.valueOf(inFile.exists()));
 Log.d(TAG,"file canRead : " + String.valueOf(inFile.canRead()));

 FFmpegSession fFmpegSession = FFmpegKit.executeAsync("-i file:///storage/emulated/0/video_2021-05-29_17-50-20.mp4 -c:v mpeg4 file:///storage/emulated/0/out.mp4",
 new ExecuteCallback() {
 @Override
 public void apply(Session session) {

 }
 });
 try {
 Thread.sleep(5000);
 } catch (InterruptedException e) {
 e.printStackTrace();
 }
 textView.setText("" + fFmpegSession.getState().name() + " " + fFmpegSession.getOutput());
 }

}




As you can see I give the files with
file:///
protocol. If I don't use that the resault is the same. The three lines ofLog.d(...)
will print :

2021-06-03 00:58:08.869 8376-8376/net.omidn.aslanmediaconverter D/MainActivity: file:///storage/emulated/0/video_2021-05-29_17-50-20.mp4
2021-06-03 00:58:08.869 8376-8376/net.omidn.aslanmediaconverter D/MainActivity: file exists : true
2021-06-03 00:58:08.869 8376-8376/net.omidn.aslanmediaconverter D/MainActivity: file canRead : false



The video file has read access on the storage :



-
Live555 Multicast RTSP Server - Display in FFMPEG
31 mai 2021, par BanBI made a multicast RTSP server using the Live555 library.

It is displayed by VLC but not from VMS (NX Witness) or FFMPEG.

If I use the Unicast, I can display it, but I do not know how to change the file that is streaming in the Unicast.

Is there a way to change the streaming file in Unicast or make it viewable in FFMPEG with Multicast ?

This is my code.




Header




#include <iostream>
#include <string>
#include <filesystem>
#include <fstream>
#include <ctime>
#include 
#include 
#include 
#include <opencv2></opencv2>videoio.hpp>
#include <opencv2></opencv2>imgcodecs.hpp>

void Start(const char* streamPath, int port);
void AddDataL(BYTE* data, int length);
AddDataHW(BYTE* data, int height, int width);

void Play();
void AfterPlaying(void*);

void EncodeToH264(cv::Mat image);
long long GetTimeMs();
int GetFileCount();
const char* GetFirstFilePath();

const int fourcc = cv::VideoWriter::fourcc('x', '2', '6', '4');

UsageEnvironment* env;
H264ServerMediaSubsession* h264;
H264VideoStreamFramer* videoSource;
RTPSink* videoSink;

const char* dataPath = "data/";
const char* extension = ".h264";
</ctime></fstream></filesystem></string></iostream>




CPP




void Start()
{
 askScheduler *scheduler = BasicTaskScheduler::createNew();
 env = BasicUsageEnvironment::createNew(*scheduler);

 RTSPServer *rtspServer = RTSPServer::createNew(*env, 8554);

 if (rtspServer == NULL)
 throw;

 struct sockaddr_storage destinationAddress;
 destinationAddress.ss_family = AF_INET;
 ((struct sockaddr_in &)destinationAddress).sin_addr.s_addr = chooseRandomIPv4SSMAddress(*env);

 const unsigned short rtpPortNum = 18888;
 const unsigned short rtcpPortNum = rtpPortNum + 1;
 const unsigned char ttl = 255;

 const Port rtpPort(rtpPortNum);
 const Port rtcpPort(rtcpPortNum);

 Groupsock rtpGroupsock(*env, destinationAddress, rtpPort, ttl);
 rtpGroupsock.multicastSendOnly();
 Groupsock rtcpGroupsock(*env, destinationAddress, rtcpPort, ttl);
 rtcpGroupsock.multicastSendOnly();

 OutPacketBuffer::maxSize = 300000;
 videoSink = H264VideoRTPSink::createNew(*env, &rtpGroupsock, 96);

 const unsigned estimatedSessionBandwidth = 5000;
 const unsigned maxCNAMElen = 100;
 unsigned char CNAME[maxCNAMElen + 1];
 gethostname((char *)CNAME, maxCNAMElen);
 CNAME[maxCNAMElen] = '\0';

 RTCPInstance *rtcp = RTCPInstance::createNew(*env, &rtcpGroupsock, estimatedSessionBandwidth, CNAME, videoSink, NULL, True);

 ServerMediaSession *sms = ServerMediaSession::createNew(*env, "live", "live", "Session streamed by \"Test Server\"", True);
 sms->addSubsession(PassiveServerMediaSubsession::createNew(*videoSink, rtcp));
 rtspServer->addServerMediaSession(sms);

 *env << "Start > " << rtspServer->rtspURL(sms) << "\n";

 Play();

 env->taskScheduler().doEventLoop();
}

void AddData(BYTE* data, int length)
{
 EncodeToH264(cv::imdecode(cv::Mat(1, length, CV_8UC3, data), 1));
}

void EncodeToH264(cv::Mat image)
{
 std::string fileName = dataPath + std::to_string(GetTimeMs()) + extension;
 cv::VideoWriter writer(fileName.c_str(), fourcc, 1, image.size());
 writer.write(image);
 writer.write(image);
 writer.release();
}

void Play()
{
 while (GetFileCount() == 0);

 const char* fileName = GetFirstFilePath();

 ByteStreamFileSource* fileSource;
 while ((fileSource = ByteStreamFileSource::createNew(*env, fileName)) == NULL);

 FramedSource* videoES = fileSource;

 videoSource = H264VideoStreamFramer::createNew(*env, videoES);

 videoSink->startPlaying(*videoSource, AfterPlaying, videoSink);
}

void AfterPlaying(void*)
{
 videoSink->stopPlaying();
 Medium::close(videoSource);

 if (GetFileCount() > 1)
 std::filesystem::remove(GetFirstFilePath());

 Play();
}

long long GetTimeMs()
{
 return std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count();
}

int GetFileCount() 
{
 return std::distance(std::filesystem::directory_iterator(dataPath), std::filesystem::directory_iterator());
}

const char* GetFirstFilePath()
{
 for (const auto& entry : std::filesystem::directory_iterator(dataPath))
 return entry.path().string().c_str();
}



-
How to use ffmpeg to record video from SDP ?
17 août 2024, par Thomas CarltonI'm running Ubuntu 18.04 and I have the following SDP Offer from Kurento Media Server. The offer is saved to the file a.sdp :


v=0
 o=- 3831476180 3831476180 IN IP4 172.31.46.122
 s=Kurento Media Server
 c=IN IP4 172.31.46.122
 t=0 0
 m=audio 28460 RTP/AVPF 96 0 97
 a=setup:actpass
 a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
 a=rtpmap:96 opus/48000/2
 a=rtpmap:97 AMR/8000
 a=rtcp:28461
 a=sendrecv
 a=mid:audio0
 a=ssrc:1797155263 cname:user1913428254@host-e7ab0454
 m=video 18122 RTP/AVPF 102 103
 a=setup:actpass
 a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
 a=rtpmap:102 VP8/90000
 a=rtpmap:103 H264/90000
 a=fmtp:103 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
 a=rtcp:18123
 a=sendrecv
 a=mid:video0
 a=rtcp-fb:102 nack
 a=rtcp-fb:102 nack pli
 a=rtcp-fb:102 goog-remb
 a=rtcp-fb:102 ccm fir
 a=rtcp-fb:103 nack
 a=rtcp-fb:103 nack pli
 a=rtcp-fb:103 ccm fir
 a=ssrc:2822275190 cname:user1913428254@host-e7ab0454



Then, I'm calling ffmpeg to record this flow to a file :


ffmpeg -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist file,crypto,udp,rtp -re -i a.sdp -vcodec copy -acodec aac -y output.mp4



172.31.46.122 is the local IP adress and I'm running ffmpeg from the same machine as SDP offer. So ffmpeg has access to this IP address.


I'm getting the error :




bind failed : Address already in use.


a.sdp : Invalid data found when processing input




How can I solve that ?