
Recherche avancée
Médias (3)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (82)
-
Diogene : création de masques spécifiques de formulaires d’édition de contenus
26 octobre 2010, parDiogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
A quoi sert ce plugin
Création de masques de formulaires
Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...) -
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 (...) -
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...)
Sur d’autres sites (9155)
-
Running Windows XP In 2016
2 janvier 2016, par Multimedia MikeI have an interest in getting a 32-bit Windows XP machine up and running. I have a really good yet slightly dated and discarded computer that seemed like a good candidate for dedicating to this task. So the question is : Can Windows XP still be installed from scratch on a computer, activated, and used in 2016 ? I wasn’t quite sure since I have heard stories about how Microsoft has formally ended support for Windows XP as of the first half of 2014 and I wasn’t entirely sure what that meant.
Spoiler : It’s still possible to install and activate Windows XP as of the writing of this post. It’s also possible to download and install all the updates published up until support ended.
The Candidate Computer
This computer was assembled either in late 2008 or early 2009. It was a beast at the time.
Click for a larger image
It was built around the newly-released NVIDIA GTX 280 video card. The case is a Thermaltake DH-101, which is a home theater PC thing. The motherboard is an Asus P5N32-SLI Premium with a Core 2 Duo X6800 2.93 GHz CPU on board. 2 GB of RAM and a 1.5 TB hard drive are also present.
The original owner handed it off to me because their family didn’t have much use for it anymore (too many other machines in the house). Plus it was really, obnoxiously loud. The noisy culprit was the stock blue fan that came packaged with the Intel processor (seen in the photo) whining at around 65 dB. I replaced the fan and brought the noise level way down.
As for connectivity, the motherboard has dual gigabit NICs (of 2 different chipsets for some reason) and onboard wireless 802.11g. I couldn’t make the latter work and this project was taking place a significant distance from my wired network. Instead, I connected a USB 802.11ac dongle and antenna which is advertised to work in both Windows XP and Linux. It works great under Windows XP. Meanwhile, making the adapter work under Linux provided a retro-computing adventure in which I had to modify C code to make the driver work.
So, score 1 for Windows XP over Linux here.
The Simple Joy of Retro-computing
One thing you have to watch out for when you get into retro-computing is fighting the urge to rant about the good old days of computing. Most long-time computer users have a good understanding of the frustration that computers keep getting faster by orders of magnitude and yet using them somehow feels slower and slower over successive software generations.
This really hits home when you get old software running, especially on high-end hardware (relative to what was standard contemporary hardware). After I got this new Windows XP machine running, as usual, I was left wondering why software was so much faster a few generations ago.
Of course, as mentioned, it helps when you get to run old software on hardware that would have been unthinkably high end at the software’s release. Apparently, the minimum WinXP specs as set by MS are a 233 MHz Pentium CPU and 64 MB of RAM, with 1.5 GB of hard drive space. This machine has more than 10x the clock speed (and 2 CPUs), 32x the RAM, and 1000x the HD space. Further, I’m pretty sure 100 Mbit ethernet was the standard consumer gear in 2001 while 802.11b wireless was gaining traction. The 802.11ac adapter makes networking quite pleasant.
Purpose
Retro-computing really seems to be ramping up in popularity lately. For some reason, I feel compelled to declare at this juncture that I was into it before it was cool.Why am I doing this ? I have a huge collection of old DOS/Windows computer games. I also have this nerdy obsession with documenting old video games in the MobyGames database. I used to do a lot of this a few years ago, tracking the effort on my gaming blog. In the intervening years, I have still collected a lot of old, unused, unloved video games, usually either free or very cheap while documenting my collection efforts on that same blog.
So I want to work my way through some of this backlog, particularly the games that are not yet represented in the MobyGames database, and even more pressing, ones that the internet (viewed through Google at least) does not seem to know about. To that end, I thought this was a good excuse to get Windows XP on this old machine. A 32-bit Windows XP machine is capable of running any software advertised as supporting Windows XP, Windows ME, Windows 98, Windows 95, and even 16-bit Windows 3.x (I have games for all these systems). That covers a significant chunk of PC history. It can probably be made to run DOS games as well, but those are (usually) better run under DosBox. In order to get the right display feel, I even invested in a (used) monitor sporting a 4:3 aspect ratio. If I know these old games, most will be engineered and optimized for that ratio rather than the widescreen resolutions seen nowadays.
I would also like to get back to that Xbox optical disc experimentation I was working on a few years ago. Another nice feature of this motherboard is that it still provides a 40-pin IDE/PATA adapter which makes the machine useful for continuing that old investigation (and explains why I have that long IDE cable to no where pictured hanging off the board).
The Messy Details
I did the entire installation process twice. The first time was a bumbling journey of discovery and copious note-taking. I still have Windows XP installation media that includes service pack 2 (SP2), along with 2 separate licenses that haven’t been activated for a long time. My plan was to install it fresh, then install the relevant drivers. Then I would investigate the Windows update and activation issues and everything should be fine.So what’s the deal with Windows Update for XP, and with activations ? Second item first : it IS possible to still activate Windows XP. The servers are still alive and respond quickly. However, as always, you don’t activate until you’re sure everything is working at some baseline. It took awhile to get there.
As for whether Windows Update still works for XP, that’s a tougher question. Short answer is yes ; longer answer is that it can be difficult to kick off the update process. At least on SP2, the “Windows Update” program launches IE6 and navigates to a special microsoft.com URL which initiates the update process (starting with an ActiveX control). This URL no longer exists.
From what I can piece together from my notes, this seems to be the route I eventually took :
- Install Windows XP fresh
- Install drivers for the hardware ; fortunately, Asus still has all the latest drivers necessary for the motherboard and its components but it’s necessary to download these from another network-connected PC since the networking probably won’t be running “out of the box”
- Download the .NET 3.5 runtime, which is the last one supported by Windows XP, and install it
- Download the latest NVIDIA drivers ; this needs to be done after the previous step because the installer requires the .NET runtime ; run the driver installer and don’t try to understand why it insists on re-downloading .NET 3.5 runtime before installation
- While you’re downloading stuff on other computers to be transported to this new machine, be sure to download either Chrome or Firefox per your preference ; if you try to download via IE6, you may find that their download pages aren’t compatible with IE6
- Somewhere along the line (I’m guessing as a side effect of the .NET 3.5 installation), the proper, non-IE6-based Windows Update program magically springs to life ; once this happens, there will be 144 updates (in my case anyway) ; installing these will probably require multiple reboots, but SP3 and all known pre-deprecation security fixes will be installed
- Expect that, even after installing all of these, a few more updates will appear ; eventually, you’ll be at the end of the update road
- Once you’re satisfied everything is working satisfactorily, take the plunge and activate your installation
Residual Quirks
Steam runs great on Windows XP, as do numerous games I have purchased through the service. So that opens up a whole bunch more games that I could play on this machine. Steam’s installer highlights a curious legacy problem of Windows XP– it seems there are many languages that it does not support “out of the box” :
It looks like the Chinese options and a few others that are standard now weren’t standard 15 years ago.
Also, a little while after booting up, I’ll get a crashing error concerning a process called geoforms.scr. This appears to be NVIDIA-related. However, I don’t notice anything obviously operationally wrong with the system.
Regarding DirectX support, DirectX 9 is the highest version officially supported by Windows XP. There are allegedly methods to get DirectX 10 running as well, but I don’t care that much. I did care, briefly, when I realized that a bunch of the demos for the NVIDIA GTX 280 required DX10 which left me wondering why it was possible to install them on Windows XP.
Eventually, by installing enough of these old games, I fully expect to have numerous versions of .NET, DirectX, QT, and Video for Windows installed side by side.
Out of curiosity, I tried playing a YouTube HD/1080p video. I wanted to see if the video was accelerated through my card. The video played at full speed but I noticed some tearing. Then I inspected the CPU usage and noticed that the CPU was quite loaded. So either the GTX 280 doesn’t have video acceleration, or Windows XP doesn’t provide the right APIs, or Chrome is not able to access the APIs in Windows XP, or perhaps some combination of the foregoing.
Games are working well, though. I tried one of my favorite casual games and got sucked into that for, like, an entire night because that’s what casual games do. But then, I booted up a copy of WarCraft III that I procured sometime ago. I don’t have any experience with the WarCraft universe (RTS or MMO) but I developed a keen interest in StarCraft II over the past few years and wanted to try WarCraft III. Unfortunately, I couldn’t get WarCraft III to work correctly on several different Windows 7 installations (movies didn’t play, which left me slightly confused as to what I was supposed to do).
Still works beautifully on the new old Windows XP machine.
The post Running Windows XP In 2016 first appeared on Breaking Eggs And Making Omelettes.
-
VLC dead input for RTP stream
27 mars, par CaptainCheeseI'm working on creating an rtp stream that's meant to display live waveform data from Pioneer prolink players. The motivation for sending this video out is to be able to receive it in a flutter frontend. I initially was just sending a base-24 encoding of the raw ARGB packed ints per frame across a Kafka topic to it but processing this data in flutter proved to be untenable and was bogging down the main UI thread. Not sure if this is the most optimal way of going about this but just trying to get anything to work if it means some speedup on the frontend. So the issue the following implementation is experiencing is that when I run
vlc --rtsp-timeout=120000 --network-caching=30000 -vvvv stream_1.sdp
where

% cat stream_1.sdp
v=0
o=- 0 1 IN IP4 127.0.0.1
s=RTP Stream
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat
m=video 5007 RTP/AVP 96
a=rtpmap:96 H264/90000



I see (among other questionable logs) the following :


[0000000144c44d10] live555 demux error: no data received in 10s, aborting
[00000001430ee2f0] main input debug: EOF reached
[0000000144b160c0] main decoder debug: killing decoder fourcc `h264'
[0000000144b160c0] main decoder debug: removing module "videotoolbox"
[0000000144b164a0] main packetizer debug: removing module "h264"
[0000000144c44d10] main demux debug: removing module "live555"
[0000000144c45bb0] main stream debug: removing module "record"
[0000000144a64960] main stream debug: removing module "cache_read"
[0000000144c29c00] main stream debug: removing module "filesystem"
[00000001430ee2f0] main input debug: Program doesn't contain anymore ES
[0000000144806260] main playlist debug: dead input
[0000000144806260] main playlist debug: changing item without a request (current 0/1)
[0000000144806260] main playlist debug: nothing to play
[0000000142e083c0] macosx interface debug: Playback has been ended
[0000000142e083c0] macosx interface debug: Releasing IOKit system sleep blocker (37463)



This is sort of confusing because when I run
ffmpeg -protocol_whitelist file,crypto,data,rtp,udp -i stream_1.sdp -vcodec libx264 -f null -

I see a number logs about

[h264 @ 0x139304080] non-existing PPS 0 referenced
 Last message repeated 1 times
[h264 @ 0x139304080] decode_slice_header error
[h264 @ 0x139304080] no frame!



After which I see the stream is received and I start getting telemetry on it :


Input #0, sdp, from 'stream_1.sdp':
 Metadata:
 title : RTP Stream
 Duration: N/A, start: 0.016667, bitrate: N/A
 Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 1200x200, 60 fps, 60 tbr, 90k tbn
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x107f04f40] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x107f04f40] profile High, level 3.1, 4:2:0, 8-bit
Output #0, null, to 'pipe:':
 Metadata:
 title : RTP Stream
 encoder : Lavf61.7.100
 Stream #0:0: Video: h264, yuv420p(tv, progressive), 1200x200, q=2-31, 60 fps, 60 tbn
 Metadata:
 encoder : Lavc61.19.101 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
[out#0/null @ 0x60000069c000] video:144KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
frame= 1404 fps= 49 q=-1.0 Lsize=N/A time=00:00:23.88 bitrate=N/A speed=0.834x



Not sure why VLC is turning me down like some kind of Berghain bouncer that lets nobody in the entire night.


I initially tried just converting the ARGB ints to a YUV420p buffer and used this to create the Frame objects but I couldn't for the life of me figure out how to properly initialize it as the attempts I made kept spitting out garbled junk.


Please go easy on me, I've made an unhealthy habit of resolving nearly all of my coding questions by simply lurking the internet for answers but that's not really helping me solve this issue.


Here's the Java I'm working on (the meat of the rtp comms occurs within
updateWaveformForPlayer()
) :

package com.bugbytz.prolink;

import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.bytedeco.ffmpeg.global.avcodec;
import org.bytedeco.ffmpeg.global.avutil;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.FFmpegFrameRecorder;
import org.bytedeco.javacv.FFmpegLogCallback;
import org.bytedeco.javacv.Frame;
import org.bytedeco.javacv.FrameGrabber;
import org.deepsymmetry.beatlink.CdjStatus;
import org.deepsymmetry.beatlink.DeviceAnnouncement;
import org.deepsymmetry.beatlink.DeviceAnnouncementAdapter;
import org.deepsymmetry.beatlink.DeviceFinder;
import org.deepsymmetry.beatlink.Util;
import org.deepsymmetry.beatlink.VirtualCdj;
import org.deepsymmetry.beatlink.data.BeatGridFinder;
import org.deepsymmetry.beatlink.data.CrateDigger;
import org.deepsymmetry.beatlink.data.MetadataFinder;
import org.deepsymmetry.beatlink.data.TimeFinder;
import org.deepsymmetry.beatlink.data.WaveformDetail;
import org.deepsymmetry.beatlink.data.WaveformDetailComponent;
import org.deepsymmetry.beatlink.data.WaveformFinder;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.nio.ByteBuffer;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

import static org.bytedeco.ffmpeg.global.avutil.AV_PIX_FMT_RGB24;

public class App {
 public static ArrayList<track> tracks = new ArrayList<>();
 public static boolean dbRead = false;
 public static Properties props = new Properties();
 private static Map recorders = new HashMap<>();
 private static Map frameCount = new HashMap<>();

 private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
 private static final int FPS = 60;
 private static final int FRAME_INTERVAL_MS = 1000 / FPS;

 private static Map schedules = new HashMap<>();

 private static Set<integer> streamingPlayers = new HashSet<>();

 public static String byteArrayToMacString(byte[] macBytes) {
 StringBuilder sb = new StringBuilder();
 for (int i = 0; i < macBytes.length; i++) {
 sb.append(String.format("%02X%s", macBytes[i], (i < macBytes.length - 1) ? ":" : ""));
 }
 return sb.toString();
 }

 private static void updateWaveformForPlayer(int player) throws Exception {
 Integer frame_for_player = frameCount.get(player);
 if (frame_for_player == null) {
 frame_for_player = 0;
 frameCount.putIfAbsent(player, frame_for_player);
 }

 if (!WaveformFinder.getInstance().isRunning()) {
 WaveformFinder.getInstance().start();
 }
 WaveformDetail detail = WaveformFinder.getInstance().getLatestDetailFor(player);

 if (detail != null) {
 WaveformDetailComponent component = (WaveformDetailComponent) detail.createViewComponent(
 MetadataFinder.getInstance().getLatestMetadataFor(player),
 BeatGridFinder.getInstance().getLatestBeatGridFor(player)
 );
 component.setMonitoredPlayer(player);
 component.setPlaybackState(player, TimeFinder.getInstance().getTimeFor(player), true);
 component.setAutoScroll(true);
 int width = 1200;
 int height = 200;
 Dimension dimension = new Dimension(width, height);
 component.setPreferredSize(dimension);
 component.setSize(dimension);
 component.setScale(1);
 component.doLayout();

 // Create a fresh BufferedImage and clear it before rendering
 BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
 Graphics2D g = image.createGraphics();
 g.clearRect(0, 0, width, height); // Clear any old content

 // Draw waveform into the BufferedImage
 component.paint(g);
 g.dispose();

 int port = 5004 + player;
 String inputFile = port + "_" + frame_for_player + ".mp4";
 // Initialize the FFmpegFrameRecorder for YUV420P
 FFmpegFrameRecorder recorder_file = new FFmpegFrameRecorder(inputFile, width, height);
 FFmpegLogCallback.set(); // Enable FFmpeg logging for debugging
 recorder_file.setFormat("mp4");
 recorder_file.setVideoCodec(avcodec.AV_CODEC_ID_H264);
 recorder_file.setPixelFormat(avutil.AV_PIX_FMT_YUV420P); // Use YUV420P format directly
 recorder_file.setFrameRate(FPS);

 // Set video options
 recorder_file.setVideoOption("preset", "ultrafast");
 recorder_file.setVideoOption("tune", "zerolatency");
 recorder_file.setVideoOption("x264-params", "repeat-headers=1");
 recorder_file.setGopSize(FPS);
 try {
 recorder_file.start(); // Ensure this is called before recording any frames
 System.out.println("Recorder started successfully for player: " + player);
 } catch (org.bytedeco.javacv.FFmpegFrameRecorder.Exception e) {
 e.printStackTrace();
 }

 // Get all pixels in one call
 int[] pixels = new int[width * height];
 image.getRGB(0, 0, width, height, pixels, 0, width);
 recorder_file.recordImage(width,height,Frame.DEPTH_UBYTE,1,3 * width, AV_PIX_FMT_RGB24, ByteBuffer.wrap(argbToByteArray(pixels, width, height)));
 recorder_file.stop();
 recorder_file.release();
 final FFmpegFrameRecorder recorder = recorders.get(player);
 FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(inputFile);


 try {
 grabber.start();
 } catch (Exception e) {
 e.printStackTrace();
 }
 if (recorder == null) {
 try {
 String outputStream = "rtp://127.0.0.1:" + port;
 FFmpegFrameRecorder initial_recorder = new FFmpegFrameRecorder(outputStream, grabber.getImageWidth(), grabber.getImageHeight());
 initial_recorder.setFormat("rtp");
 initial_recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
 initial_recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P);
 initial_recorder.setFrameRate(grabber.getFrameRate());
 initial_recorder.setGopSize(FPS);
 initial_recorder.setVideoOption("x264-params", "keyint=60");
 initial_recorder.setVideoOption("rtsp_transport", "tcp");
 initial_recorder.start();
 recorders.putIfAbsent(player, initial_recorder);
 frameCount.putIfAbsent(player, 0);
 putToRTP(player, grabber, initial_recorder);
 }
 catch (Exception e) {
 e.printStackTrace();
 }
 }
 else {
 putToRTP(player, grabber, recorder);
 }
 File file = new File(inputFile);
 if (file.exists() && file.delete()) {
 System.out.println("Successfully deleted file: " + inputFile);
 } else {
 System.out.println("Failed to delete file: " + inputFile);
 }
 }
 }

 public static void putToRTP(int player, FFmpegFrameGrabber grabber, FFmpegFrameRecorder recorder) throws FrameGrabber.Exception {
 final Frame frame = grabber.grabFrame();
 int frameCount_local = frameCount.get(player);
 frame.keyFrame = frameCount_local++ % FPS == 0;
 frameCount.put(player, frameCount_local);
 try {
 recorder.record(frame);
 } catch (FFmpegFrameRecorder.Exception e) {
 throw new RuntimeException(e);
 }
 }
 public static byte[] argbToByteArray(int[] argb, int width, int height) {
 int totalPixels = width * height;
 byte[] byteArray = new byte[totalPixels * 3]; // 4 bytes per pixel (ARGB)

 for (int i = 0; i < totalPixels; i++) {
 int argbPixel = argb[i];

 byteArray[i * 3] = (byte) ((argbPixel >> 16) & 0xFF); // Red
 byteArray[i * 3 + 1] = (byte) ((argbPixel >> 8) & 0xFF); // Green
 byteArray[i * 3 + 2] = (byte) (argbPixel & 0xFF); // Blue
 }

 return byteArray;
 }


 public static void main(String[] args) throws Exception {
 VirtualCdj.getInstance().setDeviceNumber((byte) 4);
 CrateDigger.getInstance().addDatabaseListener(new DBService());
 props.put("bootstrap.servers", "localhost:9092");
 props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
 props.put("value.serializer", "com.bugbytz.prolink.CustomSerializer");
 props.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG, "20971520");

 VirtualCdj.getInstance().addUpdateListener(update -> {
 if (update instanceof CdjStatus) {
 try (Producer producer = new KafkaProducer<>(props)) {
 DecimalFormat df_obj = new DecimalFormat("#.##");
 DeviceStatus deviceStatus = new DeviceStatus(
 update.getDeviceNumber(),
 ((CdjStatus) update).isPlaying() || !((CdjStatus) update).isPaused(),
 ((CdjStatus) update).getBeatNumber(),
 update.getBeatWithinBar(),
 Double.parseDouble(df_obj.format(update.getEffectiveTempo())),
 Double.parseDouble(df_obj.format(Util.pitchToPercentage(update.getPitch()))),
 update.getAddress().getHostAddress(),
 byteArrayToMacString(DeviceFinder.getInstance().getLatestAnnouncementFrom(update.getDeviceNumber()).getHardwareAddress()),
 ((CdjStatus) update).getRekordboxId(),
 update.getDeviceName()
 );
 ProducerRecord record = new ProducerRecord<>("device-status", "device-" + update.getDeviceNumber(), deviceStatus);
 try {
 producer.send(record).get();
 } catch (InterruptedException ex) {
 throw new RuntimeException(ex);
 } catch (ExecutionException ex) {
 throw new RuntimeException(ex);
 }
 producer.flush();
 if (!WaveformFinder.getInstance().isRunning()) {
 try {
 WaveformFinder.getInstance().start();
 } catch (Exception ex) {
 throw new RuntimeException(ex);
 }
 }
 }
 }
 });
 DeviceFinder.getInstance().addDeviceAnnouncementListener(new DeviceAnnouncementAdapter() {
 @Override
 public void deviceFound(DeviceAnnouncement announcement) {
 if (!streamingPlayers.contains(announcement.getDeviceNumber())) {
 streamingPlayers.add(announcement.getDeviceNumber());
 schedules.putIfAbsent(announcement.getDeviceNumber(), scheduler.scheduleAtFixedRate(() -> {
 try {
 Runnable task = () -> {
 try {
 updateWaveformForPlayer(announcement.getDeviceNumber());
 } catch (InterruptedException e) {
 System.out.println("Thread interrupted");
 } catch (Exception e) {
 throw new RuntimeException(e);
 }
 System.out.println("Lambda thread work completed!");
 };
 task.run();
 } catch (Exception e) {
 e.printStackTrace();
 }
 }, 0, FRAME_INTERVAL_MS, TimeUnit.MILLISECONDS));
 }
 }

 @Override
 public void deviceLost(DeviceAnnouncement announcement) {
 if (streamingPlayers.contains(announcement.getDeviceNumber())) {
 schedules.get(announcement.getDeviceNumber()).cancel(true);
 streamingPlayers.remove(announcement.getDeviceNumber());
 }
 }
 });
 BeatGridFinder.getInstance().start();
 MetadataFinder.getInstance().start();
 VirtualCdj.getInstance().start();
 TimeFinder.getInstance().start();
 DeviceFinder.getInstance().start();
 CrateDigger.getInstance().start();

 try {
 LoadCommandConsumer consumer = new LoadCommandConsumer("localhost:9092", "load-command-group");
 Thread consumerThread = new Thread(consumer::startConsuming);
 consumerThread.start();

 Runtime.getRuntime().addShutdownHook(new Thread(() -> {
 consumer.shutdown();
 try {
 consumerThread.join();
 } catch (InterruptedException e) {
 Thread.currentThread().interrupt();
 }
 }));
 Thread.sleep(60000);
 } catch (InterruptedException e) {
 System.out.println("Interrupted, exiting.");
 }
 }
}
</integer></track>


-
Capture camera + mic and encode to h264/aac on macOS
16 décembre 2018, par Flock DawsonI’m having trouble capturing and encoding audio+video on-the-fly on macOS.
I tried two options :
-
ffmpeg
ffmpeg -threads 0 -f avfoundation -s 1920x1080 -framerate 25 -I 0:0 -async 441 -c:v libx264 -preset medium -pix_fmt yuv420p -crf 22 -c:a libfdk_aac -aq 95 -y
-
gstreamer
gst-launch-1.0 -ve avfvideosrc device-index=0 ! video/x-raw,width=1920,height=1080,framerate=25/1 ! vtenc_h264 ! queue ! mp4mux name=mux ! filesink location=out.mp4 osxaudiosrc device=0 ! audio/x-raw ! faac midside=false ! queue ! mux.
The ffmpeg option works, but only for lower resolutions. With higher resolutions, the Mac mini (2018 gen) can’t do the heavy lifting. I think because I installed ffmpeg with brew, so it wasn’t compiled on my machine, meaning it doesn’t use the h264 hardware encoder in the Mac ?
The gstreamer option works as well, but there’s a slight audio/video sync issue (audio is 100ms ahead of the video). I can’t seem to add delay to the GStreamer queue (it ignores it) :
queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 min-threshold-time=100000000
Anyone who has any experience with this ? Thanks !
-