
Recherche avancée
Médias (1)
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (51)
-
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 (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, 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 (...)
Sur d’autres sites (7178)
-
ffmpegmediaMetadataRetriever cannot be used for m3u8 format ?
19 juillet 2017, par NandzI want to get the frames from the video URL which is of m3u8 format. I couldn’t retrieve the frame at the specified time. When i tried with mp4 format, it worked. ( Am using android videoview)
Here is my code.
public class VideoViewAdapterClass extends RecyclerView.Adapter {
private List<videomodelactivity> videoListModel;
private Context context;
public Bitmap bitmap;
String videoPath = "https://xxxxxx.xxxxxx.xxxxx/HLS/xxxxxxxx/fruit_milkshake-master-playlist.m3u8";
public VideoViewAdapterClass(List<videomodelactivity> videoList, Context context) {
this.context = context;
videoListModel = videoList;
}
@Override
public VideoViewAdapterClass.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemLayoutView = LayoutInflater.from(parent.getContext()).inflate(
R.layout.customized_layout, null);
ViewHolder viewHolder = new ViewHolder(itemLayoutView);
return viewHolder;
}
@Override
public void onBindViewHolder(final VideoViewAdapterClass.ViewHolder holder, int position) {
final VideoModelActivity videoModel = videoListModel.get(position);
holder.movieName.setText(videoModel.getMovieName());
MediaMetadataRetriever mediaMetadataRetriever = null;
try {
mediaMetadataRetriever = new MediaMetadataRetriever();
if (Build.VERSION.SDK_INT >= 14)
mediaMetadataRetriever.setDataSource(videoPath, new HashMap());
bitmap = mediaMetadataRetriever.getFrameAtTime(2000000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (mediaMetadataRetriever != null)
mediaMetadataRetriever.release();
}
holder.vidImg.setImageBitmap(bitmap);
holder.vidImg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent (context, VideoViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return videoListModel.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
ImageView vidImg;
TextView movieName;
public ViewHolder(View itemView) {
super(itemView);
vidImg = (ImageView) itemView.findViewById(R.id.imageVid);
movieName = (TextView) itemView.findViewById(R.id.movieName);
}
}
}
</videomodelactivity></videomodelactivity> -
ffmpeg command not working with white space of directory path in Android
13 avril 2017, par Sakib SyedI am working with
FFMPEG
library in which I want to rotate video using this library which works fine if I amfile path
has no anywhite space
. But in my case I have white space of video directory (you can see full path inString commandStr
onPreExecute()
method ofasynctask
) path then it is not working at all. I have also seen same question like this and some more but not get any idea how to resolved it properly. Below is my code of MainActivity.classpublic class MainActivity extends AppCompatActivity implements View.OnClickListener{
String workFolder = null;
String demoVideoFolder = null;
String vkLogPath = null;
private boolean commandValidationFailedFlag = false;
private Button btnRun;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GeneralUtils.checkForPermissionsMAndAbove(MainActivity.this, true);
setIds();
setListner();
demoVideoFolder = Environment.getExternalStorageDirectory().getAbsolutePath() + "/videokit/";
Log.i(Prefs.TAG, getString(R.string.app_name) + " version: " + GeneralUtils.getVersionName(getApplicationContext()) );
workFolder = getApplicationContext().getFilesDir().getAbsolutePath() + "/";
vkLogPath = workFolder + "vk.log";
GeneralUtils.copyLicenseFromAssetsToSDIfNeeded(this, workFolder);
GeneralUtils.copyDemoVideoFromAssetsToSDIfNeeded(this, demoVideoFolder);
int rc = GeneralUtils.isLicenseValid(getApplicationContext(), workFolder);
Log.i(Prefs.TAG, "License check RC: " + rc);
}
private void setListner() {
btnRun.setOnClickListener(this);
}
private void setIds() {
try {
btnRun = (Button)findViewById(R.id.btnRun);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.btnRun:
Log.i(Prefs.TAG, "run clicked.");
if (GeneralUtils.checkIfFileExistAndNotEmpty(workFolder)) {
new TranscdingBackground(MainActivity.this).execute();
}
else {
Toast.makeText(getApplicationContext(), workFolder + " not found", Toast.LENGTH_LONG).show();
}
break;
}
}
public class TranscdingBackground extends AsyncTask
{
ProgressDialog progressDialog;
Activity _act;
String commandStr;
public TranscdingBackground (Activity act) {
_act = act;
}
@Override
protected void onPreExecute() {
// commandStr = "ffmpeg -y -i /storage/emulated/0/WhatsApp/Media/in.mp4 -vf rotate=270*(PI/180) /sdcard/videokit/out.mp4";
commandStr = "ffmpeg -y -i /storage/emulated/0/WhatsApp/Media/WhatsApp Video/in.mp4 -vf rotate=270*(PI/180) /sdcard/videokit/out.mp4";
progressDialog = new ProgressDialog(_act);
progressDialog.setMessage("FFmpeg4Android Transcoding in progress...");
progressDialog.show();
}
protected Integer doInBackground(String... paths) {
Log.i(Prefs.TAG, "doInBackground started...");
// delete previous log
boolean isDeleted = GeneralUtils.deleteFileUtil(workFolder + "/vk.log");
Log.i(Prefs.TAG, "vk deleted: " + isDeleted);
PowerManager powerManager = (PowerManager)_act.getSystemService(Activity.POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VK_LOCK");
Log.d(Prefs.TAG, "Acquire wake lock");
wakeLock.acquire();
LoadJNI vk = new LoadJNI();
try {
vk.run(GeneralUtils.utilConvertToComplex(commandStr), workFolder, getApplicationContext());
// copying vk.log (internal native log) to the videokit folder
GeneralUtils.copyFileToFolder(vkLogPath, demoVideoFolder);
} catch (CommandValidationException e) {
Log.e(Prefs.TAG, "vk run exeption.", e);
commandValidationFailedFlag = true;
} catch (Throwable e) {
Log.e(Prefs.TAG, "vk run exeption.", e);
}
finally {
if (wakeLock.isHeld())
wakeLock.release();
else{
Log.i(Prefs.TAG, "Wake lock is already released, doing nothing");
}
}
Log.i(Prefs.TAG, "doInBackground finished");
return Integer.valueOf(0);
}
protected void onProgressUpdate(Integer... progress) {
}
@Override
protected void onCancelled() {
Log.i(Prefs.TAG, "onCancelled");
//progressDialog.dismiss();
super.onCancelled();
}
@Override
protected void onPostExecute(Integer result) {
Log.i(Prefs.TAG, "onPostExecute");
progressDialog.dismiss();
super.onPostExecute(result);
// finished Toast
String rc = null;
if (commandValidationFailedFlag) {
rc = "Command Vaidation Failed";
}
else {
rc = GeneralUtils.getReturnCodeFromLog(vkLogPath);
}
final String status = rc;
MainActivity.this.runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(MainActivity.this, status, Toast.LENGTH_LONG).show();
if (status.equals("Transcoding Status: Failed")) {
Toast.makeText(MainActivity.this, "Check: " + vkLogPath + " for more information.", Toast.LENGTH_LONG).show();
}
}
});
}
}
}Here
onPreExecute()
method I have given video file path. -
FFmpeg Video Streaming on android app
18 avril 2017, par Johnny RogerI’m trying to do a streaming of my laptop webcam to my android smartphone.
So I set an ffserver in this wayHTTPPort 1234
RTSPPort 1235
<feed>
File /tmp/feed2.ffm
FileMaxSize 2M
ACL allow 127.0.0.1
</feed>
<stream>
Feed feed2.ffm
Format rtp
Noaudio
VideoCodec libx264
AVOptionVideo flags +global_header
AVOptionVideo me_range 16
AVOptionVideo qdiff 4
AVOptionVideo qmin 10
AVOptionVideo qmax 51
ACL allow 192.168.0.0 192.168.255.255
</stream>and I used the following ffmpeg instruction
ffmpeg -i /dev/video0 -vcodec libx264 -tune zerolatency -crf 18 http://localhost:1234/feed2.ffm
in my android studio project i set in the manifest file
That is my MainActivity.java
package com.example.johnny.ffmpeg;
import android.app.ProgressDialog;
import android.content.Context;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.SurfaceView;
import android.view.View;
import android.net.Uri;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.MediaController;
import android.widget.Toast;
import android.widget.VideoView;
public class MainActivity extends AppCompatActivity implements VideoView.OnClickListener
{
ProgressDialog mDialog;
VideoView videoView;
ImageView btnPlayPause;
MediaController mediaController;
String videoURL ="rtsp://192.168.1.100:1235/test1.sdp";
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
videoView =(VideoView)findViewById(R.id.videoView);
mediaController= new MediaController(this);
mediaController.setAnchorView(videoView);
btnPlayPause = (ImageButton)findViewById(R.id.btn_play_pause);
btnPlayPause.setOnClickListener(this);
}
@Override
public void onClick(View v) {
mDialog = new ProgressDialog(MainActivity.this);
mDialog.setMessage("Please wait...");
mDialog.setCanceledOnTouchOutside(false);
mDialog.show();
Uri uri = Uri.parse(videoURL);
videoView.setVideoURI(uri);
try{
if(!videoView.isPlaying()) {
videoView.setMediaController(mediaController);
videoView.requestFocus();
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
btnPlayPause.setImageResource(R.drawable.ic_aplay);
}
});
}
else
{
videoView.pause();
btnPlayPause.setImageResource(R.drawable.ic_pause);
}
}
catch(Exception ex)
{
Context context = getApplicationContext();
String text = ex.toString();
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
videoView.requestFocus();
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener(){
@Override
public void onPrepared(MediaPlayer mp){
mDialog.dismiss();
mp.setLooping(true);
videoView.start();
btnPlayPause.setImageResource(R.drawable.ic_pause);
}
});
videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
Log.d("video", "setOnErrorListener ");
return true;
}
});
}
}and that is the relative activity_main.xml file :
<relativelayout>
<videoview></videoview>
<textview></textview>
<textview></textview>
</relativelayout>I tested the streaming on vlc and it work well (even if with dealy, it’s not in real time).
The app instead give me the message "can’t play this video" and the following error :V/MediaPlayer: message received msg=100, ext1=1, ext2=-38
E/MediaPlayer: Error (1,-38)
D/VideoView: Error: 1,-38
D/video: setOnErrorListener
E/MediaPlayer: error (1, -38)
V/MediaPlayer: callback application
V/MediaPlayer: back from callback
E/MediaPlayer: Error (1,-38)
D/VideoView: Error: 1,-38
D/video: setOnErrorListener
E/ViewRootImpl: sendUserActionEvent() mView == nullI saw that the problem could be the format of the video, but i tried also with an mp4 file
ffmpeg -i test.mp4 -vcodec libx264 -tune zerolatency -crf 18 http://localhost:1234/feed2.ffm
and the result was the same. How Can I fix it and let my app work well ?