
Recherche avancée
Autres articles (83)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (14014)
-
ffmpeg creates an mp4 stream which results error in Firefox
23 janvier 2020, par DanielI’m about to play an fmp4 in HTML5 video element.
I was successfully created a websocket to pass ffmpeg’s output into MSE.
However when I try to open the page in Firefox (72.0.1, 64bit, under Ubuntu 18.04LTS), it always results an error :
Media resource blob:http://localhost/XXXX could not be decoded, error: Error Code: NS_ERROR_FAILURE (0x80004005)
Details: virtual mozilla::MediaResult mozilla::MP4ContainerParser::IsInitSegmentPresent(const mozilla::MediaSpan &): Invalid Top-Level Box:f"This is my FFMPEG’s line :
ffmpeg -r 5 -i rtsp://IPCAMERA -c:v copy -an -movflags +frag_keyframe+empty_moov+default_base_moof -f mp4 pipe:1
This is how the server side Java (with Tomcat engine) parses the output of this command (this might be inefficient but for now is ok) :
ProcessBuilder b = new ProcessBuilder(FFMPEGCOMMAND.split("\\s+"));
try {
p = b.start();
} catch (IOException e) {
e.printStackTrace();
}
InputStream input = p.getInputStream();
int bytes_read = 0;
byte buffer[] = new byte[512];
try {
while (0 < (bytes_read = input.read(buffer, 0, 512))) {
System.out.println("Bytes read:" + bytes_read);
this.session.getBasicRemote().sendBinary(ByteBuffer.wrap(buffer));
}
} catch (IOException e) {
e.printStackTrace();
}Then the client side is a websocket-MSE like in this repo.
Results :
-
When I debug the server side, and there is a breakpoint before the sendBinary call, and I wait for some seconds before letting run the server side, then a first picture is shown in the browser, but then immediately goes onto the error above.
-
If I run the server side (without any breakpoints), the browser does not show any picture, it immediately goes onto the error.
Invalid Top-Level box error message is always followed by (a) random garbage character(s).
The proof that this should be working is in the point 1. If I wait some time before letting roll the data to the client, it can decode 1 (or maybe more frames) before reaching that error.
This might be an error with my ffmpeg command-line.
However I could not really find any good resources on this topic (only found those ones which related to older releases of Firefox).
Update1
Here is the FFMPEG log when the same command creates an mp4 file instead of the pipe : https://pastebin.com/Gjq2vxeT
Here is the detailed Firefox log with the wrong box :
Details: virtual mozilla::MediaResult mozilla::MP4ContainerParser::IsInitSegmentPresent(const mozilla::MediaSpan &): Invalid Top-Level Box:f
Please note, Top-Level Box is always ’f’ when I’m doing the scenario marked in point 2 (running without breakpoints).
Update2 :
Here are the ffmpeg’s current output (with numeric and alphanumeric representation, for the first 128 items) : https://pastebin.com/DeJMfNYs
The interesting thing is that the first 4 bytes seems invalid for me. However starting from byte4 (5th byte), it seems OK ("ftyp").
Could you please confirm this ?
-
-
How to use YouTube-dl to stream from Bloomberg TV ?
1er janvier 2020, par Mr. Demetrius MichaelAny help would be appreciated !
This isn’t getting the correct stream from Bloomberg LiveTV, and I’m unsure why and how to fix.
$ youtube-dl https://www.bloomberg.com/live
Here’s a snippet of the errors that I get from that link :
[mp4 @ 0x7ffd13860c00] Invalid DTS: 9009 PTS: 3003 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 12012 PTS: 9009 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 21021 PTS: 15015 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 24024 PTS: 21021 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 33033 PTS: 27027 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 36036 PTS: 33033 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 45045 PTS: 39039 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 48048 PTS: 45045 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 57057 PTS: 51051 in output stream 0:0, replacing by guess
[mp4 @ 0x7ffd13860c00] Invalid DTS: 60060 PTS: 57057 in output stream 0:0, replacing by guess
[mpegts @ 0x7ffd14810000] Invalid timestamps stream=0, pts=963063, dts=969069, size=12512
[mpegts @ 0x7ffd14810000] Invalid timestamps stream=0, pts=969069, dts=972072, size=12513
[hls @ 0x7ffd14000400] Invalid timestamps stream=0, pts=963063, dts=969069, size=12512
[mp4 @ 0x7ffd13860c00] Invalid DTS: 69069 PTS: 63063 in output stream 0:0, replacing by guess
[hls @ 0x7ffd14000400] Invalid timestamps stream=0, pts=969069, dts=972072, size=12513
[mp4 @ 0x7ffd13860c00] Invalid DTS: 72072 PTS: 69069 in output stream 0:0, replacing by guess
[mpegts @ 0x7ffd14810000] Invalid timestamps stream=0, pts=975075, dts=981081, size=12512
[mpegts @ 0x7ffd14810000] Invalid timestamps stream=0, pts=981081, dts=984084, size=12513
[hls @ 0x7ffd14000400] Invalid timestamps stream=0, pts=975075, dts=981081, size=12512
[mp4 @ 0x7ffd13860c00] Invalid DTS: 81081 PTS: 75075 in output stream 0:0, replacing by guess
[hls @ 0x7ffd14000400] Invalid timestamps stream=0, pts=981081, dts=984084, size=12513
[mp4 @ 0x7ffd13860c00] Invalid DTS: 84084 PTS: 81081 in output stream 0:0, replacing by guess
[mpegts @ 0x7ffd14810000] Invalid timestamps stream=0, pts=987087, dts=993093, size=12512
[mpegts @ 0x7ffd14810000] Invalid timestamps stream=0, pts=993093, dts=996096, size=12513
[hls @ 0x7ffd14000400] Invalid timestamps stream=0, pts=987087, dts=993093, size=12512
[mp4 @ 0x7ffd13860c00] Invalid DTS: 93093 PTS: 87087 in output stream 0:0, replacing by guess
[hls @ 0x7ffd14000400] Invalid timestamps stream=0, pts=993093, dts=996096, size=12513
[mp4 @ 0x7ffd13860c00] Invalid DTS: 96096 PTS: 93093 in output stream 0:0, replacing by guess
[mpegts @ 0x7ffd14810000] Invalid timestamps stream=0, pts=999099, dts=1005105, size=12512
[mpegts @ 0x7ffd14810000] Invalid timestamps stream=0, pts=1005105, dts=1008108, size=12513
[hls @ 0x7ffd14000400] Invalid timestamps stream=0, pts=999099, dts=1005105, size=12512
[mp4 @ 0x7ffd13860c00] Invalid DTS: 105105 PTS: 99099 in output stream 0:0, replacing by guess
[hls @ 0x7ffd14000400] Invalid timestamps stream=0, pts=1005105, dts=1008108, size=12513Ideally I would be able to get all of their available programming :
https://www.bloomberg.com/live/us
https://www.bloomberg.com/live/us/btv
https://www.bloomberg.com/live/europe
https://www.bloomberg.com/live/asia
https://www.bloomberg.com/live/australia
https://www.bloomberg.com/live/stream
https://www.bloomberg.com/live/emea
https://www.bloomberg.com/live/asia_stream
https://www.bloomberg.com/live/politics -
Output file using FFmpeg in Xamarin Android
28 juillet 2022, par Ahmed MujtabaI'm building an android app using Xamarin. The requirement of the app is to capture video from the camera and encode the video to send it across to a server.



Initially, I was using an encoder library on the server-side to encode recorded video but it was proving to be extremely unreliable and inefficient especially for large-sized video files. I have posted my issues on another thread here



I then decided to encode the video on the client-side and then send it to the server. I've found encoding to be a bit complicated and there isn't much information available on how this can be done. So, I searched for the only way I knew how to encode a video that is by using FFmpeg codec. I've found some solutions. There's a project on GitHub that demonstrates how FFmpeg is used inside a Xamarin android project. However, running the solution doesn't give any output. The project has a binary FFmpeg file which is installed to the phone directory using the code below :



_ffmpegBin = InstallBinary(XamarinAndroidFFmpeg.Resource.Raw.ffmpeg, "ffmpeg", false);




Below is the example code for encoding video into a different set of outputs :



_workingDirectory = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
var sourceMp4 = "cat1.mp4";
var destinationPathAndFilename = System.IO.Path.Combine (_workingDirectory, "cat1_out.mp4");
var destinationPathAndFilename2 = System.IO.Path.Combine (_workingDirectory, "cat1_out2.mp4");
var destinationPathAndFilename4 = System.IO.Path.Combine (_workingDirectory, "cat1_out4.wav");
if (File.Exists (destinationPathAndFilename))
 File.Delete (destinationPathAndFilename);
CreateSampleFile(Resource.Raw.cat1, _workingDirectory, sourceMp4);


var ffmpeg = new FFMpeg (this, _workingDirectory);

var sourceClip = new Clip (System.IO.Path.Combine(_workingDirectory, sourceMp4));

var result = ffmpeg.GetInfo (sourceClip);

var br = System.Environment.NewLine;

// There are callbacks based on Standard Output and Standard Error when ffmpeg binary is running as a process:

var onComplete = new MyCommand ((_) => {
 RunOnUiThread(() =>_logView.Append("DONE!" + br + br));
});

var onMessage = new MyCommand ((message) => {
 RunOnUiThread(() =>_logView.Append(message + br + br));
});

var callbacks = new FFMpegCallbacks (onComplete, onMessage);

// 1. The idea of this first test is to show that video editing is possible via FFmpeg:
// It results in a 150x150 movie that eventually zooms on a cat ear. This is desaturated, and there's a fade-in.

var filters = new List<videofilter> ();
filters.Add (new FadeVideoFilter ("in", 0, 100));
filters.Add(new CropVideoFilter("150","150","0","0"));
filters.Add(new ColorVideoFilter(1.0m, 1.0m, 0.0m, 0.5m, 1.0m, 1.0m, 1.0m, 1.0m));
var outputClip = new Clip (destinationPathAndFilename) { videoFilter = VideoFilter.Build (filters) };
outputClip.H264_CRF = "18"; // It's the quality coefficient for H264 - Default is 28. I think 18 is pretty good.
ffmpeg.ProcessVideo(sourceClip, outputClip, true, new FFMpegCallbacks(onComplete, onMessage));

//2. This is a similar version in command line only:
string[] cmds = new string[] {
 "-y",
 "-i",
 sourceClip.path,
 "-strict",
 "-2",
 "-vf",
 "mp=eq2=1:1.68:0.3:1.25:1:0.96:1",
 destinationPathAndFilename2,
 "-acodec",
 "copy",
};
ffmpeg.Execute (cmds, callbacks);

// 3. This lists codecs:
string[] cmds3 = new string[] {
 "-codecs",
};
ffmpeg.Execute (cmds, callbacks);

// 4. This convers to WAV
// Note that the cat movie just has some silent house noise.
ffmpeg.ConvertToWaveAudio(sourceClip, destinationPathAndFilename4, 44100, 2, callbacks, true);
</videofilter>



I have tried different commands but no output file is generated. I have tried to use another project found here but this one has the same issue. I don't get any errors but no output file is generated. I'm really hoping someone can help me find a way I can manage to use FFmpeg in my project or some way to compress video to transport it to the server.



I will really appreciate if someone can point me in the right direction.