
Recherche avancée
Médias (1)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
Autres articles (49)
-
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 (...) -
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 (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
Sur d’autres sites (8096)
-
Cannot get mp4 video to play in JavaFX app
23 juin 2016, par CelestialCoyoteI am trying to use the media player in Java FX to play an mp4 video. I am using the example code from the Oracle. Here is the link.
http://docs.oracle.com/javafx/2/media/simpleplayer.htm
I am using the same code with the exception that I want to play the video from my computer rather than going to the internet to get it. I also changed the size of the window to match the size of my video. The video was rendered using FFMPEG with the following parameters.
ffmpeg -y -r 30 -i ’CellCellCell_Trailer_%05d.jpg’ -r 30 -pix_fmt yuv420p -s 512x512 -vcodec libx264 ’CellCellCell.mp4’
Could not attach the video to post.
The video plays in Quicktime and VLC without problems. In the Java App it appears to load, but does not start playing. If I move the time slider, it throws an error, otherwise it just sits there and nothing happens. The file is in a folder called ’media’.
I have tried several mp4 videos, all with the same results. The player opens, but then does nothing. Any help would be appreciated.
Here is the code for MediaControl.java file. It is unmodified from the Oracle example.
package embeddedmediaplayer;
import javafx.application.Platform;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Slider;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaPlayer.Status;
import javafx.scene.media.MediaView;
import javafx.util.Duration;
public class MediaControl extends BorderPane {
private MediaPlayer mp;
private MediaView mediaView;
private final boolean repeat = false;
private boolean stopRequested = false;
private boolean atEndOfMedia = false;
private Duration duration;
private Slider timeSlider;
private Label playTime;
private Slider volumeSlider;
private HBox mediaBar;
public MediaControl(final MediaPlayer mp) {
this.mp = mp;
setStyle("-fx-background-color: #bfc2c7;");
mediaView = new MediaView(mp);
Pane mvPane = new Pane() {
};
mvPane.getChildren().add(mediaView);
mvPane.setStyle("-fx-background-color: black;");
setCenter(mvPane);
mediaBar = new HBox();
mediaBar.setAlignment(Pos.CENTER);
mediaBar.setPadding(new Insets(5, 10, 5, 10));
BorderPane.setAlignment(mediaBar, Pos.CENTER);
final Button playButton = new Button(">");
playButton.setOnAction(new EventHandler<actionevent>() {
public void handle(ActionEvent e) {
Status status = mp.getStatus();
if (status == Status.UNKNOWN || status == Status.HALTED) {
// don't do anything in these states
return;
}
if (status == Status.PAUSED
|| status == Status.READY
|| status == Status.STOPPED) {
// rewind the movie if we're sitting at the end
if (atEndOfMedia) {
mp.seek(mp.getStartTime());
atEndOfMedia = false;
}
mp.play();
} else {
mp.pause();
}
}
});
mp.currentTimeProperty().addListener(new InvalidationListener() {
public void invalidated(Observable ov) {
updateValues();
}
});
mp.setOnPlaying(new Runnable() {
public void run() {
if (stopRequested) {
mp.pause();
stopRequested = false;
} else {
playButton.setText("||");
}
}
});
mp.setOnPaused(new Runnable() {
public void run() {
System.out.println("onPaused");
playButton.setText(">");
}
});
mp.setOnReady(new Runnable() {
public void run() {
duration = mp.getMedia().getDuration();
updateValues();
}
});
mp.setCycleCount(repeat ? MediaPlayer.INDEFINITE : 1);
mp.setOnEndOfMedia(new Runnable() {
public void run() {
if (!repeat) {
playButton.setText(">");
stopRequested = true;
atEndOfMedia = true;
}
}
});
mediaBar.getChildren().add(playButton);
// Add spacer
Label spacer = new Label(" ");
mediaBar.getChildren().add(spacer);
// Add Time label
Label timeLabel = new Label("Time: ");
mediaBar.getChildren().add(timeLabel);
// Add time slider
timeSlider = new Slider();
HBox.setHgrow(timeSlider, Priority.ALWAYS);
timeSlider.setMinWidth(50);
timeSlider.setMaxWidth(Double.MAX_VALUE);
timeSlider.valueProperty().addListener(new InvalidationListener() {
public void invalidated(Observable ov) {
if (timeSlider.isValueChanging()) {
// multiply duration by percentage calculated by slider position
mp.seek(duration.multiply(timeSlider.getValue() / 100.0));
}
}
});
mediaBar.getChildren().add(timeSlider);
// Add Play label
playTime = new Label();
playTime.setPrefWidth(130);
playTime.setMinWidth(50);
mediaBar.getChildren().add(playTime);
// Add the volume label
Label volumeLabel = new Label("Vol: ");
mediaBar.getChildren().add(volumeLabel);
// Add Volume slider
volumeSlider = new Slider();
volumeSlider.setPrefWidth(70);
volumeSlider.setMaxWidth(Region.USE_PREF_SIZE);
volumeSlider.setMinWidth(30);
volumeSlider.valueProperty().addListener(new InvalidationListener() {
public void invalidated(Observable ov) {
if (volumeSlider.isValueChanging()) {
mp.setVolume(volumeSlider.getValue() / 100.0);
}
}
});
mediaBar.getChildren().add(volumeSlider);
setBottom(mediaBar);
}
protected void updateValues() {
if (playTime != null && timeSlider != null && volumeSlider != null) {
Platform.runLater(new Runnable() {
public void run() {
Duration currentTime = mp.getCurrentTime();
playTime.setText(formatTime(currentTime, duration));
timeSlider.setDisable(duration.isUnknown());
if (!timeSlider.isDisabled()
&& duration.greaterThan(Duration.ZERO)
&& !timeSlider.isValueChanging()) {
timeSlider.setValue(currentTime.divide(duration).toMillis()
* 100.0);
}
if (!volumeSlider.isValueChanging()) {
volumeSlider.setValue((int) Math.round(mp.getVolume()
* 100));
}
}
});
}
}
private static String formatTime(Duration elapsed, Duration duration) {
int intElapsed = (int) Math.floor(elapsed.toSeconds());
int elapsedHours = intElapsed / (60 * 60);
if (elapsedHours > 0) {
intElapsed -= elapsedHours * 60 * 60;
}
int elapsedMinutes = intElapsed / 60;
int elapsedSeconds = intElapsed - elapsedHours * 60 * 60
- elapsedMinutes * 60;
if (duration.greaterThan(Duration.ZERO)) {
int intDuration = (int) Math.floor(duration.toSeconds());
int durationHours = intDuration / (60 * 60);
if (durationHours > 0) {
intDuration -= durationHours * 60 * 60;
}
int durationMinutes = intDuration / 60;
int durationSeconds = intDuration - durationHours * 60 * 60
- durationMinutes * 60;
if (durationHours > 0) {
return String.format("%d:%02d:%02d/%d:%02d:%02d",
elapsedHours, elapsedMinutes, elapsedSeconds,
durationHours, durationMinutes, durationSeconds);
} else {
return String.format("%02d:%02d/%02d:%02d",
elapsedMinutes, elapsedSeconds, durationMinutes,
durationSeconds);
}
} else {
if (elapsedHours > 0) {
return String.format("%d:%02d:%02d", elapsedHours,
elapsedMinutes, elapsedSeconds);
} else {
return String.format("%02d:%02d", elapsedMinutes,
elapsedSeconds);
}
}
}
}
</actionevent>Here is the code for the EmbeddedMediaPlayer.java file. Only modifications are the file to be played and the size of the window.
package embeddedmediaplayer;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class EmbeddedMediaPlayer extends Application {
// private static final String MEDIA_URL =
// "http://download.oracle.com/otndocs/products/javafx/oow2010- 2.flv";
private static final String MEDIA_URL =
"file:./media/CellCellCell.mp4";
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Embedded Media Player");
Group root = new Group();
Scene scene = new Scene(root, 512, 512);
// create media player
Media media = new Media (MEDIA_URL);
MediaPlayer mediaPlayer = new MediaPlayer(media);
mediaPlayer.setAutoPlay(true);
MediaControl mediaControl = new MediaControl(mediaPlayer);
scene.setRoot(mediaControl);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
} -
How to crop and scale multiple landscape regions into a new portrait video ? FFmpeg
27 août 2023, par 3V1LXDI have an electron program that selects multiple regions of a landscape video and lets you rearrange them in a portrait canvas. I'm having trouble building the proper ffmpeg command to create the video. I have this somewhat working. I can export 2 layers, but i can't export if i only have 1 layer or if i have 3 or more layers selected.


2 regions of video selected


layers [
 { top: 0, left: 658, width: 576, height: 1080 },
 { top: 262, left: 0, width: 576, height: 324 }
]
newPositions [
 { top: 0, left: 0, width: 576, height: 1080 },
 { top: 0, left: 0, width: 576, height: 324 }
]
filtergraph [0]crop=576:1080:658:0,scale=576:1080[v0];[0]crop=576:324:0:262,scale=576:324[v1];[v0][v1]overlay=0:0:0:0[out]

No Error export successful



1 region selected


layers [ { top: 0, left: 650, width: 576, height: 1080 } ]
newPositions [ { top: 0, left: 0, width: 576, height: 1080 } ]
filtergraph [0]crop=576:1080:650:0,scale=576:1080[v0];[v0]overlay=0:0[out]

FFmpeg error: [fc#0 @ 000001dd3b6db0c0] Cannot find a matching stream for unlabeled input pad overlay
Error initializing complex filters: Invalid argument



3 regions of video selected


layers [
 { top: 0, left: 641, width: 576, height: 1080 },
 { top: 250, left: 0, width: 576, height: 324 },
 { top: 756, left: 0, width: 576, height: 324 }
]
newPositions [
 { top: 0, left: 0, width: 576, height: 1080 },
 { top: 0, left: 0, width: 576, height: 324 },
 { top: 756, left: 0, width: 576, height: 324 }
]
filtergraph [0]crop=576:1080:641:0,scale=576:1080[v0];[0]crop=576:324:0:250,scale=576:324[v1];[0]crop=576:324:0:756,scale=576:324[v2];[v0][v1][v2]overlay=0:0:0:0:0:756[out]

FFmpeg error: [AVFilterGraph @ 0000018faf2189c0] More input link labels specified for filter 'overlay' than it has inputs: 3 > 2
[AVFilterGraph @ 0000018faf2189c0] Error linking filters

FFmpeg error: Failed to set value '[0]crop=576:1080:698:0,scale=576:1080[v0];[0]crop=576:324:0:264,scale=576:324[v1];[0]crop=576:324:0:756,scale=576:324[v2];[v0][v1][v2]overlay=0:0:0:0:0:0[out]' for option 'filter_complex': Invalid argument
Error parsing global options: Invalid argument



I can't figure out how to construct the proper overlay command. Here is the js code i'm using from my electron app.


ipcMain.handle('export-video', async (_event, args) => {
 const { videoFile, outputName, layers, newPositions } = args;
 const ffmpegPath = path.join(__dirname, 'bin', 'ffmpeg');
 const outputDir = checkOutputDir();
 
 // use same video for each layer as input
 // crop, scale, and position each layer
 // overlay each layer on top of each other

 // export video
 console.log('layers', layers);
 console.log('newPositions', newPositions);

 let filtergraph = '';

 for (let i = 0; i < layers.length; i++) {
 const { top, left, width, height } = layers[i];
 const { width: newWidth, height: newHeight } = newPositions[i];
 const filter = `[0]crop=${width}:${height}:${left}:${top},scale=${newWidth}:${newHeight}[v${i}];`;
 filtergraph += filter;
 }

 for (let i = 0; i < layers.length; i++) {
 const filter = `[v${i}]`;
 filtergraph += filter;
 }

 filtergraph += `overlay=`;
 for (let i = 0; i < layers.length; i++) {
 const { top: newTop, left: newLeft } = newPositions[i];
 const overlay = `${newLeft}:${newTop}:`;
 filtergraph += overlay;
 }

 filtergraph = filtergraph.slice(0, -1); // remove last comma
 filtergraph += `[out]`;
 
 console.log('filtergraph', filtergraph);

 const ffmpeg = spawn(ffmpegPath, [
 '-i', videoFile,
 '-filter_complex', filtergraph,
 '-map', '[out]',
 '-c:v', 'libx264',
 '-preset', 'ultrafast',
 '-crf', '18',
 '-y',
 path.join(outputDir, `${outputName}`)
 ]); 

 ffmpeg.stdout.on('data', (data) => {
 console.log(`FFmpeg output: ${data}`);
 });

 ffmpeg.stderr.on('data', (data) => {
 console.error(`FFmpeg error: ${data}`);
 });

 ffmpeg.on('close', (code) => {
 console.log(`FFmpeg process exited with code ${code}`);
 // event.reply('ffmpeg-export-done'); // Notify the renderer process
 });
});



Any advice might be helpful, The docs are confusing, Thanks.


-
Thinking about switching to GeoIP2 for better location detection ? Here’s what you should know
5 juin 2018, par Matomo Core TeamIn Matomo 3.5.0 we added a new feature to improve the location detection (country, region, city) of your visitors. Especially when it comes to IPv6 addresses, you will see less “Unknown” locations and more accurate results in general. This feature is now enabled for all new installations but needs to be manually enabled for existing Matomo self-hosted users.
Why is the Matomo plugin not enabled for existing users ?
When you enable the GeoIP2 plugin, a database update will need to be executed on two datatable tables (“log_visit” and “log_conversion”) which stores some of the raw data. Please be aware that this update could take several hours depending on the size of your database.
If you store many visits in your database, it is recommended to execute the update through the command line by executing the command
./console core:update
to avoid the update from timing out. You may also have to put your Matomo into maintenance mode during this time and replay the missed traffic from logs afterwards as explained in the FAQ article.GeoIP2 may slow down your tracking
In the past we have seen that a few Matomo databases with high traffic volumes struggle to handle all the tracking requests after enabling GeoIP2. The reason for this is the location database now contains many more entries because it has to store all the IPv6 addresses and the database itself has a different format. Hence, the location lookup takes longer.
It is hard to say how much slower the location lookup gets, but we found GeoIP2-PHP is about 20 times slower than GeoIP1-PHP. On a fast CPU the lookup time for an IP with GeoIP2 takes about 1ms, but can also take much longer depending on the server.
Making location lookups fast again
There is a PHP extension available that makes lookups very fast, even faster than the old GeoIP1-PHP provider. If you can install additional PHP extensions on your server and have a high traffic website, you may want to install the GeoIP2 extension.
There is also an Nginx module and an Apache module. Unfortunately, we don’t have any performance metrics for these providers.
How do I activate the GeoIP2 location provider ?
As a Super User, log in to your Matomo and go to “Administration => Plugins”. There you can activate the “GeoIP2” plugin. As mentioned, this will trigger a database update which can take a while and you may want to perform this update through the command line.
Now you can go to “Administration => Geolocation”. Here you will first need to install the GeoIP2 databases at the bottom of the page before you can activate the GeoIP2-PHP provider. To activate any of the other GeoIP2 providers, you will need to install the required modules.
You will be able to check if the detection works on the right next to location provider. Once you selected one of the available providers, you’re all good to go.
The post Thinking about switching to GeoIP2 for better location detection ? Here’s what you should know appeared first on Analytics Platform - Matomo.