
Recherche avancée
Autres articles (106)
-
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Changer son thème graphique
22 février 2011, parLe thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
Modifier le thème graphique utilisé
Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
Il suffit ensuite de se rendre dans l’espace de configuration du (...)
Sur d’autres sites (8854)
-
Sound in videos is full of static
13 avril 2015, par banshee_walk_slyI’m trying to play sound from an
FFMpegFrameGrabber
by getting theFrame
and sending the audio samples to aSourceDataLine
. Here’s what I have so far :Creating the
SourceDataLine
:int channels = _grabber.getAudioChannels();
int format = _grabber.getSampleFormat();
AudioFormat fmt = new AudioFormat(_grabber.getSampleRate(), format, channels, true, true);
_sourceDataLine=(SourceDataLine)AudioSystem.getLine(new DataLine.Info(SourceDataLine.class, fmt));
_sourceDataLine.open(fmt);
_sourceDataLine.start();Attempting to play sound (images are handled in the else block) :
org.bytedeco.javacv.Frame f = _grabber.grabFrame();
if (f.samples != null && f.samples.length > 0)
{
byte[] bytes = new byte[4096];
for (Buffer buffer : f.samples)
{
FloatBuffer floatBuffer = (FloatBuffer) buffer;
ByteBuffer byteBuffer = ByteBuffer.allocate(floatBuffer.capacity() * 4);
byteBuffer.asFloatBuffer().put(floatBuffer);
byteBuffer.rewind();
byteBuffer.get(bytes);
_sourceDataLine.write(bytes, 0, bytes.length);
}
}(Note : I tried a few different versions of this and they all have static. The versions I tried included combining the buffers into one large buffer, only trying to play one sample instead of each channel, and changing the audio format to many different permutations.)
The problem is the sound is full of static, and almost completely unintelligible. This is my first time doing any audio programming, so I’m sure I’m doing something completely ridiculous.
I appreciate any help. Thank you.
EDIT
In response to Radiodef, I tried a number of AudioFormats, and I couldn’t find one that worked for PCM_FLOAT. I found an example that used this :
fmt = new AudioFormat(AudioFormat.Encoding.PCM_FLOAT, _grabber.getSampleRate(), format, channels, channels, _grabber.getSampleRate(), true);
Note : I tried a few different values for the framesize from examples :
channels * format / 8
,channels * 8
with a hardcoded samplerate of 64,channels * 4
with a hardcoded samplerate of 32, and any combinations of thoseBut it give me this exception :
java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_FLOAT 44100.0 Hz, 8 bit, stereo, 2 bytes/frame, is supported.
at javax.sound.sampled.AudioSystem.getLine(Unknown Source)
at com.enplug.player.video.Video.<init>(Video.java:52) <- where I get the SourceDataLine
...
</init>EDIT 2
Sorry for the delay. I appreciate all the help Radiodef.
Here is some output from the FFMpegGrabber that is automatically output.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Shawn\AppData\Roaming\Enplug Display\Download\Resource\c7cb496d-96ea-4be8-a238-5ffd50955a3e.mp4':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2014-10-02 07:14:38
Duration: 00:00:31.13, start: 0.000000, bitrate: 2412 kb/s
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 246 kb/s (default)
Metadata:
creation_time : 2014-10-02 07:14:38
handler_name : Core Media Data Handler
Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2157 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
Metadata:
creation_time : 2014-10-02 07:14:38
handler_name : Core Media Data Handler
encoder : H.264I have two videos I’m testing with, and the first one (which is the one in the example above) has the following :
Bit rate: 247 kbps
Channels: 2 (stereo)
Audio sample rate: 44 kHzAnd the second is :
Bit rate: 161 kbps
Channels: 2 (stereo)
Audio sample rate: 48 kHzThey’re both mp4s, and I can provide any details about the video itself if needed.
As for the library, yeah I’m pretty locked into JavaCV. We already have videos running without sound, but we’re now trying to add sound to our program.
When I run the sample program from your JSR link I get :
PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian
PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian
PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian
PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian
PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian
PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian
PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian
PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian -
FFmpeg tile crop paging when full
19 janvier 2021, par JimmyI've been trying to tile images from a video into a 10x10 image,it works but when the image is filled 10x10 it won't create another image and fill, it just stopped,


This is what I ended up with :
ffmpeg -i video.mp4 -frames 1 -vf "select=not(mod(n,10)),scale=80:45,tile=10x10" out%03d.png


What I wanted :


- 

- a tile with 10x10
- when the image is filled, create another image and fill and so on, the outcome will be out1.png, out2.png... until it's done






-
call ffmepg from apache php without full path
14 février 2015, par ffmpeg fanI need a apache /php to recognize ffmpeg command without specifing the full bath of /usr/local/bin/ffmpeg
calling ffmpeg from command line executes the program
calling ffmpeg from php via web does not execute the program
calling /usr/local/bin/ffmpeg from php via web does execute the programwhy :
a php script calls youtube-dl (a compiled program) and executes ffmpeg internallythank you in advance -
tried ffmpeg path :
which ffmpeg
/usr/local/bin/ffmpegecho $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
#php code for testing:
$output = shell_exec('/usr/local/bin/ffmpeg 2>&1');
echo "shell exec /usr/local/bin/ffmpeg <pre>$output</pre>";
#Response:
ffmpeg version 2.5.3 Copyright #(good)
#Second php code for testing:
$output = shell_exec('ffmpeg 2>&1');
echo "shell exec <pre>$output</pre>";
#Response:
sh: ffmpeg: command not found #(bad)