Recherche avancée

Médias (5)

Mot : - Tags -/open film making

Autres articles (81)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • MediaSPIP v0.2

    21 juin 2013, par

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

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP 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 (13279)

  • How to split an audio / video file based upon multiple timestamps by using FFMPEG (preferably)

    19 février, par badr2001

    I would like to be able to split my audio (mp3 or equiv.) or video file based upon multiple timestamps. The same way, for those who have used any editing software, you can crop the file based upon selecting a start time and end time.

    


    What I have done so far :

    


    [HttpPost]&#xA;public async Task<string> ProcessFullAudio([FromBody] ProcessFullAudioRequest processFullAudioRequest)&#xA;{&#xA;    if (processFullAudioRequest == null || processFullAudioRequest.StartEndTimes == null || processFullAudioRequest.StartEndTimes.Length == 0)&#xA;    {&#xA;        throw new ArgumentException("Invalid request: StartEndTimes cannot be null or empty.");&#xA;    }&#xA;&#xA;    var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");&#xA;    var fileName = $"{Guid.NewGuid()}_{timestamp}.mp3";&#xA;    var outputFilePath = Path.Combine(customFolder, fileName);&#xA;&#xA;    int amntOfTimeStamps = processFullAudioRequest.StartEndTimes.Length;&#xA;    int step = 0;&#xA;    string lineOfCodeForFirstTime = " \"aselect=&#x27;not(between(t,<start>,<end>)";&#xA;    string lineOfCodeForRestOfTimes = "&#x2B;between(t,<start>,<end>)";&#xA;    string argument = "";&#xA;    string result = null;&#xA;    string filterComplex = GenerateAtrims(processFullAudioRequest.StartEndTimes);&#xA;&#xA;    while (step != amntOfTimeStamps)&#xA;    {&#xA;        step&#x2B;&#x2B;;&#xA;        if (step == 1)&#xA;        {&#xA;            result = ReplacePlaceholders(lineOfCodeForFirstTime, HhMmSsToSeconds(processFullAudioRequest.StartEndTimes[step - 1].Start).ToString() , HhMmSsToSeconds(processFullAudioRequest.StartEndTimes[step - 1].End).ToString());&#xA;            argument &#x2B;= result;&#xA;        }&#xA;        else&#xA;        {&#xA;            result = ReplacePlaceholders(lineOfCodeForRestOfTimes, HhMmSsToSeconds(processFullAudioRequest.StartEndTimes[step - 1].Start).ToString() , HhMmSsToSeconds(processFullAudioRequest.StartEndTimes[step - 1].End).ToString());&#xA;            argument &#x2B;= result;&#xA;        }&#xA;&#xA;    }&#xA;    var FFMPEG_PATH = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "ffmpeg.exe");&#xA;    if (!System.IO.File.Exists(FFMPEG_PATH))&#xA;    {&#xA;        return "ffmpeg.exe IS NULL";&#xA;    }&#xA;    var arguments = $"-i {processFullAudioRequest.InputFilePath} -af {argument})&#x27; ,asetpts=N/SR/TB\" -acodec libmp3lame {outputFilePath}";&#xA;&#xA;    await ProcessAsyncHelper.ExecuteShellCommand(FFMPEG_PATH, arguments, Timeout.Infinite);&#xA;&#xA;    return outputFilePath;&#xA;}&#xA;</end></start></end></start></string>

    &#xA;

    The code, I hope, is self explanatory.&#xA;The argument variable should like something like this :

    &#xA;

    -i C:\Users\User\Desktop\AudioEditorBackEnmd\AudioEditorAPI\wwwroot\mp3\TestAudio_123.mp3 -af  "aselect=&#x27;not(between(t,120,240))&#x27; ,asetpts=N/SR/TB" -acodec libmp3lame C:\Users\User\Desktop\AudioEditorBackEnmd\AudioEditorAPI\wwwroot\mp3\aa887f21-0a90-4ec5-80ba-2b265cb445b4_20250219_123804.mp3&#xA;

    &#xA;

    After returning the output path for the newly processed edited audio, I pass it to my DownloadFile function :

    &#xA;

            [HttpGet]&#xA;        public async Task<iactionresult> DownloadProcessedFile([FromQuery] string fileName)&#xA;        {&#xA;            if (string.IsNullOrWhiteSpace(fileName))&#xA;            {&#xA;                return BadRequest("File name is required.");&#xA;            }&#xA;&#xA;            var filePath = Path.Combine(customFolder, fileName);&#xA;&#xA;            if (!System.IO.File.Exists(filePath))&#xA;            {&#xA;                return NotFound(new { fileName });&#xA;            }&#xA;&#xA;            try&#xA;            {&#xA;                var fileBytes = await System.IO.File.ReadAllBytesAsync(filePath);&#xA;&#xA;                return File(fileBytes, "audio/mpeg", fileName);&#xA;&#xA;            }&#xA;            catch (Exception ex)&#xA;            {&#xA;                throw;&#xA;            }&#xA;&#xA;        }&#xA;&#xA;</iactionresult>

    &#xA;

    Everything works, in the sense off, I am able to get an processed file which is shorter than the original audio. However the issue is that the timestamps are off.&#xA;For example, in the argument that I provided above, I am cropping the audio from 120 to 240, which is from the 2 min mark till the 4 min mark. The audio which I am passing is 01:06:53 however the processed audio gives me back 1:05:22 which is not excepted as I should be getting 01:04:53.

    &#xA;

    The annoying thing is that I was getting the desired output at one point. Im not sure what changes caused the timestamps to become off. The only changes which I did was changing the file locations to my wwwroot folder.

    &#xA;

    I have tried many different variations of commands to get a desired output but can't seem to get anything close - I always get 1:05:22 back. From the commands that I tired was :

    &#xA;

                var arguments = $"-i {processFullAudioRequest.InputFilePath} -af {argument})&#x27; , asetpts=N/SR/TB\" -c:a libmp3lame -q:a 2  {outputFilePath}";&#xA;

    &#xA;

    I tried so many more but I simply can't remember. And now I feel like I have reached a hard wall in coming up with a solution for this.

    &#xA;

    Any help I would much appreciate. I have tried to give as much detail as I can but if anything remains please let me know.

    &#xA;

  • ffmpeg link error with CodeBlocks

    12 juillet 2016, par Yoohoo

    Hi,I am currently doing a real time video encoding c program using ffmpeg, initially I encountered a lot of "undefined reference" error, after I set the linker in build options, some error got disappeared, but still some error remains.

    ||=== Build: Debug in c_3rd party encoding (compiler: GNU GCC Compiler)     ===|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c||In function     ‘init_video_encode’:|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c|73|warning: ‘avcodec_alloc_frame’ is deprecated (declared at ../../ffmpeg_build/include/libavcodec/avcodec.h:3618) [-Wdeprecated-declarations]|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c||In function ‘cancle_encode’:|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c|134|warning: ‘avcodec_free_frame’ is deprecated (declared at ../../ffmpeg_build/include/libavcodec/avcodec.h:3643) [-Wdeprecated-declarations]|
    /home/yonghao/codeblocksfile/c_3rd party encoding/main.c|21|warning: ‘endcode’ defined but not used [-Wunused-variable]|
    ../../ffmpeg_build/lib/libavcodec.a(libmp3lame.o)||In function `mp3lame_encode_frame':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|211|undefined reference to `lame_encode_buffer_float'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|195|undefined reference to `lame_encode_buffer'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|198|undefined reference to `lame_encode_buffer_int'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|219|undefined reference to `lame_encode_flush'|
    ../../ffmpeg_build/lib/libavcodec.a(libmp3lame.o)||In function `mp3lame_encode_close':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|86|undefined reference to `lame_close'|
    ../../ffmpeg_build/lib/libavcodec.a(libmp3lame.o)||In function `mp3lame_encode_init':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|98|undefined reference to `lame_init'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|102|undefined reference to `lame_set_num_channels'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|103|undefined reference to `lame_set_mode'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|106|undefined reference to `lame_set_in_samplerate'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|107|undefined reference to `lame_set_out_samplerate'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|111|undefined reference to `lame_set_quality'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|115|undefined reference to `lame_set_VBR'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|116|undefined reference to `lame_set_VBR_quality'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|120|undefined reference to `lame_set_VBR'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|121|undefined reference to `lame_set_VBR_mean_bitrate_kbps'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|123|undefined reference to `lame_set_brate'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|128|undefined reference to `lame_set_bWriteVbrTag'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|131|undefined reference to `lame_set_disable_reservoir'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|134|undefined reference to `lame_init_params'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|140|undefined reference to `lame_get_encoder_delay'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libmp3lame.c|143|undefined reference to `lame_get_framesize'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusdec.o)||In function `libopus_flush':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|178|undefined reference to `opus_multistream_decoder_ctl'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusdec.o)||In function `libopus_decode':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|143|undefined reference to `opus_multistream_decode_float'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|139|undefined reference to `opus_multistream_decode'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|148|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusdec.o)||In function `libopus_decode_close':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|121|undefined reference to `opus_multistream_decoder_destroy'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusdec.o)||In function `libopus_decode_init':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|87|undefined reference to `opus_multistream_decoder_create'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|91|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|97|undefined reference to `opus_multistream_decoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusdec.c|99|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_encode':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|346|undefined reference to `opus_multistream_encode'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|342|undefined reference to `opus_multistream_encode_float'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|351|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_encode_close':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|389|undefined reference to `opus_multistream_encoder_destroy'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_encode_init':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|254|undefined reference to `opus_multistream_encoder_create'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|260|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_configure_encoder':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|117|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|119|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|124|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|127|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|130|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|132|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|135|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|138|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|141|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|144|undefined reference to `opus_strerror'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|149|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|152|undefined reference to `opus_strerror'|
    ../../ffmpeg_build/lib/libavcodec.a(libopusenc.o)||In function `libopus_encode_init':|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|288|undefined reference to `opus_multistream_encoder_ctl'|
    /home/yonghao/ffmpeg_sources/ffmpeg/libavcodec/libopusenc.c|290|undefined reference to `opus_strerror'|
    ||More errors follow but not being shown.|
    ||Edit the max errors limit in compiler options...|
    ||=== Build failed: 50 error(s), 3 warning(s) (0 minute(s), 3 second(s)) ===|

    Here are my screen shot of the CodeBlock linker setting.

    ffmpeg_build/lib/libvpx.a
    ffmpeg_build/lib/libswscale.a
    ffmpeg_build/lib/libwresample.a
    ffmpeg_build/lib/libpostproc.a
    ffmpeg_build/lib/libfdk-aac.a
    ffmpeg_build/lib/libvutil.a
    ffmpeg_build/lib/libvformat.a
    ffmpeg_build/lib/libavfilter.a
    ffmpeg_build/lib/libavdevice.a
    ffmpeg_build/lib/libavcodec.a

    Totally 10 libs.

    My Questions :

    1. Are these errors caused by lacking libs or libs not linked.
    2. What libs I missing or what libs should I add to linker.
  • Pyinstaller Hidden import 'ffmpeg-python' not found

    13 août 2024, par petunia rose

    Trying to convert Python scripts to exe with PyInstaller.

    &#xA;

    In my code, I use ffmpeg-python :

    &#xA;

    import ffmpeg&#xA;....&#xA;def ffmpeg_save_clip(self,output_video: str, clip_start: str, clip_end: str): &#xA;  (ffmpeg &#xA;   .input(self.file.get_videopath(), ) &#xA;   .output(output_video, vcodec=&#x27;copy&#x27;, ss=clip_start, to=clip_end, acodec=&#x27;copy&#x27;) &#xA;   .global_args(&#x27;-y&#x27;) &#xA;   .run())&#xA;

    &#xA;

    So Ii call PyInstaller from terminal with related flag :

    &#xA;

    pyinstaller --windowed --hidden-import "ffmpeg-python" --noconsole --icon=app.ico --name "app" main.py &#xA;

    &#xA;

    I checked also :

    &#xA;

    pip install ffmpeg-python &#xA;Requirement already satisfied: ffmpeg-python in c:\python38\lib\site-packages (0.2.0) &#xA;Requirement already satisfied: future in c:\python38\lib\site-packages (from ffmpeg-python) (0.18.3)&#xA;

    &#xA;

    But I get from PyInstaller :

    &#xA;

    Hidden import &#x27;ffmpeg-python&#x27; not found&#xA;

    &#xA;

    App works in visual-studio, but when I run pyinstaller exe and try to save clip, it freeze without response.

    &#xA;

    Note : I also :

    &#xA;

      &#xA;
    1. try to add ffmpeg.exe into root folder of pyinstaller app.

      &#xA;

    2. &#xA;

    3. try to use .spec file with :

      &#xA;

      binaries=[(&#x27;C:\\ffmpeg\\bin\\ffmpeg.exe&#x27;, &#x27;ffmpeg/),(&#x27;C:\\ffmpeg\\bin\\ffplay.exe&#x27;,&#x27;ffplay/&#x27;), (&#x27;C:\\ffmpeg\\bin\\ffprobe.exe&#x27;, &#x27;ffprobe/&#x27;)],

      &#xA;

    4. &#xA;

    &#xA;

    Nothing changes

    &#xA;

    UPDATE&#xA;Tank you @happy_code_egg, you explained me such a things.&#xA;I tried what you said and I don't have error any more.

    &#xA;

    But I can't make work ffmpeg anywhere on Pyinstaller exe.&#xA;I added a try/except block to isolate problem&#xA;(when I launch app on Visualstudio it works, but not when use exe).

    &#xA;

    block is (very symilar to past def) :

    &#xA;

    def ffmpeg_save_clip(self,output_video: str, clip_start: str, clip_end: str):&#xA;    input = &#x27;C:\Users\x\Desktop\input.mp4&#x27;&#xA;    output = &#x27;C:\Users\x\Desktop\output.mp4&#x27;&#xA;    try:&#xA;        (ffmpeg&#xA;        .input(input)&#xA;        .output(output, vcodec=&#x27;copy&#x27;, ss=clip_start, to=clip_end, acodec=&#x27;copy&#x27;)&#xA;        .global_args(&#x27;-y&#x27;)&#xA;        .run(capture_stdout=True))&#xA;    except Exception as e:&#xA;        self.logger.error(&#x27;Video window -> ffmpeg_save_clip -> error &#x27; &#x2B; str(e))&#xA;        self.logger.error(&#x27;Video window -> ffmpeg_save_clip -> input file: &#x27; &#x2B; input)&#xA;        self.logger.error(&#x27;Video window -> ffmpeg_save_clip -> output file &#x27; &#x2B; output)&#xA;        raise ValueError(str(e))&#xA;

    &#xA;

    Note : (input and output fixed are only as simple path examples)

    &#xA;

    When I open log I have :

    &#xA;

    2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> error [WinError 2] File not found error&#xA;2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> input file: C:\Users\x\Desktop\input.mp4&#xA;2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> output file C:\Users\x\Desktop\ouput.mp4&#xA;

    &#xA;

    (I tried with '/' and also '\' to create path)&#xA;File paths are correct and, on Visualstudio, they can be processed by ffmpeg (no error), but the exe seems to not find (input or output)

    &#xA;

    I tried solution described here :&#xA;Python ffmpeg won't accept path&#xA;(without effects)

    &#xA;

    I found also these discussions :

    &#xA;

    github ffmpeg-python issue1

    &#xA;

    github ffmpeg-python issue2

    &#xA;

    in both discussions seems to be a problem with ffmpeg + ffmpeg-python libs cohexistence.

    &#xA;

    I tried (as said) to uninstal both and reinstall ffmpeg-python,&#xA;but nothing change.

    &#xA;

    Note :&#xA;I've also three other warning during Pyinstaller :&#xA;(I write them only to complete context, but i think they have no repercussions on this problem.)

    &#xA;

    57283 ERROR: Hidden import &#x27;fiona._shim&#x27; not found&#xA;57298 WARNING: Hidden import "fiona._shim" not found!&#xA;57392 WARNING: Hidden import "importlib_resources.trees" not found!&#xA;

    &#xA;

    tried with :

    &#xA;

    --hidden-import fiona._shim --hidden-import fiona.schema&#xA;

    &#xA;

    tried also with :

    &#xA;

    --add-data="fiona/*;fiona”&#xA;

    &#xA;

    but warnings still remains.

    &#xA;