
Recherche avancée
Autres articles (109)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.
Sur d’autres sites (14972)
-
How can I stream very long H.264 videos over HTTP without long startup times ? (or : MOOV atom too large)
5 octobre 2012, par michaelI want to stream videos of public meetings that are often 10 hours long. Users will generally be starting at some point in the middle of the video and jumping around frequently.
H.264 in an MP4 container seems like the current best option for encoding streaming video (right ?). But these are large files — about 1.3GB for one file — and the metadata (MOOV atom) at the beginning of the file is itself about 40MB. If I understand correctly, clients need to download the full metadata before they're able to seek within the remainder of the file. Obviously, having to download 40MB before you can start streaming is unacceptable.
(My tests of streaming have been with VLC and the HTML5 tag in Chrome.)
I'm encoding the file using avconv, and am currently providing no additional settings beyond telling it which encoders to use (x264 and libfaac). I then move the metadata to the beginning of the file using qt-faststart.
Is there a way to make the MOOV atom smaller ?
If not, are there other strategies to use (e.g. is splitting long videos into several files something that's frequently done ? it seems like a real pain in terms of users seeking around the whole day's video) ?
Or should I be using a different codec or container ?
thanks !
Here's a breakdown of the file header structure, from AtomicParsley :
Atom ftyp @ 0 of size: 32, ends @ 32
Atom moov @ 32 of size: 40157673, ends @ 40157705
Atom mvhd @ 40 of size: 108, ends @ 148
Atom iods @ 148 of size: 24, ends @ 172
Atom trak @ 172 of size: 20156304, ends @ 20156476
Atom tkhd @ 180 of size: 92, ends @ 272
Atom edts @ 272 of size: 36, ends @ 308
Atom elst @ 280 of size: 28, ends @ 308
Atom mdia @ 308 of size: 20156168, ends @ 20156476
Atom mdhd @ 316 of size: 32, ends @ 348
Atom hdlr @ 348 of size: 45, ends @ 393
Atom minf @ 393 of size: 20156083, ends @ 20156476
Atom vmhd @ 401 of size: 20, ends @ 421
Atom dinf @ 421 of size: 36, ends @ 457
Atom dref @ 429 of size: 28, ends @ 457
Atom stbl @ 457 of size: 20156019, ends @ 20156476
Atom stsd @ 465 of size: 147, ends @ 612
Atom avc1 @ 481 of size: 131, ends @ 612
Atom avcC @ 567 of size: 45, ends @ 612
Atom stts @ 612 of size: 6115608, ends @ 6116220
Atom stss @ 6116220 of size: 16960, ends @ 6133180
Atom ctts @ 6133180 of size: 5683824, ends @ 11817004
Atom stsc @ 11817004 of size: 28, ends @ 11817032
Atom stsz @ 11817032 of size: 4169724, ends @ 15986756
Atom stco @ 15986756 of size: 4169720, ends @ 20156476
Atom trak @ 20156476 of size: 20001133, ends @ 40157609
Atom tkhd @ 20156484 of size: 92, ends @ 20156576
Atom mdia @ 20156576 of size: 20001033, ends @ 40157609
Atom mdhd @ 20156584 of size: 32, ends @ 20156616
Atom hdlr @ 20156616 of size: 45, ends @ 20156661
Atom minf @ 20156661 of size: 20000948, ends @ 40157609
Atom smhd @ 20156669 of size: 16, ends @ 20156685
Atom dinf @ 20156685 of size: 36, ends @ 20156721
Atom dref @ 20156693 of size: 28, ends @ 20156721
Atom stbl @ 20156721 of size: 20000888, ends @ 40157609
Atom stsd @ 20156729 of size: 96, ends @ 20156825
Atom mp4a @ 20156745 of size: 80, ends @ 20156825
Atom esds @ 20156781 of size: 44, ends @ 20156825
Atom stts @ 20156825 of size: 9348168, ends @ 29504993
Atom stsc @ 29504993 of size: 28, ends @ 29505021
Atom stsz @ 29505021 of size: 5326296, ends @ 34831317
Atom stco @ 34831317 of size: 5326292, ends @ 40157609
Atom udta @ 40157609 of size: 96, ends @ 40157705
Atom meta @ 40157617 of size: 88, ends @ 40157705
Atom hdlr @ 40157629 of size: 33, ends @ 40157662
Atom ilst @ 40157662 of size: 43, ends @ 40157705
Atom ©too @ 40157670 of size: 35, ends @ 40157705
Atom data @ 40157678 of size: 27, ends @ 40157705
Atom free @ 40157705 of size: 8, ends @ 40157713
Atom mdat @ 40157713 of size: 1320096566, ends @ 1360254279 -
Read id3 tag from ffmpeg-converted mp3 files
14 octobre 2012, par payalI have the below script for reading the
id3
tag for mp3 files. I have checked manually thatid3
tags are there in mp3 files but my output always returns for a few files :
MP3 file does not have any ID3 tag!
I am converting these files from ffmpeg. When I run the below code for original files, it shows the
id3
tags, but when I run the script for converted files (by ffmpeg), it is not showing anyid3
tags . I have downloaded both original and converted files and checked them and found that both files have exactly the same tags but the below code gives the error message anyway.Here is the code :
<?php
$mp3 = "4.mp3"; //The mp3 file.
$filesize = filesize($mp3);
$file = fopen("4.mp3", "r");
fseek($file, -128, SEEK_END); // It reads the
$tag = fread($file, 3);
if($tag == "TAG")
{
$data["title"] = trim(fread($file, 30));
$data["artist"] = trim(fread($file, 30));
$data["album"] = trim(fread($file, 30));
$data["year"] = trim(fread($file, 4));
$data["genre"] = trim(fread($file, 1));
}
else
die("MP3 file does not have any ID3 tag!");
fclose($file);
while(list($key, $value) = each($data))
{
print("$key: $value<br />\r\n");
}
?> -
java.lang.ExceptionInInitializerError in FFmpeg Test
22 janvier 2013, par Mehul RanparaI have a demo called FFMpegTest of Android which i downloaded from here..https://github.com/appunite/AndroidFFmpeg..and i also have Library file of FFMpeg which is in this demo and i am using this Library in FFmpegTest..Now when i running..it gives java.lang.ExceptionInInitializerError.. Anyone have an idea about this..please share with me..Thanx in Advance..
which is in...VideoActivity.java
public class VideoActivity extends Activity implements OnClickListener,FFmpegListener, OnSeekBarChangeListener, OnItemSelectedListener
{
private FFmpegPlayer mpegPlayer;
private static boolean isSurfaceView = true;
protected boolean mPlay = false;
private View controlsView;
private View loadingView;
private SeekBar seekBar;
public View videoView;
private Button playPauseButton;
private boolean mTracking = false;
private View streamsView;
private Spinner languageSpinner;
private int languageSpinnerSelectedPosition = 0;
private Spinner subtitleSpinner;
private int subtitleSpinnerSelectedPosition = 0;
private StreamAdapter languageAdapter;
private StreamAdapter subtitleAdapter;
private FFmpegStreamInfo audioStream = null;
private FFmpegStreamInfo subtitleStream = null;
@Override
public void onCreate(Bundle savedInstanceState)
{
this.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getWindow().setFormat(PixelFormat.RGB_565);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DITHER);
super.onCreate(savedInstanceState);
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
this.getWindow().setBackgroundDrawable(null);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
if (isSurfaceView)
VideoActivity.this.setContentView(R.layout.video_surfaceview);
else
VideoActivity.this.setContentView(R.layout.video_view);
seekBar = (SeekBar) this.findViewById(R.id.seek_bar);
seekBar.setOnSeekBarChangeListener(this);
playPauseButton = (Button) this.findViewById(R.id.play_pause);
playPauseButton.setOnClickListener(this);
controlsView = this.findViewById(R.id.controls);
streamsView = this.findViewById(R.id.streams);
loadingView = this.findViewById(R.id.loading_view);
languageSpinner = (Spinner) this.findViewById(R.id.language_spinner);
subtitleSpinner = (Spinner) this.findViewById(R.id.subtitle_spinner);
languageAdapter = new StreamAdapter(this,android.R.layout.simple_spinner_item,new ArrayList<ffmpegstreaminfo>(), StreamAdapterType.AUDIO);
languageAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
languageSpinner.setAdapter(languageAdapter);
languageSpinner.setOnItemSelectedListener(this);
subtitleAdapter = new StreamAdapter(this,android.R.layout.simple_spinner_item,new ArrayList<ffmpegstreaminfo>(), StreamAdapterType.SUBTITLE);
subtitleAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
subtitleSpinner.setAdapter(subtitleAdapter);
subtitleSpinner.setOnItemSelectedListener(this);
try
{
videoView = this.findViewById(R.id.video_view);
//VideoActivity.this.mpegPlayer = new FFmpegPlayer((FFmpegDisplay)videoView, VideoActivity.this);
this.mpegPlayer = new FFmpegPlayer((FFmpegDisplay)videoView, this);
this.mpegPlayer.setMpegListener(this);
setDataSource();
//Too
}
catch (Exception e)
{
e.printStackTrace();
}
}
private static enum StreamAdapterType
{
AUDIO, SUBTITLE
};
private static class StreamAdapter extends ArrayAdapter<ffmpegstreaminfo>
{
private final StreamAdapterType adapterType;
public StreamAdapter(Context context, int textViewResourceId,List<ffmpegstreaminfo> objects, StreamAdapterType adapterType)
{
super(context, textViewResourceId, objects);
this.adapterType = adapterType;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
TextView view = (TextView) super.getView(position, convertView, parent);
FFmpegStreamInfo item = getItem(position);
Locale locale = item.getLanguage();
String formatter;
if (StreamAdapterType.AUDIO.equals(adapterType))
{
formatter = getContext().getString(R.string.language_spinner_drop_down);
}
else
{
formatter = getContext().getString(R.string.subtitle_spinner_drop_down);
}
String languageName = locale == null ? getContext().getString(R.string.unknown) : locale.getDisplayLanguage();
String text = String.format(formatter, languageName);
view.setText(text);
return view;
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent)
{
CheckedTextView view = (CheckedTextView) super.getDropDownView(position, convertView, parent);
FFmpegStreamInfo item = getItem(position);
Locale locale = item.getLanguage();
String languageName = locale == null ? getContext().getString(R.string.unknown) : locale.getDisplayLanguage();
view.setText(languageName);
return view;
}
}
@Override
protected void onPause() {
super.onPause();
};
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onDestroy()
{
super.onDestroy();
this.mpegPlayer.setMpegListener(null);
this.mpegPlayer.stop();
stop();
}
private void setDataSource()
{
Log.d("url", "checin");
HashMap params = new HashMap();
// set font for ass
File assFont = new File(Environment.getExternalStorageDirectory(),"Roboto.ttf");
params.put("ass_default_font_path", assFont.getAbsolutePath());
Intent intent = getIntent();
String url = intent.getStringExtra(AppConstants.VIDEO_PLAY_ACTION_EXTRA_URL);
Log.d("url", url);
if (url == null)
{
throw new IllegalArgumentException(String.format("\"%s\" did not provided", AppConstants.VIDEO_PLAY_ACTION_EXTRA_URL));
}
if (intent.hasExtra(AppConstants.VIDEO_PLAY_ACTION_EXTRA_ENCRYPTION_KEY))
{
params.put("aeskey", intent.getStringExtra(AppConstants.VIDEO_PLAY_ACTION_EXTRA_ENCRYPTION_KEY));
}
this.playPauseButton.setBackgroundResource(android.R.drawable.ic_media_play);
this.playPauseButton.setEnabled(true);
mPlay = false;
mpegPlayer.setDataSource(url, params, null, audioStream,subtitleStream);
}
@Override
public void onClick(View v)
{
int viewId = v.getId();
switch (viewId)
{
case R.id.play_pause:
resumePause();
return;
default:
throw new RuntimeException();
}
}
@Override
public void onFFUpdateTime(int currentTimeS, int videoDurationS, boolean isFinished)
{
if (!mTracking)
{
seekBar.setMax(videoDurationS);
seekBar.setProgress(currentTimeS);
}
if (isFinished)
{
new AlertDialog.Builder(this)
.setTitle(R.string.dialog_end_of_video_title)
.setMessage(R.string.dialog_end_of_video_message)
.setCancelable(true).show();
}
}
@Override
public void onFFDataSourceLoaded(FFmpegError err, FFmpegStreamInfo[] streams)
{
if (err != null) {
String format = getResources().getString(
R.string.main_could_not_open_stream);
String message = String.format(format, err.getMessage());
Builder builder = new AlertDialog.Builder(VideoActivity.this);
builder.setTitle(R.string.app_name)
.setMessage(message)
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
VideoActivity.this.finish();
}
}).show();
return;
}
playPauseButton.setBackgroundResource(android.R.drawable.ic_media_play);
playPauseButton.setEnabled(true);
this.controlsView.setVisibility(View.VISIBLE);
this.streamsView.setVisibility(View.VISIBLE);
this.loadingView.setVisibility(View.GONE);
this.videoView.setVisibility(View.VISIBLE);
languageAdapter.clear();
subtitleAdapter.clear();
for (FFmpegStreamInfo streamInfo : streams) {
CodecType mediaType = streamInfo.getMediaType();
if (FFmpegStreamInfo.CodecType.AUDIO.equals(mediaType)) {
languageAdapter.add(streamInfo);
} else if (FFmpegStreamInfo.CodecType.SUBTITLE.equals(mediaType)) {
subtitleAdapter.add(streamInfo);
}
}
}
private void displaySystemMenu(boolean visible) {
if (Build.VERSION.SDK_INT >= 14) {
displaySystemMenu14(visible);
} else if (Build.VERSION.SDK_INT >= 11) {
displaySystemMenu11(visible);
}
}
@SuppressWarnings("deprecation")
@TargetApi(11)
private void displaySystemMenu11(boolean visible) {
if (visible) {
this.videoView.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
} else {
this.videoView.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
}
}
@TargetApi(14)
private void displaySystemMenu14(boolean visible) {
if (visible) {
this.videoView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
} else {
this.videoView
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
}
public void resumePause() {
this.playPauseButton.setEnabled(false);
if (mPlay) {
mpegPlayer.pause();
} else {
mpegPlayer.resume();
displaySystemMenu(true);
}
mPlay = !mPlay;
}
@Override
public void onFFResume(NotPlayingException result) {
this.playPauseButton
.setBackgroundResource(android.R.drawable.ic_media_pause);
this.playPauseButton.setEnabled(true);
displaySystemMenu(false);
mPlay = true;
}
@Override
public void onFFPause(NotPlayingException err) {
this.playPauseButton
.setBackgroundResource(android.R.drawable.ic_media_play);
this.playPauseButton.setEnabled(true);
mPlay = false;
}
private void stop() {
this.controlsView.setVisibility(View.GONE);
this.streamsView.setVisibility(View.GONE);
this.loadingView.setVisibility(View.VISIBLE);
this.videoView.setVisibility(View.INVISIBLE);
}
@Override
public void onFFStop() {
}
@Override
public void onFFSeeked(NotPlayingException result)
{
// if (result != null)
// throw new RuntimeException(result);
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser)
{
if (fromUser)
{
mpegPlayer.seek(progress);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
mTracking = true;
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
mTracking = false;
}
private void setDataSourceAndResumeState() {
int progress = seekBar.getProgress();
setDataSource();
mpegPlayer.seek(progress);
mpegPlayer.resume();
}
@Override
public void onItemSelected(AdapterView<?> parentView,
View selectedItemView, int position, long id) {
FFmpegStreamInfo streamInfo = (FFmpegStreamInfo) parentView
.getItemAtPosition(position);
if (parentView == languageSpinner) {
if (languageSpinnerSelectedPosition != position) {
languageSpinnerSelectedPosition = position;
audioStream = streamInfo;
setDataSourceAndResumeState();
}
} else if (parentView == subtitleSpinner) {
if (subtitleSpinnerSelectedPosition != position) {
subtitleSpinnerSelectedPosition = position;
subtitleStream = streamInfo;
setDataSourceAndResumeState();
}
} else {
throw new RuntimeException();
}
}
@Override
public void onNothingSelected(AdapterView<?> parentView) {
// if (parentView == languageSpinner) {
// audioStream = null;
// } else if (parentView == subtitleSpinner) {
// subtitleStream = null;
// } else {
// throw new RuntimeException();
// }
// play();
}
}
</ffmpegstreaminfo></ffmpegstreaminfo></ffmpegstreaminfo></ffmpegstreaminfo>and this is my logcat :-
01-22 15:29:15.302: E/AndroidRuntime(1560): FATAL EXCEPTION: main
01-22 15:29:15.302: E/AndroidRuntime(1560): java.lang.ExceptionInInitializerError
01-22 15:29:15.302: E/AndroidRuntime(1560): at java.lang.Class.newInstanceImpl(Native Method)
01-22 15:29:15.302: E/AndroidRuntime(1560): at java.lang.Class.newInstance(Class.java:1319)
01-22 15:29:15.302: E/AndroidRuntime(1560): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
01-22 15:29:15.302: E/AndroidRuntime(1560): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
01-22 15:29:15.302: E/AndroidRuntime(1560): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
01-22 15:29:15.302: E/AndroidRuntime(1560): at android.app.ActivityThread.access$600(ActivityThread.java:123)
01-22 15:29:15.302: E/AndroidRuntime(1560): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
01-22 15:29:15.302: E/AndroidRuntime(1560): at android.os.Handler.dispatchMessage(Handler.java:99)
01-22 15:29:15.302: E/AndroidRuntime(1560): at android.os.Looper.loop(Looper.java:137)
01-22 15:29:15.302: E/AndroidRuntime(1560): at android.app.ActivityThread.main(ActivityThread.java:4424)
01-22 15:29:15.302: E/AndroidRuntime(1560): at java.lang.reflect.Method.invokeNative(Native Method)
01-22 15:29:15.302: E/AndroidRuntime(1560): at java.lang.reflect.Method.invoke(Method.java:511)
01-22 15:29:15.302: E/AndroidRuntime(1560): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-22 15:29:15.302: E/AndroidRuntime(1560): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-22 15:29:15.302: E/AndroidRuntime(1560): at dalvik.system.NativeStart.main(Native Method)
01-22 15:29:15.302: E/AndroidRuntime(1560): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load ffmpeg: findLibrary returned null
01-22 15:29:15.302: E/AndroidRuntime(1560): at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-22 15:29:15.302: E/AndroidRuntime(1560): at java.lang.System.loadLibrary(System.java:535)
01-22 15:29:15.302: E/AndroidRuntime(1560): at roman10.ffmpegTest.VideoBrowser.<clinit>(VideoBrowser.java:37)
01-22 15:29:15.302: E/AndroidRuntime(1560): ... 15 more
</clinit>