Recherche avancée

Médias (0)

Mot : - Tags -/flash

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (97)

  • 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

  • Participer à sa documentation

    10 avril 2011

    La documentation est un des travaux les plus importants et les plus contraignants lors de la réalisation d’un outil technique.
    Tout apport extérieur à ce sujet est primordial : la critique de l’existant ; la participation à la rédaction d’articles orientés : utilisateur (administrateur de MediaSPIP ou simplement producteur de contenu) ; développeur ; la création de screencasts d’explication ; la traduction de la documentation dans une nouvelle langue ;
    Pour ce faire, vous pouvez vous inscrire sur (...)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (6603)

  • FFmpeg-wasm unpredictable errors with next js

    21 juillet, par hjtomi

    I use ffmpeg-wasm in next-js.

    


    Whenever I execute an ffmpeg command it has a chance that it throws a runtime error "memory access out of bounds". In this case I created a page that has an file selection html element and a button that converts each image to .jpeg format with the following command :

    


    await ffmpeg.exec(['-i', originalFileName, '-q:v', '5', convertedFileName]);


    


    I have tried the same process with different images, extensions, sizes, restarting the application, restarting the computer, different browsers, mobile/desktop and sometimes it works, sometimes it doesn't. I feel like there is something that is out of my control.

    


    Maybe something that has to do with webassembly itself.

    


    In each runtime it has a 50-50 chance that ffmpeg will work or not.

    


    I have tried changing the target extension to different types.

    


    I have tried changing the ffmpeg command entirely to make it do something else.

    


    Writing the files to the virtual file system works as expected.

    


    I am on windows 10 using next-js version 15.3.5 and ffmpeg version 0.12.10

    


    &#x27;use client&#x27;;&#xA;&#xA;import * as React from &#x27;react&#x27;;&#xA;import { FFmpeg } from &#x27;@ffmpeg/ffmpeg&#x27;; // Import FFmpeg&#xA;import { fetchFile, toBlobURL } from &#x27;@ffmpeg/util&#x27;; // Import fetchFile&#xA;&#xA;export default function Page() {&#xA;  const [files, setFiles] = React.useState([]);&#xA;  const [error, setError] = React.useState<string null="null">(null);&#xA;&#xA;  // FFmpeg related states and ref&#xA;  const ffmpegRef = React.useRef<ffmpeg null="null">(null);&#xA;  const [ffmpegLoaded, setFFmpegLoaded] = React.useState(false);&#xA;  const [isConvertingImages, setIsConvertingImages] = React.useState(false);&#xA;  const [videoGenerationProgress, setVideoGenerationProgress] = React.useState<string>(&#x27;&#x27;);&#xA;&#xA;  // --- Load FFmpeg on component mount ---&#xA;  React.useEffect(() => {&#xA;    const loadFFmpeg = async () => {&#xA;      const baseURL = "https://unpkg.com/@ffmpeg/core@0.12.10/dist/umd";&#xA;      try {&#xA;        const ffmpeg = new FFmpeg();&#xA;        // Set up logging for FFmpeg progress&#xA;        ffmpeg.on(&#x27;log&#x27;, ({ message }) => {&#xA;          if (message.includes(&#x27;frame=&#x27;)) {&#xA;            setVideoGenerationProgress(message);&#xA;          }&#xA;        });&#xA;        await ffmpeg.load({&#xA;              coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, "text/javascript"),&#xA;              wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, "application/wasm"),&#xA;            });&#xA;        ffmpegRef.current = ffmpeg;&#xA;        setFFmpegLoaded(true);&#xA;        console.log(&#x27;FFmpeg loaded successfully!&#x27;);&#xA;      } catch (err) {&#xA;        console.error(&#x27;Failed to load FFmpeg:&#x27;, err);&#xA;        setError(&#x27;Failed to load video processing tools.&#x27;);&#xA;      }&#xA;    };&#xA;&#xA;    loadFFmpeg();&#xA;  }, []);&#xA;&#xA;  // --- Internal file selection logic ---&#xA;  const handleFileChange = (e: React.ChangeEvent<htmlinputelement>) => {&#xA;    if (e.target.files &amp;&amp; e.target.files.length > 0) {&#xA;      const newFiles = Array.from(e.target.files).filter(file => file.type.startsWith(&#x27;image/&#x27;)); // Only accept images&#xA;      setFiles(newFiles);&#xA;      setError(null);&#xA;    }&#xA;  };&#xA;&#xA;  // --- Handle Image conversion ---&#xA;  const handleConvertImages = async () => {&#xA;    if (!ffmpegLoaded || !ffmpegRef.current) {&#xA;      setError(&#x27;FFmpeg is not loaded yet. Please wait.&#x27;);&#xA;      return;&#xA;    }&#xA;    if (files.length === 0) {&#xA;      setError(&#x27;Please select images first to generate a video.&#x27;);&#xA;      return;&#xA;    }&#xA;&#xA;    setIsConvertingImages(true);&#xA;    setError(null);&#xA;    setVideoGenerationProgress(&#x27;&#x27;);&#xA;&#xA;    try {&#xA;      const ffmpeg = ffmpegRef.current;&#xA;      const targetExtension = &#x27;jpeg&#x27;; // &lt;--- Define your target extension here (e.g., &#x27;png&#x27;, &#x27;webp&#x27;)&#xA;      const convertedImageNames: string[] = [];&#xA;&#xA;      // Convert all uploaded images to the target format&#xA;      for (let i = 0; i &lt; files.length; i&#x2B;&#x2B;) {&#xA;          const file = files[i];&#xA;          // Give the original file a unique name in FFmpeg&#x27;s VFS&#xA;          const originalFileName = `original_image_${String(i).padStart(3, &#x27;0&#x27;)}.${file.name.split(&#x27;.&#x27;).pop()}`;&#xA;          // Define the output filename with the target extension&#xA;          const convertedFileName = `converted_image_${String(i).padStart(3, &#x27;0&#x27;)}.${targetExtension}`;&#xA;          convertedImageNames.push(convertedFileName);&#xA;&#xA;          // Write the original file data to FFmpeg&#x27;s virtual file system&#xA;          await ffmpeg.writeFile(`${originalFileName}`, await fetchFile(file));&#xA;          console.log(`Wrote original ${originalFileName} to FFmpeg FS`);&#xA;&#xA;          setVideoGenerationProgress(`Converting ${file.name} to ${targetExtension.toUpperCase()}...`);&#xA;&#xA;          await ffmpeg.exec([&#x27;-i&#x27;, originalFileName, &#x27;-q:v&#x27;, &#x27;5&#x27;, convertedFileName]);     //    &lt;------&#xA;&#xA;          console.log(`Converted ${originalFileName} to ${convertedFileName}`);&#xA;&#xA;          // Delete the original file from VFS to free up memory&#xA;          await ffmpeg.deleteFile(originalFileName);&#xA;          console.log(`Deleted original ${originalFileName} from FFmpeg FS`);&#xA;      }&#xA;&#xA;      setFiles([]);&#xA;&#xA;      setVideoGenerationProgress(`All images converted to ${targetExtension.toUpperCase()}.`);&#xA;    } catch (err) {&#xA;      console.error(&#x27;Error converting images:&#x27;, err);&#xA;      setError(`Failed to convert images: ${err instanceof Error ? err.message : String(err)}`);&#xA;    } finally {&#xA;      setIsConvertingImages(false);&#xA;    }&#xA;  };&#xA;&#xA;  return (&#xA;    <div classname="min-h-screen bg-gray-100 flex items-center justify-center p-4 relative overflow-hidden">&#xA;      <div classname="bg-white p-8 rounded-lg shadow-xl w-full max-w-md z-10 relative"> {/* Ensure content is above overlay */}&#xA;        <h2 classname="text-2xl font-semibold text-gray-800 mb-6 text-center">Select your images</h2>&#xA;&#xA;        {/* Regular File Input Area (still needed for click-to-select) */}&#xA;        > document.getElementById(&#x27;file-input&#x27;)?.click()}&#xA;        >&#xA;        &#xA;          &#xA;          <svg classname="mx-auto h-12 w-12 text-gray-400" fill="none" viewbox="0 0 24 24" stroke="currentColor">&#xA;            <path strokelinecap="round" strokelinejoin="round" strokewidth="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path>&#xA;          </svg>&#xA;          <p classname="mt-2 text-sm text-gray-600">&#xA;            <span classname="font-medium text-blue-600">Click to select</span>&#xA;          </p>&#xA;          <p classname="text-xs text-gray-500">Supports multiple formats</p>&#xA;        </div>&#xA;&#xA;        {/* Selected Files Display */}&#xA;        {files.length > 0 &amp;&amp; (&#xA;          <div data-testid="selected-files-display" classname="selected-files-display mt-4 p-3 bg-blue-50 border border-blue-200 rounded-md text-sm text-blue-800">&#xA;            <p classname="font-semibold mb-2">Selected Files ({files.length}):</p>&#xA;            <ul classname="max-h-40 overflow-y-auto">&#xA;              {files.map((file) => (&#xA;                <li key="{file.name}" classname="flex items-center justify-between py-1">&#xA;                  <span>{file.name}</span>&#xA;                </li>&#xA;              ))}&#xA;            </ul>&#xA;          </div>&#xA;        )}&#xA;&#xA;        {/* Error Message */}&#xA;        {error &amp;&amp; (&#xA;          <div classname="mt-4 p-3 bg-red-50 border border-red-200 rounded-md text-sm text-red-800">&#xA;            {error}&#xA;          </div>&#xA;        )}&#xA;&#xA;        {/* Image conversion Progress/Status */}&#xA;        {isConvertingImages &amp;&amp; (&#xA;          <div classname="mt-4 p-3 bg-purple-50 border border-purple-200 rounded-md text-sm text-purple-800 text-center">&#xA;            <p classname="font-semibold">Converting images</p>&#xA;            <p classname="text-xs mt-1">{videoGenerationProgress}</p>&#xA;          </div>&#xA;        )}&#xA;        {!ffmpegLoaded &amp;&amp; (&#xA;          <div classname="mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-md text-sm text-yellow-800 text-center">&#xA;            Loading video tools (FFmpeg)... Please wait.&#xA;          </div>&#xA;        )}&#xA;&#xA;        {/* Convert images button */}&#xA;        &#xA;          Convert images&#xA;        &#xA;      </div>&#xA;    &#xA;  );&#xA;}&#xA;</htmlinputelement></string></ffmpeg></string>

    &#xA;

    The next js page above

    &#xA;

  • pixfmt : add P010 pixel format

    8 décembre 2015, par Hendrik Leppkes
    pixfmt : add P010 pixel format
    

    P010 is the 10-bit variant of NV12 (planar luma, packed chroma), using two
    bytes per component to store 10-bit data plus 6-bit zeroes in the LSBs.

    Signed-off-by : Anton Khirnov <anton@khirnov.net>

    • [DBH] doc/APIchanges
    • [DBH] libavutil/pixdesc.c
    • [DBH] libavutil/pixfmt.h
    • [DBH] libavutil/version.h
  • Can't use latest FFMpeg-PHP because my newly installed FFProbe does not support loglevel and quiet

    20 septembre 2016, par Richard Mcfriend Oluwamuyiwa

    Please I just installed ffmpeg and ffmpeg-php using brew install on my OS X 10.10 but i can’t use the FFMpeg-PHP because my FFProbe does not support '-loglevel' and 'quiet' options.

    I get this error from

    Fatal error: Uncaught Symfony\Component\Process\Exception\RuntimeException: The process has been signaled with signal "5"

    I just installed it tonight using

    brew install ffmpeg ....

    My composer.son is

    {
       "require": {
           "php-ffmpeg/php-ffmpeg": "~0.5"
       }
    }

    And I just installed the Composer too using the instruction on their website. And when I run composer, I get version 1.2.1 which is the latest.

    I am trying to run the FFMpeg demo code :

    require __DIR__ . '/vendor/autoload.php';

    $ffmpeg = FFMpeg\FFMpeg::create(array(
       'ffmpeg.binaries'  => '/usr/local/bin/ffmpeg',
       'ffprobe.binaries' => '/usr/local/bin/ffprobe',
       'timeout'          => 3600, // The timeout for the underlying process
       'ffmpeg.threads'   => 12,   // The number of threads that FFMpeg should use
    ));
    $video = $ffmpeg->open('video.mp4');

    $video
       ->filters()
       ->resize(new FFMpeg\Coordinate\Dimension(320, 240))
       ->synchronize();

    $video
       ->frame(FFMPeg\Coordinate\TimeCode::fromSeconde(10))
       ->save('frame.jpg');

    $video
       ->save(new FFMpeg\Format\Video\X265(), 'ff-video-x264.mpg')
       ->save(new FFMpeg\Format\Video\WMV(), 'ff-video-wmv.wmv')
       ->save(new FFMpeg\Format\Video\WebM(), 'ff-video-webm.webm');

    Any help is appreciated. I really need it working for a project.