Recherche avancée

Médias (91)

Sur d’autres sites (120)

  • Apache Tika 2.0.9 programm ffmpeg and exiftool not found ?

    6 avril, par mj44

    I use an JavaFX Maven Project to use Apache Tika Version 2.9.0.
The Java Test program will be finished and all methods that I create will done right.
I have in the log file a lot of DEBUG errors and Idon't know why ?
I habe spent many hours to clear the problem.

    


    Here's an excerpt of the logfile

    


    2024-04-03 14:56:12 [main] DEBUG org.apache.tika.parser.external.ExternalParser - exception trying to run  ffmpeg
java.io.IOException: Cannot run program "ffmpeg": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1140) ~[?:?]
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1074) ~[?:?]
...
2024-04-03 14:56:12 [main] DEBUG org.apache.tika.parser.external.ExternalParser - exception trying to run  exiftool
java.io.IOException: Cannot run program "exiftool": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1140) ~[?:?]
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1074) ~[?:?]
...



    


    The message says that ffmpeg and exiftool are not found.

    


    This is my tika-config.xml

    


    &lt;?xml version="1.0" encoding="UTF-8"?>&#xA;<properties>&#xA;    <parsers>&#xA;        <parser class="org.apache.tika.parser.DefaultParser"></parser>&#xA;        <parser class="org.apache.tika.parser.pdf.PDFParser"></parser>&#xA;        &#xA;        <parser class="org.apache.tika.parser.external.ExternalParser">&#xA;            <params>&#xA;                true&#xA;                &#xA;                "D:\Tools\ffmpeg-6.1.1\bin\ffmpeg.exe"&#xA;            </params>&#xA;        </parser>&#xA;        &#xA;        <parser class="org.apache.tika.parser.external.ExternalParser">&#xA;            <params>&#xA;                true&#xA;                &#xA;                "D:\Tools\exiftool.exe"&#xA;            </params>&#xA;        </parser>&#xA;    </parsers>&#xA;    <detector>&#xA;        <detector class="org.apache.tika.detect.DefaultDetector"></detector>&#xA;    </detector>&#xA;</properties>&#xA;

    &#xA;

    I tested the path of the programms in a console ant it worked fine ?&#xA;I don't know what I can do now ?

    &#xA;

    Thanks for Help

    &#xA;

    I have downloaded new copies of the ffmpeg and exiftool and installed them.&#xA;I tested it in a console to run and both tools work fine.&#xA;I tested the permissions, no problems with permissions&#xA;I tested that the tika-config.xml will be loaded, it loaded.

    &#xA;

  • Struggling to add subtitles to a video using FFMPEG and C#

    19 mars, par MattHodson

    I'm trying to add subtitles to my videos, 100% with code using FFMPEG and C#.

    &#xA;

    But I'm getting the following error :

    &#xA;

    &#xA;

    ffmpeg version 2024-02-04-git-7375a6ca7b-essentials_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers&#xA;built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;configuration : —enable-gpl —enable-version3 —enable-static —pkg-config=pkgconf —disable-w32threads —disable-autodetect —enable-fontconfig —enable-iconv —enable-gnutls —enable-libxml2 —enable-gmp —enable-bzlib —enable-lzma —enable-zlib —enable-libsrt —enable-libssh —enable-libzmq —enable-avisynth —enable-sdl2 —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxvid —enable-libaom —enable-libopenjpeg —enable-libvpx —enable-mediafoundation —enable-libass —enable-libfreetype —enable-libfribidi —enable-libharfbuzz —enable-libvidstab —enable-libvmaf —enable-libzimg —enable-amf —enable-cuda-llvm —enable-cuvid —enable-ffnvcodec —enable-nvdec —enable-nvenc —enable-dxva2 —enable-d3d11va —enable-libvpl —enable-libgme —enable-libopenmpt —enable-libopencore-amrwb —enable-libmp3lame —enable-libtheora —enable-libvo-amrwbenc —enable-libgsm —enable-libopencore-amrnb —enable-libopus —enable-libspeex —enable-libvorbis —enable-librubberband&#xA;libavutil 58. 36.101 / 58. 36.101&#xA;libavcodec 60. 38.100 / 60. 38.100&#xA;libavformat 60. 20.100 / 60. 20.100&#xA;libavdevice 60. 4.100 / 60. 4.100&#xA;libavfilter 9. 17.100 / 9. 17.100&#xA;libswscale 7. 6.100 / 7. 6.100&#xA;libswresample 4. 13.100 / 4. 13.100&#xA;libpostproc 57. 4.100 / 57. 4.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C :\Users\Gamer\source\repos\XXXX\bin\Debug\net8.0\ce31c8ab-4b53-44e8-9e25-d02ba5466144\output.mp4' :&#xA;Metadata :&#xA;major_brand : isom&#xA;minor_version : 512&#xA;compatible_brands : isomiso2avc1mp41&#xA;encoder : Lavf60.20.100&#xA;Duration : 00:03:18.84, start : 0.000000, bitrate : 101 kb/s&#xA;Stream #0:00x1 : Video : h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1024x1792, 26 kb/s, 1 fps, 1 tbr, 16384 tbn (default)&#xA;Metadata :&#xA;handler_name : VideoHandler&#xA;vendor_id : [0][0][0][0]&#xA;encoder : Lavc60.38.100 libx264&#xA;Stream #0:10x2 : Audio : aac (LC) (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 74 kb/s (default)&#xA;Metadata :&#xA;handler_name : SoundHandler&#xA;vendor_id : [0][0][0][0]&#xA;[Parsed_subtitles_0 @ 000001a87404e3c0] Unable to parse option value "UsersGamersourcereposXXXXbinDebugnet8.0ce31c8ab-4b53-44e8-9e25-d02ba5466144output.srt" as image size&#xA;Error applying option 'original_size' to filter 'subtitles' : Invalid argument&#xA;[vost#0:0/libx264 @ 000001a874064a40] Error initializing a simple filtergraph&#xA;Error opening output file C :\Users\Gamer\source\repos\XXXX\bin\Debug\net8.0\ce31c8ab-4b53-44e8-9e25-d02ba5466144\videoWithSubtitles.mp4.&#xA;Error opening output files : Invalid argument

    &#xA;

    &#xA;

    It seems to be something related to paths, but I have tried EVERYTHING in my knowledge to fix this, still no luck... spent the majority of the day on it, no luck... so StackOverflow here I come !

    &#xA;

    My code :

    &#xA;

       public static async Task AddSubtitlesToVideoAsync(string videoPath, string subtitlesPath, string outputPath)&#xA;    {&#xA;        if (File.Exists(videoPath) &amp;&amp; File.Exists(subtitlesPath))&#xA;        {&#xA;            //string subtitlesPathForwardSlashes = subtitlesPath.Replace("\\", "/");&#xA;            //string ffmpegCommand = $"-i \"{videoPath}\" -filter_complex \"subtitles=&#x27;{subtitlesPathForwardSlashes}&#x27;\" \"{outputPath}\"";&#xA;            //string ffmpegCommand = $"-i \"{videoPath}\" -vf subtitles={subtitlesPathForwardSlashes} \"{outputPath}\"";&#xA;            //string ffmpegCommand = $"-i \"{videoPath}\" -vf subtitles=\"{subtitlesPath}\" \"{outputPath}\"";&#xA;            string subtitlesPathEscaped = subtitlesPath.Replace("\\", "\\\\");&#xA;            string ffmpegCommand = $"-i \"{videoPath}\" -vf subtitles=\"{subtitlesPathEscaped}\" \"{outputPath}\"";&#xA;&#xA;&#xA;            //output    -i C:\Users\Gamer\source\repos\XXXX\bin\Debug\net8.0\d745a08d-b932-47ac-a81c-45e9483590a7\output.mp4 -vf subtitles="C:/Users/Gamer/source/repos/XXXX/bin/Debug/net8.0/d745a08d-b932-47ac-a81c-45e9483590a7/generatedSubtitles.srt" C:\Users\Gamer\source\repos\XXXX\bin\Debug\net8.0\d745a08d-b932-47ac-a81c-45e9483590a7\videoWithSubtitles.mp4&#xA;            await ExecuteSubtitleCommandAsync(ffmpegCommand);&#xA;        }&#xA;        else&#xA;        {&#xA;            Console.WriteLine("Files can&#x27;t be found.");&#xA;        }&#xA;    }&#xA;&#xA;    public static async Task ExecuteSubtitleCommandAsync(string arguments)&#xA;    {&#xA;        string ffmpegExecutablePath = ffmpegRoot;&#xA;        var startInfo = new ProcessStartInfo(ffmpegExecutablePath, arguments)&#xA;        {&#xA;            CreateNoWindow = true,&#xA;            UseShellExecute = false,&#xA;            RedirectStandardOutput = true,&#xA;            RedirectStandardError = true&#xA;        };&#xA;&#xA;        using (var process = new Process { StartInfo = startInfo })&#xA;        {&#xA;            process.EnableRaisingEvents = true; // Enable the Exited event.&#xA;            process.Exited &#x2B;= (sender, e) =>&#xA;            {&#xA;                Console.WriteLine($"FFmpeg process exited with code {process.ExitCode}.");&#xA;            };&#xA;&#xA;            try&#xA;            {&#xA;                process.Start();&#xA;                // Asynchronously read the standard output and standard error of the process&#xA;                var outputTask = process.StandardOutput.ReadToEndAsync();&#xA;                var errorTask = process.StandardError.ReadToEndAsync();&#xA;                // Wait for both asynchronous tasks to complete&#xA;                await Task.WhenAll(outputTask, errorTask);&#xA;&#xA;                var output = await outputTask;&#xA;                var error = await errorTask;&#xA;&#xA;                if (!string.IsNullOrEmpty(error))&#xA;                {&#xA;                    Console.WriteLine("FFmpeg error: " &#x2B; error);&#xA;                }&#xA;                else&#xA;                {&#xA;                    Console.WriteLine("FFmpeg process completed successfully.");&#xA;                }&#xA;            }&#xA;            catch (Exception ex)&#xA;            {&#xA;                Console.WriteLine("Error: " &#x2B; ex.Message);&#xA;            }&#xA;            finally&#xA;            {&#xA;                // Wait for the process to exit if it hasn&#x27;t already.&#xA;                if (!process.HasExited)&#xA;                {&#xA;                    process.WaitForExit();&#xA;                }&#xA;            }&#xA;        }&#xA;    }&#xA;

    &#xA;

  • webm video - it can not be copy to cut a correct time part for ffmpeg command(without re-encode) [closed]

    15 mars, par DanielHsu

    Command Goal :

    &#xA;

      &#xA;
    1. fast copy video's part
    2. &#xA;

    3. no re-encode with libvpx
    4. &#xA;

    &#xA;

    Linux command below :&#xA;ffmpeg -ss 00:01:00 -to 00:02:00 -i input.webm -c copy output.webm

    &#xA;

    command's process details :

    &#xA;

    ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers   built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)   configuration:&#xA;--enable-libvpx   libavutil      58. 29.100 / 58. 29.100   libavcodec     60. 31.102 / 60. 31.102   libavformat    60. 16.100 / 60. 16.100   libavdevice    60.  3.100 / 60.  3.100   libavfilter     9. 12.100 / &#xA;9. 12.100   libswscale      7.  5.100 /  7.  5.100   libswresample   4. 12.100 /  4. 12.100 Input #0, matroska,webm, from &#x27;input.webm&#x27;:   Metadata:&#xA;    title           : FFmpeg&#xA;    ENCODER         : Lavf58.29.100   Duration: 00:06:04.43, start: 0.000000, bitrate: 2487 kb/s   Stream #0:0: Video: vp8, yuv420p(tv, bt470bg/unknown/unknown, progressive), 1280x720, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn (default)&#xA;    Metadata:&#xA;      DURATION        : 00:06:04.432000000 Output #0, webm, to &#x27;output.webm&#x27;:   Metadata:&#xA;    title           : FFmpeg&#xA;    encoder         : Lavf60.16.100   Stream #0:0: Video: vp8, yuv420p(tv, bt470bg/unknown/unknown, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1k tbr, 1k tbn (default)&#xA;    Metadata:&#xA;      DURATION        : 00:06:04.432000000 Stream mapping:   Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help [out#0/webm @ 0x5609ee9bb840] video:35912kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.069370% size=   35937kB time=00:00:59.96 bitrate=4909.2kbits/s speed= 211x&#xA;

    &#xA;

    command usage's result :&#xA;output.webm always start from input.webm's 00:00:00 to end input.webm's 00:01:00&#xA;(it should be start from input.webm's 00:01:00 to end input.webm's 00:02:00 )

    &#xA;

    input.webm format details from mediainfo tool :

    &#xA;

    &#xA;

    General Count : 331 Count of stream&#xA;of this kind : 1 Kind of stream
    &#xA; : General Kind of stream : General Stream&#xA;identifier : 0 Count of video streams
    &#xA; : 1 Video_Format_List : VP8&#xA;Video_Format_WithHint_List : VP8 Codecs Video
    &#xA; : VP8 Complete name :&#xA;pure_film/65ea641a4075c92236151349_video.webm Folder name
    &#xA; : pure_film File name extension :&#xA;65ea641a4075c92236151349_video.webm File name
    &#xA; : 65ea641a4075c92236151349_video File extension
    &#xA; : webm Format : WebM Format
    &#xA; : WebM Format/Url :&#xA;http://www.webmproject.org/ Format/Extensions usually used :&#xA;webm Commercial name : WebM Format version
    &#xA; : Version 2 Internet media type : video/webm File&#xA;size : 113301943 File size
    &#xA; : 108 MiB File size : 108 MiB File size&#xA; : 108 MiB File size : 108 MiB File size&#xA; : 108.1 MiB Duration : 364432 Duration&#xA; : 6 min 4 s Duration : 6 min 4 s 432&#xA;ms Duration : 6 min 4 s Duration
    &#xA; : 00:06:04.432 Duration : 00:06:04.432&#xA;Overall bit rate : 2487201 Overall bit rate
    &#xA; : 2 487 kb/s Stream size : 4801069 Stream&#xA;size : 4.58 MiB (4%) Stream size
    &#xA; : 5 MiB Stream size : 4.6 MiB Stream size&#xA; : 4.58 MiB Stream size : 4.579 MiB Stream&#xA;size : 4.58 MiB (4%) Proportion of this&#xA;stream : 0.04237 IsStreamable
    &#xA; : Yes Title : FFmpeg Movie name
    &#xA; : FFmpeg File last modification date : UTC 2024-03-08&#xA;01:41:47 File last modification date (local) : 2024-03-08&#xA;09:41:47 Writing application : Lavf58.29.100&#xA;Writing application : Lavf58.29.100 Writing&#xA;library : Lavf58.29.100 Writing library
    &#xA; : Lavf58.29.100

    &#xA;

    Video Count : 377 Count of stream&#xA;of this kind : 1 Kind of stream
    &#xA; : Video Kind of stream : Video Stream&#xA;identifier : 0 StreamOrder
    &#xA; : 0 ID : 1 ID
    &#xA; : 1 Unique ID : 1 Format
    &#xA; : VP8 Format : VP8 Format/Url
    &#xA; : http://www.webmproject.org/ Commercial name
    &#xA; : VP8 Codec ID : V_VP8 Codec ID/Url
    &#xA; : http://www.webmproject.org/ Duration
    &#xA; : 364432.000000 Duration : 6 min 4 s&#xA;Duration : 6 min 4 s 432 ms Duration
    &#xA; : 6 min 4 s Duration : 00:06:04.432&#xA;Duration : 00:06:04.432 Bit rate
    &#xA; : 2381808 Bit rate : 2 382 kb/s Width&#xA; : 1280 Width : 1 280 pixels Height&#xA; : 720 Height : 720 pixels Pixel&#xA;aspect ratio : 1.000 Display aspect ratio
    &#xA; : 1.778 Display aspect ratio : 16:9 Frame rate&#xA;mode : VFR Frame rate mode
    &#xA; : Variable Color space : YUV Compression&#xA;mode : Lossy Compression mode
    &#xA; : Lossy Delay : 0 Delay
    &#xA; : 00:00:00.000 Delay, origin : Container&#xA;Delay, origin : Container Stream size
    &#xA; : 108500874 Stream size : 103 MiB (96%)&#xA;Stream size : 103 MiB Stream size
    &#xA; : 103 MiB Stream size : 103 MiB Stream&#xA;size : 103.5 MiB Stream size
    &#xA; : 103 MiB (96%) Proportion of this stream : 0.95763&#xA;Default : Yes Default
    &#xA; : Yes Forced : No Forced
    &#xA; : No colour_description_present : Yes&#xA;colour_description_present_Source : Container Color range
    &#xA; : Limited colour_range_Source : Container Matrix&#xA;coefficients : BT.470 System B/G&#xA;matrix_coefficients_Source : Container

    &#xA;

    &#xA;

    How to make the output.webm be in correct time range(00:01:00 00:02:00) ????

    &#xA;