Recherche avancée

Médias (91)

Autres articles (44)

  • Changer son thème graphique

    22 février 2011, par

    Le 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 (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (6556)

  • Output file using FFmpeg in Xamarin Android

    28 juillet 2022, par Ahmed Mujtaba

    I'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;&#xA;var sourceMp4 = "cat1.mp4";&#xA;var destinationPathAndFilename = System.IO.Path.Combine (_workingDirectory, "cat1_out.mp4");&#xA;var destinationPathAndFilename2 = System.IO.Path.Combine (_workingDirectory, "cat1_out2.mp4");&#xA;var destinationPathAndFilename4 = System.IO.Path.Combine (_workingDirectory, "cat1_out4.wav");&#xA;if (File.Exists (destinationPathAndFilename))&#xA;    File.Delete (destinationPathAndFilename);&#xA;CreateSampleFile(Resource.Raw.cat1, _workingDirectory, sourceMp4);&#xA;&#xA;&#xA;var ffmpeg = new FFMpeg (this, _workingDirectory);&#xA;&#xA;var sourceClip = new Clip (System.IO.Path.Combine(_workingDirectory, sourceMp4));&#xA;&#xA;var result = ffmpeg.GetInfo (sourceClip);&#xA;&#xA;var br = System.Environment.NewLine;&#xA;&#xA;// There are callbacks based on Standard Output and Standard Error when ffmpeg binary is running as a process:&#xA;&#xA;var onComplete = new MyCommand ((_) => {&#xA;    RunOnUiThread(() =>_logView.Append("DONE!" &#x2B; br &#x2B; br));&#xA;});&#xA;&#xA;var onMessage = new MyCommand ((message) => {&#xA;    RunOnUiThread(() =>_logView.Append(message &#x2B; br &#x2B; br));&#xA;});&#xA;&#xA;var callbacks = new FFMpegCallbacks (onComplete, onMessage);&#xA;&#xA;// 1. The idea of this first test is to show that video editing is possible via FFmpeg:&#xA;// It results in a 150x150 movie that eventually zooms on a cat ear. This is desaturated, and there&#x27;s a fade-in.&#xA;&#xA;var filters = new List<videofilter> ();&#xA;filters.Add (new FadeVideoFilter ("in", 0, 100));&#xA;filters.Add(new CropVideoFilter("150","150","0","0"));&#xA;filters.Add(new ColorVideoFilter(1.0m, 1.0m, 0.0m, 0.5m, 1.0m, 1.0m, 1.0m, 1.0m));&#xA;var outputClip = new Clip (destinationPathAndFilename) { videoFilter = VideoFilter.Build (filters)  };&#xA;outputClip.H264_CRF = "18"; // It&#x27;s the quality coefficient for H264 - Default is 28. I think 18 is pretty good.&#xA;ffmpeg.ProcessVideo(sourceClip, outputClip, true, new FFMpegCallbacks(onComplete, onMessage));&#xA;&#xA;//2. This is a similar version in command line only:&#xA;string[] cmds = new string[] {&#xA;    "-y",&#xA;    "-i",&#xA;    sourceClip.path,&#xA;    "-strict",&#xA;    "-2",&#xA;    "-vf",&#xA;    "mp=eq2=1:1.68:0.3:1.25:1:0.96:1",&#xA;    destinationPathAndFilename2,&#xA;    "-acodec",&#xA;    "copy",&#xA;};&#xA;ffmpeg.Execute (cmds, callbacks);&#xA;&#xA;// 3. This lists codecs:&#xA;string[] cmds3 = new string[] {&#xA;    "-codecs",&#xA;};&#xA;ffmpeg.Execute (cmds, callbacks);&#xA;&#xA;// 4. This convers to WAV&#xA;// Note that the cat movie just has some silent house noise.&#xA;ffmpeg.ConvertToWaveAudio(sourceClip, destinationPathAndFilename4, 44100, 2, callbacks, true);&#xA;</videofilter>

    &#xA;&#xA;

    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.

    &#xA;&#xA;

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

    &#xA;

  • How can I concatenate these two video files that are in different formats with ffmpeg ?

    11 juin 2018, par jaybers

    File s.mp4 is created from a photo and a silent audio track was added in.
    File r.mp4 was created using the built in video record on an android tablet.

    I would like to try to match s.mp4 to r.mp4 so that they can concatenate (s then r). Right now, the time base seems off and it plays audio from the r.mp4 but never shows the video. It it always shows the video from s.mp4. I was able to match the tbn of 90k by using -video_track_timescale 90k but I did not know how to match the tbc. It is 180k on one and 59.94 on the other.

    Probe for s.mp4

    ./ffprobe s.mp4
    ffprobe version 4.0-tessus Copyright (c) 2007-2018 the FFmpeg developers
     built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
     configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
     libavutil      56. 14.100 / 56. 14.100
     libavcodec     58. 18.100 / 58. 18.100
     libavformat    58. 12.100 / 58. 12.100
     libavdevice    58.  3.100 / 58.  3.100
     libavfilter     7. 16.100 /  7. 16.100
     libswscale      5.  1.100 /  5.  1.100
     libswresample   3.  1.100 /  3.  1.100
     libpostproc    55.  1.100 / 55.  1.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 's.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.25.100
     Duration: 00:00:05.04, start: 0.000000, bitrate: 296 kb/s
       Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 286 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 2 kb/s (default)
       Metadata:
         handler_name    : SoundHandler

    Probe for r.mp4

    ./ffprobe r.mp4
    ffprobe version 4.0-tessus Copyright (c) 2007-2018 the FFmpeg developers
     built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
     configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
     libavutil      56. 14.100 / 56. 14.100
     libavcodec     58. 18.100 / 58. 18.100
     libavformat    58. 12.100 / 58. 12.100
     libavdevice    58.  3.100 / 58.  3.100
     libavfilter     7. 16.100 /  7. 16.100
     libswscale      5.  1.100 /  5.  1.100
     libswresample   3.  1.100 /  3.  1.100
     libpostproc    55.  1.100 / 55.  1.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'r.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2018-06-11T20:12:03.000000Z
       com.android.version: 7.0
     Duration: 00:00:10.89, start: 0.000000, bitrate: 17087 kb/s
       Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/smpte170m), 1920x1080, 16810 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
       Metadata:
         creation_time   : 2018-06-11T20:12:03.000000Z
         handler_name    : VideoHandle
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
       Metadata:
         creation_time   : 2018-06-11T20:12:03.000000Z
         handler_name    : SoundHandle
  • ffmpeg merge video and audio + fade out

    1er mai 2016, par jacky brown

    I have one video file and one audio file.
    I want to merge them together that the final output video will be in the length of the video and will contain the audio in the background.

    i did :

    ffmpeg -i output.avi -i bgmusic.mp3 -filter_complex " [1:0] apad " -shortest out.avi

    but the background audio is cut in the end of the final merge movie.
    i want it to fade out nicely.

    how can i do it ??

    but the background audio is cut in the end of the final merge movie.
    i want it to fade out nicely.

    how can i do it ??

    thanks.