Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (82)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

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

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (16631)

  • azap from LinuxTV dvb-apps strange signal behavior with Hauppauge WinTV-HVR 950Q [migrated]

    27 février 2012, par mmoment

    What I want to do

    I have a Hauppauge WinTV-HVR 950Q USB-TV-Stick. I want to use this stick to successively tune to and read in a certain live TV stream.

    What I do

    I trigger a scan and save the scan results in a file. I call it channels.conf, like the v4l documentary proposes.

    scan /home/username/Documents/dvb/atsc/us-CA-SF-Bay-Area > /home/username/Documents/dvb/atsc/conf/home_channels.conf

    Everything works fine, the scan returns something like this(A correct channel file) :

    [0003]:503000000:8VSB:49:52:3
    [0005]:503000000:8VSB:81:84:5
    [0006]:503000000:8VSB:97:100:6
    26 San Francisco, CA:551000000:8VSB:49:52:3
    26 San Francisco, CA:551000000:8VSB:65:68:4
    KTSF-D3:551000000:8VSB:81:84:5
    KTSF-D4:551000000:8VSB:97:100:6
    KTSF-D5:551000000:8VSB:113:116:7
    KTSF-D6:551000000:8VSB:129:132:8
    KPIX-DT:563000000:8VSB:49:52:1
    KKPX ION:635000000:8VSB:49:52:3
    KKPX qubo:635000000:8VSB:65:68:4
    IONLife:635000000:8VSB:81:84:5
    100:635000000:8VSB:487:488:100
    200:635000000:8VSB:417:418:200
    201:635000000:8VSB:422:423:201
    202:635000000:8VSB:427:428:202
    203:635000000:8VSB:432:433:203
    204:635000000:8VSB:412:413:204
    300:635000000:8VSB:442:443:300
    400:635000000:8VSB:457:458:400
    KSTS-HD:683000000:8VSB:49:52:3
    Telemundo Exitos TV:683000000:8VSB:65:68:4
    CNL-SOI:683000000:8VSB:81:84:5
    KQEH:689000000:8VSB:49:52:1
    KQED:689000000:8VSB:65:68:2
    LIFE:689000000:8VSB:81:84:3
    KIDS:689000000:8VSB:97:100:4
    V-me:689000000:8VSB:113:116:5

    Then I tune to a channel from the scan results. KIDS for example :

    azap -r -c Documents/dvb/atsc/conf/channels.conf KIDS

    What I expect the program to do :

    I expect the program to be tuned and to deliver results similar to this :

    username@username:~$ azap -r -c Documents/dvb/atsc/conf/channels.conf KIDS
    using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
    tuning to 689000000 Hz
    video pid 0x0061, audio pid 0x0064

    status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00dc | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    ...

    What it does :

    In 2 out of 5 tries the azap just doesn't work at all.

    username@username:~$ azap -r -c Documents/dvb/atsc/conf/channels.conf KIDS
    using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
    tuning to 689000000 Hz
    video pid 0x0061, audio pid 0x0064

    status 00 | signal 0000 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 0000 | snr 00e4 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 0000 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 0000 | snr 00c2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 0000 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    ...

    The rest of the time it generally works initially, then switches the status to 00 and can not be used any more, even if there is incoming signal.

    status 1f | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00d2 | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00c8 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 00 | signal 00e6 | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    ...

    The output even shows that there is high signal to noise ratio, low or rather no block errors or uncorrected errors at all at first, then it
    This keeps me wondering since I see no reason for the program to switch. After double checking with a real TV I am very sure that I always have an incoming signal and that there should not be any reasons for a behavior like this.

    Question

    Can any of you guys see a reason for this behavior, could it be a problem with the Hardware that I'm using or rather a Software issue ? Did anybody experience the same issues, how did you fix it ? Any help is greatly appreciated !

  • FFmpeg WASM writeFile Stalls and Doesn't Complete in React App with Ant Design

    26 février, par raiyan khan

    I'm using FFmpeg WebAssembly (WASM) in a React app to process and convert a video file before uploading it. The goal is to resize the video to 720p using FFmpeg before sending it to the backend.

    


    Problem :

    


    Everything works up to fetching the file and confirming it's loaded into memory, but FFmpeg hangs at ffmpeg.writeFile() and does not proceed further. No errors are thrown.

    


    Code Snippet :

    


      

    • Loading FFmpeg

      


       const loadFFmpeg = async () => {
 if (loaded) return; // Avoid reloading if 
 already loaded

 const baseURL = 'https://unpkg.com/@ffmpeg/core@0.12.6/dist/umd';
 const ffmpeg = ffmpegRef.current;
 ffmpeg.on('log', ({ message }) => {
     messageRef.current.innerHTML = message;
     console.log(message);
 });
 await ffmpeg.load({
     coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, 'text/javascript'),
     wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, 'application/wasm'),
 });
 setLoaded(true);
 };

 useEffect(() => {
 loadFFmpeg()
 }, [])


      


    • 


    • Fetching and Writing File

      


        const convertVideoTo720p = async (videoFile) => {
       console.log("Starting video 
     conversion...");



 const { height } = await getVideoMetadata(videoFile);
 console.log(`Video height: ${height}`);

 if (height <= 720) {
     console.log("No conversion needed.");
     return videoFile;
 }

 const ffmpeg = ffmpegRef.current;
 console.log("FFmpeg instance loaded. Writing file to memory...");

 const fetchedFile = await fetchFile(videoFile);
 console.log("File fetched successfully:", fetchedFile);

 console.log("Checking FFmpeg memory before writing...");
 console.log(`File size: ${fetchedFile.length} bytes (~${(fetchedFile.length / 1024 / 1024).toFixed(2)} MB)`);

 if (!ffmpeg.isLoaded()) {
     console.error("FFmpeg is not fully loaded yet!");
     return;
 }

 console.log("Memory seems okay. Writing file to FFmpeg...");
 await ffmpeg.writeFile('input.mp4', fetchedFile);  // ❌ This line hangs, nothing after runs
 console.log("File successfully written to FFmpeg memory.");
      };


      


    • 


    


    Debugging Steps I've Tried :

    


      

    • Ensured FFmpeg is fully loaded before calling writeFile()
✅ ffmpeg.isLoaded() returns true.
    • 


    • Checked file fetch process :
✅ fetchFile(videoFile) successfully returns a Uint8Array.
    • 


    • Tried renaming the file to prevent caching issues
✅ Used a unique file name like video_${Date.now()}.mp4, but no change
    • 


    • Checked browser console for errors :
❌ No errors are displayed.
    • 


    • Tried skipping FFmpeg and uploading the raw file instead :
✅ Upload works fine without FFmpeg, so the issue is specific to FFmpeg.
    • 


    


    Expected Behavior

    


      

    • ffmpeg.writeFile('input.mp4', fetchedFile); should complete and allow FFmpeg to process the video.
    • 


    


    Actual Behavior

    


      

    • Execution stops at writeFile, and no errors are thrown.
    • 


    


    Environment :

    


      

    • React : 18.x
    • 


    • FFmpeg WASM Version : @ffmpeg/ffmpeg@0.12.15
    • 


    • Browser : Chrome 121, Edge 120
    • 


    • Operating System : Windows 11
    • 


    


    Question :
Why is FFmpeg's writeFile() stalling and never completing ?
How can I fix or further debug this issue ?

    


    Here is my full code :

    


    

    

    import { useNavigate } from "react-router-dom";&#xA;import { useEffect, useRef, useState } from &#x27;react&#x27;;&#xA;import { Form, Input, Button, Select, Space } from &#x27;antd&#x27;;&#xA;const { Option } = Select;&#xA;import { FaAngleLeft } from "react-icons/fa6";&#xA;import { message, Upload } from &#x27;antd&#x27;;&#xA;import { CiCamera } from "react-icons/ci";&#xA;import { IoVideocamOutline } from "react-icons/io5";&#xA;import { useCreateWorkoutVideoMutation } from "../../../redux/features/workoutVideo/workoutVideoApi";&#xA;import { convertVideoTo720p } from "../../../utils/ffmpegHelper";&#xA;import { FFmpeg } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;import { fetchFile, toBlobURL } from &#x27;@ffmpeg/util&#x27;;&#xA;&#xA;&#xA;const AddWorkoutVideo = () => {&#xA;    const [videoFile, setVideoFile] = useState(null);&#xA;    const [imageFile, setImageFile] = useState(null);&#xA;    const [loaded, setLoaded] = useState(false);&#xA;    const ffmpegRef = useRef(new FFmpeg());&#xA;    const videoRef = useRef(null);&#xA;    const messageRef = useRef(null);&#xA;    const [form] = Form.useForm();&#xA;    const [createWorkoutVideo, { isLoading }] = useCreateWorkoutVideoMutation()&#xA;    const navigate = useNavigate();&#xA;&#xA;    const videoFileRef = useRef(null); // Use a ref instead of state&#xA;&#xA;&#xA;    // Handle Video Upload&#xA;    const handleVideoChange = ({ file }) => {&#xA;        setVideoFile(file.originFileObj);&#xA;    };&#xA;&#xA;    // Handle Image Upload&#xA;    const handleImageChange = ({ file }) => {&#xA;        setImageFile(file.originFileObj);&#xA;    };&#xA;&#xA;    // Load FFmpeg core if needed (optional if you want to preload)&#xA;    const loadFFmpeg = async () => {&#xA;        if (loaded) return; // Avoid reloading if already loaded&#xA;&#xA;        const baseURL = &#x27;https://unpkg.com/@ffmpeg/core@0.12.6/dist/umd&#x27;;&#xA;        const ffmpeg = ffmpegRef.current;&#xA;        ffmpeg.on(&#x27;log&#x27;, ({ message }) => {&#xA;            messageRef.current.innerHTML = message;&#xA;            console.log(message);&#xA;        });&#xA;        await ffmpeg.load({&#xA;            coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, &#x27;text/javascript&#x27;),&#xA;            wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, &#x27;application/wasm&#x27;),&#xA;        });&#xA;        setLoaded(true);&#xA;    };&#xA;&#xA;    useEffect(() => {&#xA;        loadFFmpeg()&#xA;    }, [])&#xA;&#xA;    // Helper: Get video metadata (width and height)&#xA;    const getVideoMetadata = (file) => {&#xA;        return new Promise((resolve, reject) => {&#xA;            const video = document.createElement(&#x27;video&#x27;);&#xA;            video.preload = &#x27;metadata&#x27;;&#xA;            video.onloadedmetadata = () => {&#xA;                resolve({ width: video.videoWidth, height: video.videoHeight });&#xA;            };&#xA;            video.onerror = () => reject(new Error(&#x27;Could not load video metadata&#x27;));&#xA;            video.src = URL.createObjectURL(file);&#xA;        });&#xA;    };&#xA;&#xA;    // Inline conversion helper function&#xA;    // const convertVideoTo720p = async (videoFile) => {&#xA;    //     // Check the video resolution first&#xA;    //     const { height } = await getVideoMetadata(videoFile);&#xA;    //     if (height &lt;= 720) {&#xA;    //         // No conversion needed&#xA;    //         return videoFile;&#xA;    //     }&#xA;    //     const ffmpeg = ffmpegRef.current;&#xA;    //     // Load ffmpeg if not already loaded&#xA;    //     // await ffmpeg.load({&#xA;    //     //     coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, &#x27;text/javascript&#x27;),&#xA;    //     //     wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, &#x27;application/wasm&#x27;),&#xA;    //     // });&#xA;    //     // Write the input file to the ffmpeg virtual FS&#xA;    //     await ffmpeg.writeFile(&#x27;input.mp4&#x27;, await fetchFile(videoFile));&#xA;    //     // Convert video to 720p (scale filter maintains aspect ratio)&#xA;    //     await ffmpeg.exec([&#x27;-i&#x27;, &#x27;input.mp4&#x27;, &#x27;-vf&#x27;, &#x27;scale=-1:720&#x27;, &#x27;output.mp4&#x27;]);&#xA;    //     // Read the output file&#xA;    //     const data = await ffmpeg.readFile(&#x27;output.mp4&#x27;);&#xA;    //     console.log(data, &#x27;data from convertVideoTo720p&#x27;);&#xA;    //     const videoBlob = new Blob([data.buffer], { type: &#x27;video/mp4&#x27; });&#xA;    //     return new File([videoBlob], &#x27;output.mp4&#x27;, { type: &#x27;video/mp4&#x27; });&#xA;    // };&#xA;    const convertVideoTo720p = async (videoFile) => {&#xA;        console.log("Starting video conversion...");&#xA;&#xA;        // Check the video resolution first&#xA;        const { height } = await getVideoMetadata(videoFile);&#xA;        console.log(`Video height: ${height}`);&#xA;&#xA;        if (height &lt;= 720) {&#xA;            console.log("No conversion needed. Returning original file.");&#xA;            return videoFile;&#xA;        }&#xA;&#xA;        const ffmpeg = ffmpegRef.current;&#xA;        console.log("FFmpeg instance loaded. Writing file to memory...");&#xA;&#xA;        // await ffmpeg.writeFile(&#x27;input.mp4&#x27;, await fetchFile(videoFile));&#xA;        // console.log("File written. Starting conversion...");&#xA;        console.log("Fetching file for FFmpeg:", videoFile);&#xA;        const fetchedFile = await fetchFile(videoFile);&#xA;        console.log("File fetched successfully:", fetchedFile);&#xA;        console.log("Checking FFmpeg memory before writing...");&#xA;        console.log(`File size: ${fetchedFile.length} bytes (~${(fetchedFile.length / 1024 / 1024).toFixed(2)} MB)`);&#xA;&#xA;        if (fetchedFile.length > 50 * 1024 * 1024) { // 50MB limit&#xA;            console.error("File is too large for FFmpeg WebAssembly!");&#xA;            message.error("File too large. Try a smaller video.");&#xA;            return;&#xA;        }&#xA;&#xA;        console.log("Memory seems okay. Writing file to FFmpeg...");&#xA;        const fileName = `video_${Date.now()}.mp4`; // Generate a unique name&#xA;        console.log(`Using filename: ${fileName}`);&#xA;&#xA;        await ffmpeg.writeFile(fileName, fetchedFile);&#xA;        console.log(`File successfully written to FFmpeg memory as ${fileName}.`);&#xA;&#xA;        await ffmpeg.exec([&#x27;-i&#x27;, &#x27;input.mp4&#x27;, &#x27;-vf&#x27;, &#x27;scale=-1:720&#x27;, &#x27;output.mp4&#x27;]);&#xA;        console.log("Conversion completed. Reading output file...");&#xA;&#xA;        const data = await ffmpeg.readFile(&#x27;output.mp4&#x27;);&#xA;        console.log("File read successful. Creating new File object.");&#xA;&#xA;        const videoBlob = new Blob([data.buffer], { type: &#x27;video/mp4&#x27; });&#xA;        const convertedFile = new File([videoBlob], &#x27;output.mp4&#x27;, { type: &#x27;video/mp4&#x27; });&#xA;&#xA;        console.log(convertedFile, "converted video from convertVideoTo720p");&#xA;&#xA;        return convertedFile;&#xA;    };&#xA;&#xA;&#xA;    const onFinish = async (values) => {&#xA;        // Ensure a video is selected&#xA;        if (!videoFileRef.current) {&#xA;            message.error("Please select a video file.");&#xA;            return;&#xA;        }&#xA;&#xA;        // Create FormData&#xA;        const formData = new FormData();&#xA;        if (imageFile) {&#xA;            formData.append("image", imageFile);&#xA;        }&#xA;&#xA;        try {&#xA;            message.info("Processing video. Please wait...");&#xA;&#xA;            // Convert the video to 720p only if needed&#xA;            const convertedVideo = await convertVideoTo720p(videoFileRef.current);&#xA;            console.log(convertedVideo, &#x27;convertedVideo from onFinish&#x27;);&#xA;&#xA;            formData.append("media", videoFileRef.current);&#xA;&#xA;            formData.append("data", JSON.stringify(values));&#xA;&#xA;            // Upload manually to the backend&#xA;            const response = await createWorkoutVideo(formData).unwrap();&#xA;            console.log(response, &#x27;response from add video&#x27;);&#xA;&#xA;            message.success("Video added successfully!");&#xA;            form.resetFields(); // Reset form&#xA;            setVideoFile(null); // Clear file&#xA;&#xA;        } catch (error) {&#xA;            message.error(error.data?.message || "Failed to add video.");&#xA;        }&#xA;&#xA;        // if (videoFile) {&#xA;        //     message.info("Processing video. Please wait...");&#xA;        //     try {&#xA;        //         // Convert the video to 720p only if needed&#xA;        //         const convertedVideo = await convertVideoTo720p(videoFile);&#xA;        //         formData.append("media", convertedVideo);&#xA;        //     } catch (conversionError) {&#xA;        //         message.error("Video conversion failed.");&#xA;        //         return;&#xA;        //     }&#xA;        // }&#xA;        // formData.append("data", JSON.stringify(values)); // Convert text fields to JSON&#xA;&#xA;        // try {&#xA;        //     const response = await createWorkoutVideo(formData).unwrap();&#xA;        //     console.log(response, &#x27;response from add video&#x27;);&#xA;&#xA;        //     message.success("Video added successfully!");&#xA;        //     form.resetFields(); // Reset form&#xA;        //     setFile(null); // Clear file&#xA;        // } catch (error) {&#xA;        //     message.error(error.data?.message || "Failed to add video.");&#xA;        // }&#xA;    };&#xA;&#xA;    const handleBackButtonClick = () => {&#xA;        navigate(-1); // This takes the user back to the previous page&#xA;    };&#xA;&#xA;    const videoUploadProps = {&#xA;        name: &#x27;video&#x27;,&#xA;        // action: &#x27;https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload&#x27;,&#xA;        // headers: {&#xA;        //     authorization: &#x27;authorization-text&#x27;,&#xA;        // },&#xA;        // beforeUpload: (file) => {&#xA;        //     const isVideo = file.type.startsWith(&#x27;video/&#x27;);&#xA;        //     if (!isVideo) {&#xA;        //         message.error(&#x27;You can only upload video files!&#x27;);&#xA;        //     }&#xA;        //     return isVideo;&#xA;        // },&#xA;        // onChange(info) {&#xA;        //     if (info.file.status === &#x27;done&#x27;) {&#xA;        //         message.success(`${info.file.name} video uploaded successfully`);&#xA;        //     } else if (info.file.status === &#x27;error&#x27;) {&#xA;        //         message.error(`${info.file.name} video upload failed.`);&#xA;        //     }&#xA;        // },&#xA;        beforeUpload: (file) => {&#xA;            const isVideo = file.type.startsWith(&#x27;video/&#x27;);&#xA;            if (!isVideo) {&#xA;                message.error(&#x27;You can only upload video files!&#x27;);&#xA;                return Upload.LIST_IGNORE; // Prevents the file from being added to the list&#xA;            }&#xA;            videoFileRef.current = file; // Store file in ref&#xA;            // setVideoFile(file); // Store the file in state instead of uploading it automatically&#xA;            return false; // Prevent auto-upload&#xA;        },&#xA;    };&#xA;&#xA;    const imageUploadProps = {&#xA;        name: &#x27;image&#x27;,&#xA;        action: &#x27;https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload&#x27;,&#xA;        headers: {&#xA;            authorization: &#x27;authorization-text&#x27;,&#xA;        },&#xA;        beforeUpload: (file) => {&#xA;            const isImage = file.type.startsWith(&#x27;image/&#x27;);&#xA;            if (!isImage) {&#xA;                message.error(&#x27;You can only upload image files!&#x27;);&#xA;            }&#xA;            return isImage;&#xA;        },&#xA;        onChange(info) {&#xA;            if (info.file.status === &#x27;done&#x27;) {&#xA;                message.success(`${info.file.name} image uploaded successfully`);&#xA;            } else if (info.file.status === &#x27;error&#x27;) {&#xA;                message.error(`${info.file.name} image upload failed.`);&#xA;            }&#xA;        },&#xA;    };&#xA;    return (&#xA;        &lt;>&#xA;            <div classname="flex items-center gap-2 text-xl cursor-pointer">&#xA;                <faangleleft></faangleleft>&#xA;                <h1 classname="font-semibold">Add Video</h1>&#xA;            </div>&#xA;            <div classname="rounded-lg py-4 border-[#79CDFF] border-2 shadow-lg mt-8 bg-white">&#xA;                <div classname="space-y-[24px] min-h-[83vh] bg-light-gray rounded-2xl">&#xA;                    <h3 classname="text-2xl text-[#174C6B] mb-4 border-b border-[#79CDFF]/50 pb-3 pl-16 font-semibold">&#xA;                        Adding Video&#xA;                    </h3>&#xA;                    <div classname="w-full px-16">&#xA;                        / style={{ maxWidth: 600, margin: &#x27;0 auto&#x27; }}&#xA;                        >&#xA;                            {/* Section 1 */}&#xA;                            {/* <space direction="vertical" style="{{"> */}&#xA;                            {/* <space size="large" direction="horizontal" classname="responsive-space"> */}&#xA;                            <div classname="grid grid-cols-2 gap-8 mt-8">&#xA;                                <div>&#xA;                                    <space size="large" direction="horizontal" classname="responsive-space-section-2">&#xA;&#xA;                                        {/* Video */}&#xA;                                        Upload Video}&#xA;                                            name="media"&#xA;                                            className="responsive-form-item"&#xA;                                        // rules={[{ required: true, message: &#x27;Please enter the package amount!&#x27; }]}&#xA;                                        >&#xA;                                            <upload maxcount="{1}">&#xA;                                                <button style="{{" solid="solid">&#xA;                                                    <span style="{{" 600="600">Select a video</span>&#xA;                                                    <iovideocamoutline size="{20}" color="#174C6B"></iovideocamoutline>&#xA;                                                </button>&#xA;                                            </upload>&#xA;                                        &#xA;&#xA;                                        {/* Thumbnail */}&#xA;                                        Upload Image}&#xA;                                            name="image"&#xA;                                            className="responsive-form-item"&#xA;                                        // rules={[{ required: true, message: &#x27;Please enter the package amount!&#x27; }]}&#xA;                                        >&#xA;                                            <upload maxcount="{1}">&#xA;                                                <button style="{{" solid="solid">&#xA;                                                    <span style="{{" 600="600">Select an image</span>&#xA;                                                    <cicamera size="{25}" color="#174C6B"></cicamera>&#xA;                                                </button>&#xA;                                            </upload>&#xA;                                        &#xA;&#xA;                                        {/* Title */}&#xA;                                        Video Title}&#xA;                                            name="name"&#xA;                                            className="responsive-form-item-section-2"&#xA;                                        >&#xA;                                            <input type="text" placeholder="Enter video title" style="{{&amp;#xA;" solid="solid" />&#xA;                                        &#xA;                                    </space>&#xA;                                </div>&#xA;                            </div>&#xA;&#xA;                            {/* </space> */}&#xA;                            {/* </space> */}&#xA;&#xA;&#xA;                            {/* Submit Button */}&#xA;                            &#xA;                                <div classname="p-4 mt-10 text-center mx-auto flex items-center justify-center">&#xA;                                    &#xA;                                        <span classname="text-white font-semibold">{isLoading ? &#x27;Uploading...&#x27; : &#x27;Upload&#x27;}</span>&#xA;                                    &#xA;                                </div>&#xA;                            &#xA;                        &#xA;                    </div>&#xA;                </div>&#xA;            </div>&#xA;        >&#xA;    )&#xA;}&#xA;&#xA;export default AddWorkoutVideo

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

    Would appreciate any insights or suggestions. Thanks !

    &#xA;

  • Deploying on google App Engine : An error occurred : ffmpeg was killed with signal SIGABRT Error : ffmpeg was killed with signal SIGABRT

    27 août 2020, par Jérémy Gachon

    I wrote a node-js api, with node-js and fluent-ffmpeg :

    &#xA;

    &#x27;use strict&#x27;;&#xA;require(&#x27;babel-register&#x27;);&#xA;const path = require(&#x27;path&#x27;);    &#xA;const ffmpeg = require(&#x27;fluent-ffmpeg&#x27;);&#xA;

    &#xA;

    [...]

    &#xA;

    var infs = new ffmpeg&#xA;&#xA;infs.addInput(doc.data().url).outputOptions([&#xA;            &#x27;-preset slow&#x27;, &#x27;-g 48&#x27;, &#x27;-sc_threshold 0&#x27;,&#xA;            &#x27;-map 0:0&#x27;, &#x27;-map 0:1&#x27;, &#x27;-map 0:0&#x27;, &#x27;-map 0:1&#x27;,&#xA;            &#x27;-s:v:0 1280x720&#x27;, &#x27;-c:v:0 libx264&#x27;, &#x27;-b:v:0 2000k&#x27;,&#xA;            // "-var_stream_map", "&#x27;v:0,a:0 v:1,a:1&#x27;",&#xA;            &#x27;-master_pl_name ./&#x27; &#x2B; req.params.id &#x2B; &#x27;/master&#x27; &#x2B; req.params.id &#x2B; &#x27;.m3u8&#x27;,&#xA;            &#x27;-f hls&#x27;, &#x27;-hls_time 6&#x27;, &#x27;-hls_list_size 0&#x27;,&#xA;            &#x27;-hls_segment_filename ./&#x27; &#x2B; req.params.id &#x2B; &#x27;/fileSequence|&#x27; &#x2B; req.params.id &#x2B; &#x27;|%d|v%v.ts&#x27;,&#xA;            &#x27;-max_muxing_queue_size 1024&#x27;,&#xA;        ]).output(&#x27;./&#x27; &#x2B; req.params.id &#x2B; &#x27;/video&#x27; &#x2B; req.params.id &#x2B; &#x27;.m3u8&#x27;)&#xA;            .on(&#x27;start&#x27;, function (commandLine) {&#xA;                console.log(&#x27;Spawned Ffmpeg with command: &#x27; &#x2B; commandLine);&#xA;            })&#xA;            .on(&#x27;error&#x27;, function (err, stdout, stderr) {&#xA;                console.log(&#x27;An error occurred: &#x27; &#x2B; err.message, err, stderr);&#xA;            })&#xA;            .on(&#x27;progress&#x27;, function (progress) {&#xA;                console.log(&#x27;Processing: &#x27; &#x2B; progress.percent &#x2B; &#x27;% done&#x27;)&#xA;            })&#xA;            .on(&#x27;end&#x27;, function (err, stdout, stderr) {&#xA;&#xA;                console.log(&#x27;Finished processing!&#x27; /*, err, stdout, stderr*/)&#xA;            })&#xA;            .run()&#xA;        res.status(200).send(&#x27;GG&#x27;).end();&#xA;    } &#xA;   });&#xA;

    &#xA;

    [...]

    &#xA;

    That work with

    &#xA;

    &#xA;

    node app.js

    &#xA;

    &#xA;

    on my macbook pro, but when i do

    &#xA;

    &#xA;

    gcloud app deploy

    &#xA;

    &#xA;

    and I call the public url, I have this logs :

    &#xA;

    Processing: undefined% done&#xA;An error occurred: ffmpeg was killed with signal SIGABRT Error: ffmpeg was killed with signal SIGABRT &#xA;

    &#xA;

    Here is my app.yaml :

    &#xA;

        # Copyright 2017, Google, Inc.&#xA;# Licensed under the Apache License, Version 2.0 (the "License");&#xA;# you may not use this file except in compliance with the License.&#xA;# You may obtain a copy of the License at&#xA;#&#xA;#    http://www.apache.org/licenses/LICENSE-2.0&#xA;#&#xA;# Unless required by applicable law or agreed to in writing, software&#xA;# distributed under the License is distributed on an "AS IS" BASIS,&#xA;# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#xA;# See the License for the specific language governing permissions and&#xA;# limitations under the License.&#xA;&#xA;# [START gae_flex_quickstart_yaml]&#xA;runtime: nodejs&#xA;env: flex&#xA;&#xA;# This sample incurs costs to run on the App Engine flexible environment.&#xA;# The settings below are to reduce costs during testing and are not appropriate&#xA;# for production use. For more information, see:&#xA;# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml&#xA;manual_scaling:&#xA;  instances: 1&#xA;resources:&#xA;  cpu: 1&#xA;  memory_gb: 6&#xA;  disk_size_gb: 30&#xA;&#xA;# [END gae_flex_quickstart_yaml]&#xA;

    &#xA;

    enter image description here

    &#xA;

    How can I do to deploy correctly my node-js api on google app engine ?

    &#xA;

    Thank's in advance.

    &#xA;

    Jérémy.

    &#xA;