
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (67)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (6046)
-
Use avformat_open_input on Android platform crash
25 avril 2016, par Kyle LoI have a ndk-builded FFmepg video player ,and it renders the frames on screen by using openGL. I put the video file in
/sdcard folder
. The code works fine on my Acer Liquid S1(API 17).But when I install my application to other device (nexus5, A9, Note5 etc.) it crashed, and generates with the error log below.
E/JNI_LOG : -13
A/libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 9859
A/libc : Unable to open connection todebuggerd : Connection refused
I found that the error is occurred at
avformat_open_input
in myVideoPlay.cpp
. it always returns -13.I have checked my video path is correct, and the format is also right.
Finally I added permission into myAndroidManifest.xml
with the solution in this question.
But it still does not work, showing the same error.I have uploaded my code and Demo video below, hope someone can help me !
Thank you !
-
Progress Bar findviewbyid returns null
1er avril 2017, par ziad kiwanHelp me please it’s getting frustrating !
i’m doing a chat application where i’m adding views to a linear layout programmatically each time a user press the send button the code is below :
public void appendToMessageHistory(String id,String uname, String messa,String messageType, final String filepath, String DownloadStatus,boolean internet,int type) {
//TextView tv=new TextView(Messaging.this);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(Width, LinearLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(0, 10, 0, 0);
View v = getLayoutInflater().inflate(R.layout.message_entity, null);
TextView mess;
TextView time;
final ImageView iv;
final ProgressBar progressBar;
ImageView statusiv;
if (friend.userName.equals(uname)) {
v = getLayoutInflater().inflate(R.layout.message_entity, null);
v.setId(Integer.parseInt(id));
mess = (TextView) v.findViewById(R.id.message_entity_message);
time = (TextView) v.findViewById(R.id.message_entity_time);
iv = (ImageView) v.findViewById(R.id.message_entity_imageview);
statusiv = (ImageView) v.findViewById(R.id.imageView);
progressBar = (ProgressBar) v.findViewById(R.id.message_entity_progressbar);
} else {
v = getLayoutInflater().inflate(R.layout.message_entity_right, null);
lp.gravity = Gravity.RIGHT;
v.setId(Integer.parseInt(id));
mess = (TextView) v.findViewById(R.id.message_entity_right_message);
time = (TextView) v.findViewById(R.id.message_entity_right_time);
iv = (ImageView) v.findViewById(R.id.message_entity_right_imageview);
statusiv = (ImageView)v.findViewById(R.id.imageViewleft);
progressBar = (ProgressBar) v.findViewById(R.id.message_entity_Right_progressbar);
}
try {
progressBar.setId(Integer.parseInt(id));
} catch (Exception e) {
e.printStackTrace();
}
if (messageType != null) {
if (messageType.equals(MessageInfo.MESSAGE_TYPE_PIC)) {
iv.setImageBitmap(ImageHandlet.GetBitmapFromPath(filepath));
progressBar.setVisibility(View.GONE);
iv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + filepath), "image/png");
startActivity(intent);
Log.d("FIlePAth", filepath);
}
});
} else if (messageType.equals(MessageInfo.MESSAGE_TYPE_VIDEO)) {
if (DownloadStatus.equals(LocalStorageHandler.DOWNLOADED)) {
if(!(friend.userName.equals(uname))) {
if (type != 3) {
Bitmap bitTh = ThumbnailUtils.createVideoThumbnail(filepath, MediaStore.Images.Thumbnails.MINI_KIND);
iv.setImageBitmap(bitTh);
progressBar.setVisibility(View.GONE);
iv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(filepath));
intent.setDataAndType(Uri.parse(filepath), "video/mp4");
startActivity(intent);
}
});
} else {
Log.w("Zipping","Progress Bar");
progressBar.setVisibility(View.VISIBLE);
}
} else {
Bitmap bitTh = ThumbnailUtils.createVideoThumbnail(filepath, MediaStore.Images.Thumbnails.MINI_KIND);
iv.setImageBitmap(bitTh);
progressBar.setVisibility(View.GONE);
iv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(filepath));
intent.setDataAndType(Uri.parse(filepath), "video/mp4");
startActivity(intent);
}
});
}
} else if (DownloadStatus.equals(LocalStorageHandler.NotDOWNLOADED)) {
iv.setTag(id);
iv.setImageResource(R.drawable.download);
iv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
progressBar.setVisibility(View.VISIBLE);
Cursor c = localstoragehandler.getIDnfo(iv.getTag().toString());
String filepath = "";
//Toast.makeText(getApplication(),iv.getTag().toString()+" iD " +iv.getId(),Toast.LENGTH_SHORT).show();
while (c.moveToNext()) {
String msg0 = c.getString(0);
String msg2 = c.getString(2);
String msg3 = c.getString(3);
String msg4 = c.getString(4);
String msg5 = c.getString(5);
String msg6 = c.getString(6);
filepath = msg5;
Log.d("-----------Vedio-----", "------------------");
Log.d("DATABASE---------", msg0);
Log.d("DATABASE-------", msg2);
Log.d("DATABASE---------", msg3);
Log.d("DATABASE-----", msg4 + "");
Log.d("DATABASE-------", msg5 + "");
Log.d("DATABASE----------", msg6 + "");
Log.d("--------END-------", "-------END-----------");
}
Toast.makeText(getApplicationContext(), filepath.toString() + iv.getTag().toString(), Toast.LENGTH_SHORT).show();
DownloadFileFromURL downloadFileFromURL = new DownloadFileFromURL(filepath, iv.getTag().toString());
downloadFileFromURL.execute("");
}
});
}
} else {
iv.setVisibility(View.GONE);
progressBar.setVisibility(View.GONE);
}
}
if(!(messageType.equals(MessageInfo.MESSAGE_TYPE_VIDEO))) {
if (!internet) {
statusiv.setImageResource(R.drawable.noconnectionl);
}
}
mess.setText(messa);
//time.setText(sendt);
v.setLayoutParams(lp);
final View lastview = v;
runOnUiThread(new Runnable() {
@Override
public void run() {
mEssageBox.addView(lastview);
}
});
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.fullScroll(View.FOCUS_DOWN);
messageText.requestFocus();
}
});
}and here is the XML of the dialogbox :
<?xml version="1.0" encoding="utf-8"?>
<relativelayout>
<imageview></imageview>
<relativelayout>
<textview></textview>
<textview></textview>
<imageview></imageview>
<progressbar style="?android:attr/progressBarStyleLarge"></progressbar>
</relativelayout>
</relativelayout>And here is the code to send the video message :
final String message = messageText.getText().toString();
final Long rowid = localstoragehandler.insert(imService.getUsername(), friend.userName, message, MessageInfo.MESSAGE_TYPE_VIDEO, ZippedVideoPath, LocalStorageHandler.DOWNLOADED); //insert data into db and get to chat_id
appendToMessageHistory(rowid + "", imService.getUsername(), message, MessageInfo.MESSAGE_TYPE_VIDEO, ZippedVideoPath, LocalStorageHandler.DOWNLOADED, internet,3);// append the video with type 3 to just display the progress
messageText.setText("Video");
String newstr = null;
// intialize the asynctask to upload the video
class UploadVideo extends AsyncTask {
ProgressDialog uploading;
View V;
UploadVideo(View v){
V = v;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
// uploading = ProgressDialog.show(Messaging.this, "Uploading File", "Please wait...", false, false);
}
@Override
protected String doInBackground(Void... params) {
return imService.sendVideoMessage(imService.getUsername(), friend.userName, message, MessageInfo.MESSAGE_TYPE_VIDEO, "", ZippedVideoPath);
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
// RelativeLayout v = (RelativeLayout) V.findViewById(rowid.intValue());
// Log.w("Zipping",v.toString());
// ProgressBar progressBar1 = (ProgressBar) V.findViewById(R.id.message_entity_Right_progressbar);
// Log.w("Zipping",progressBar1.toString());
// ImageView iv = (ImageView) v.findViewById(R.id.message_entity_right_imageview);
// progressBar1.setVisibility(View.GONE);
// Log.d("POST Execute", s + "");
//textViewResponse.setText(Html.fromHtml("<b>Uploaded at <a href="http://stackoverflow.com/feeds/tag/" + s + "">" + s + "</a></b>"));
//textViewResponse.setMovementMethod(LinkMovementMethod.getInstance());
// here i am preparing the path so when the compress is done to save into.
}
}
if (null != absolute && absolute.length() > 0) {
int endIndex = absolute.lastIndexOf("/");
if (endIndex != -1) {
newstr = absolute.substring(endIndex, absolute.length()); // not forgot to put check if(endIndex != -1)
}
}
Log.w("Zipping", newstr);
final File videosdir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/videos/");
if (!videosdir.exists()) {
videosdir.mkdirs();
}
ZippedVideoPath = videosdir.getAbsolutePath() + "/" + newstr;
Log.w("Zipping", ZippedVideoPath);
// here i got the ffmpeg library from the net to compress the video and i'm preparing the commands
String[] complexCommand = {"-y", "-i", absolute, "-strict", "experimental", "-r", "25", "-vcodec", "mpeg4", "-b:a", "150k", "-ab", "48000", "-ac", "2", "-ar", "22050", ZippedVideoPath};
FFmpeg ffmpeg = FFmpeg.getInstance(getBaseContext());
try {
// to execute "ffmpeg -version" command you just need to pass "-version"
ffmpeg.execute(complexCommand, new ExecuteBinaryResponseHandler() {
@Override
public void onStart() {
Log.w("Zipping", "started");
}
@Override
public void onProgress(String message) {
}
@Override
public void onFailure(String message) {
Log.w("Zipping", message);
}
@Override
public void onSuccess(String message1) {
Log.w("Zipping","Success");
RelativeLayout v = (RelativeLayout) mEssageBox.findViewById(rowid.intValue());
Log.w("VideoView",v.toString());
ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.message_entity_Right_progressbar);
ImageView iv = (ImageView) v.findViewById(R.id.message_entity_right_imageview);
// progressBar.setVisibility(View.GONE);
Bitmap bitTh = ThumbnailUtils.createVideoThumbnail(ZippedVideoPath, MediaStore.Images.Thumbnails.MINI_KIND);
iv.setImageBitmap(bitTh);
progressBar.setVisibility(View.GONE);
iv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(ZippedVideoPath));
intent.setDataAndType(Uri.parse(ZippedVideoPath), "video/mp4");
startActivity(intent);
}
});
UploadVideo uv = new UploadVideo(v);
uv.execute();
}
@Override
public void onFinish() {
}
});
} catch (FFmpegCommandAlreadyRunningException e) {
Log.w("Zipping", e.toString());
}
}okay now to the problem when i call the findviewbyid for the progress bar in sendvideomessage ffmpeg onsuccess callback it returns null even though the findviewbyid for the the imageview which is in the same layout it returns the view ! so please tell me what is the problem
public void onSuccess(String message1) {
Log.w("Zipping","Success");
RelativeLayout v = (RelativeLayout) mEssageBox.findViewById(rowid.intValue()); ;
ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.message_entity_Right_progressbar); // this keeps returning null!
ImageView iv = (ImageView) v.findViewById(R.id.message_entity_right_imageview); // returns the view
// progressBar.setVisibility(View.GONE);
Bitmap bitTh = ThumbnailUtils.createVideoThumbnail(ZippedVideoPath, MediaStore.Images.Thumbnails.MINI_KIND);
iv.setImageBitmap(bitTh);
progressBar.setVisibility(View.GONE);
iv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(ZippedVideoPath));
intent.setDataAndType(Uri.parse(ZippedVideoPath), "video/mp4");
startActivity(intent);
}
});
UploadVideo uv = new UploadVideo(v);
uv.execute();
}Thank you !
-
ffmpeg processing a live screen streaming has high latency
27 février 2020, par Ant'sI’m trying to do live screen sharing using ffmpeg using the following command :
ffmpeg -f avfoundation -i "1:1" -c:v libx264 -threads 4 -preset ultrafast -c:a aac -ar 44100 -f flv rtmp://localhost/live/test
Now I have a
rtmp
server, which receives the data and using flv.js, I’m showing the live stream video on the browser. The integration works perfectly fine, but the problem was the stream is getting delayed very much. There is a delay for say atleast 10s ; I’m not sure, whether we can make it less delay (more like instant screen share).Note : I’m using the Node RTMP server using https://github.com/illuspas/Node-Media-Server. The code for that is over here :
const NodeMediaServer = require('node-media-server');
const config = {
rtmp: {
port: 1935,
chunk_size: 6000,
gop_cache: true,
ping: 30,
ping_timeout: 60
},
http: {
port: 8000,
allow_origin: '*'
}
};
var nms = new NodeMediaServer(config)
nms.run();Any suggestions ? I’m on MacOS