Recherche avancée

Médias (0)

Mot : - Tags -/upload

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

Autres articles (70)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

Sur d’autres sites (12368)

  • React Native Expo File System : open failed : ENOENT (No such file or directory)

    9 février 2023, par coloraday

    I'm getting this error in a bare React Native project :

    


    Possible Unhandled Promise Rejection (id: 123):
Error: /data/user/0/com.filsufius.VisionishAItest/files/image-new-♥d.jpg: open failed: ENOENT (No such file or directory)


    


    The same code was saving to File System with no problem yesterday, but today as you can see I am getting an ENOENT error, plus I am getting these funny heart shapes ♥d in the path. Any pointers as to what might be causing this, please ? I use npx expo run:android to builld app locally and expo start —dev-client to run on a physical Android device connected through USB.

    


    import { Image, View, Text, StyleSheet } from "react-native";&#xA;import * as FileSystem from "expo-file-system";&#xA;import RNFFmpeg from "react-native-ffmpeg";&#xA;import * as tf from "@tensorflow/tfjs";&#xA;import * as cocossd from "@tensorflow-models/coco-ssd";&#xA;import { decodeJpeg, bundleResourceIO } from "@tensorflow/tfjs-react-native";&#xA;&#xA;const Record = () => {&#xA;  const [frames, setFrames] = useState([]);&#xA;  const [currentFrame, setCurrentFrame] = useState(0);&#xA;  const [model, setModel] = useState(null);&#xA;  const [detections, setDetections] = useState([]);&#xA;&#xA;  useEffect(() => {&#xA;    const fileName = "image-new-%03d.jpg";&#xA;    const outputPath = FileSystem.documentDirectory &#x2B; fileName;&#xA;    RNFFmpeg.execute(&#xA;      "-y -i https://res.cloudinary.com/dannykeane/video/upload/sp_full_hd/q_80:qmax_90,ac_none/v1/dk-memoji-dark.m3u8 -vf fps=25 -f mjpeg " &#x2B;&#xA;        outputPath&#xA;    )&#xA;      .then((result) => {&#xA;        console.log("Extraction succeeded:", result);&#xA;        FileSystem.readDirectoryAsync(FileSystem.documentDirectory).then(&#xA;          (files) => {&#xA;            setFrames(&#xA;              files&#xA;                .filter((file) => file.endsWith(".jpg"))&#xA;                .sort((a, b) => {&#xA;                  const aNum = parseInt(a.split("-")[2].split(".")[0]);&#xA;                  const bNum = parseInt(b.split("-")[2].split(".")[0]);&#xA;                  return aNum - bNum;&#xA;                })&#xA;            );&#xA;          }&#xA;        );&#xA;      })&#xA;      .catch((error) => {&#xA;        console.error("Extraction failed:", error);&#xA;      });&#xA;  }, []);&#xA;&#xA;  useEffect(() => {&#xA;    tf.ready().then(() => cocossd.load().then((model) => setModel(model)));&#xA;  }, []);&#xA;  useEffect(() => {&#xA;    if (frames.length &amp;&amp; model) {&#xA;      const intervalId = setInterval(async () => {&#xA;        setCurrentFrame((currentFrame) =>&#xA;          currentFrame === frames.length - 1 ? 0 : currentFrame &#x2B; 1&#xA;        );&#xA;        const path = FileSystem.documentDirectory &#x2B; frames[currentFrame];&#xA;        const imageAssetPath = await FileSystem.readAsStringAsync(path, {&#xA;          encoding: FileSystem.EncodingType.Base64,&#xA;        });&#xA;        const imgBuffer = tf.util.encodeString(imageAssetPath, "base64").buffer;&#xA;        const imageData = new Uint8Array(imgBuffer);&#xA;        const imageTensor = decodeJpeg(imageData, 3);&#xA;        console.log("after decodeJpeg.");&#xA;        const detections = await model.detect(imageTensor);&#xA;        console.log(detections);&#xA;        setDetections(detections);&#xA;      }, 100);&#xA;      return () => clearInterval(intervalId);&#xA;    }&#xA;  }, [frames, model]);&#xA;&#xA;  &#xA;  return (&#xA;    <view style="{styles.container}">&#xA;      &#xA;      <view style="{styles.predictions}">&#xA;        {detections.map((p, i) => (&#xA;          <text key="{i}" style="{styles.text}">&#xA;            {p.class}: {(p.score * 100).toFixed(2)}%&#xA;          </text>&#xA;        ))}&#xA;      </view>&#xA;    </view>&#xA;  );&#xA;};&#xA;&#xA;const styles = StyleSheet.create({&#xA;  container: {&#xA;    flex: 1,&#xA;    alignItems: "center",&#xA;    justifyContent: "center",&#xA;  },&#xA;  image: {&#xA;    width: 300,&#xA;    height: 300,&#xA;    resizeMode: "contain",&#xA;  },&#xA;  predictions: {&#xA;    width: 300,&#xA;    height: 100,&#xA;    marginTop: 20,&#xA;  },&#xA;  text: {&#xA;    fontSize: 14,&#xA;    textAlign: "center",&#xA;  },&#xA;});&#xA;&#xA;export default Record;```&#xA;

    &#xA;

  • Different ways of embedding the Piwik tracking code for faster website performance

    18 avril 2017, par InnoCraft — Community, Development

    Many studies have shown that performance matters a lot. For each 100ms a websites takes longer to load, a business may lose about 0.1% to 1% in revenue. It also matters because Google judges page speed as a ranking factor for search results page. At InnoCraft, we help our clients optimizing their Piwik integration and recommend different ways of embedding the tracking code tailored to their needs. The best way to embed the tracking code depends on your website, what you want to achieve, and how important tracking is to you.

    This technical blog post mainly focuses on improving the time to load your website. This is an important metric as for example Google usually measures the time it took to load a page. Many businesses therefore want to get to the page load event as quickly as possible.

    The regular way of embedding the tracking code

    By default, Piwik is embedded in the header or footer of your website. This is a sensible default. While it is loaded asynchronously and deferred, it still does delay the onload event. Depending on the performance of your Piwik, how fast your website loads, how your website’s resources are embedded, and other factors you may want to consider alternatives. Three of them I will introduce below.

    Embedding the tracker after the load event

    To ensure that your website will always load even if the Piwik server is un-available, you may want to load the tracking code only after the website is loaded like this :

    var _paq = _paq || [];
    _paq.push(["trackPageView"]);
    _paq.push(["enableLinkTracking"]);

    function embedTrackingCode() {
      var u="https://your.piwik.domain/";
      _paq.push(["setTrackerUrl", u+"piwik.php"]);
      _paq.push(["setSiteId", "1"]);

      var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
      g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);    
    }

    if (window.addEventListener) {
       window.addEventListener("load", embedTrackingCode, false);
    } else if (window.attachEvent) {
       window.attachEvent("onload",embedTrackingCode);
    } else {
       embedTrackingCode();
    }

    The downside is you won’t track all of your visitors because some will have already left your website by the time your website is fully loaded. Especially when you have a JavaScript-heavy website or when your website takes longer to load in general. To detect the load event correctly cross browser, you may want to use a library like jQuery.

    Delaying the tracking

    Another technique is to load the tracking with a little delay at the end of your website like this :

    setTimeout(function () {
       embedTrackingCode();
    }, 5);

    This time the tracking script will still track most of your visitors but does not slow down loading the rest of your website as much as it would do by default (at least perceived). In some cases, you will notice a performance improvement when looking at the “time to load” but it depends on your website.

    Not loading the JavaScript Tracker at all

    With Piwik you also have the option to not embed the tracking code into your websites at all and instead generate reports from the webserver logs using Piwik Log Analytics. This works very well but some data might not be available like the device resolution which can be only captured using JavaScript. On the bright side this solution also captures users with ad blockers or tracking blockers.

    Questions ?

    We invite you to test different ways to see what makes sense for you and how it affects your website performance as well as the perceived performance. If you have any questions, feel free to get in touch with us.

    Read on

    The last post in this series is Performance optimizations you can apply today to load the Piwik JavaScript tracker faster.

  • Ruby on Rails : FFMPEG fails after upgrade Mountain Lion to Mavericks

    25 octobre 2013, par CristianOrellanaBak

    yesterday I upgrade my OS fom Mountain Lion to Mavericks and all goes well until recently.

    We are developing a Ruby on Rails v3.2.13 application for manage videos (only MP4), which worked fine until yesterday with Mountain Lion. Today (with Mavericks) I try to upload a video but get the following error in the console :

    Running transcoding...
    ffmpeg -y -i /Users/ME/Documents/workspace/rails/rails3-devise/public/uploads/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.mp4 -ss 0 -s 180x110 -vframes 1 -f image2 -aspect 1.6363636363636365 /Users/Me/Documents/workspace/rails/rails3-devise/public/uploads/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.png

    Transcoding of /Users/Me/Documents/workspace/rails/rails3-devise/public/uploads/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.mp4 to /Users/Me/Documents/workspace/railspublic/uploads/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.png succeeded

    Running transcoding...
    ffmpeg -y -i /Users/Me/Documents/workspace/rails/public/uploads/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.mp4 -ss 0 -s 180x110 -vframes 1 -f image2 -aspect 1.6363636363636365 /Users/Me/Documents/workspace/rails/rails3-devise/public/uploads/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.png

    Failed encoding...
    ffmpeg -y -i /Users/Me/Documents/workspace/rails/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.mp4 -ss 0 -s 180x110 -vframes 1 -f image2 -aspect 1.6363636363636365 /Users/Me/Documents/workspace/rails/uploads/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.png

    ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
     built on Sep 28 2013 20:09:07 with Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/1.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --extra-cflags=&#39;-I/usr/local/Cellar/openjpeg/1.5.1/include/openjpeg-1.5 &#39;
     libavutil      52. 18.100 / 52. 18.100
     libavcodec     54. 92.100 / 54. 92.100
     libavformat    54. 63.104 / 54. 63.104
     libavdevice    54.  3.103 / 54.  3.103
     libavfilter     3. 42.103 /  3. 42.103
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  2.100 / 52.  2.100
    [mp3 @ 0x7fd493820c00] Format mp3 detected only with low score of 1, misdetection possible!
    [mp3 @ 0x7fd49380a000] Header missing
       Last message repeated 1 times
    [mp3 @ 0x7fd493820c00] decoding for stream 0 failed
    [mp3 @ 0x7fd493820c00] Could not find codec parameters for stream 0 (Audio: mp2, 0 channels, s16p): unspecified frame size
    Consider increasing the value for the &#39;analyzeduration&#39; and &#39;probesize&#39; options
    [mp3 @ 0x7fd493820c00] Estimating duration from bitrate, this may be inaccurate
    /Users/Me/Documents/workspace/rails/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.mp4: could not find codec parameters

    Errors: no output file created.

    I reinstall the dependencies of ffmpeg, but the problem persists.

    Any ideas or suggestions to solve the problem ?
    Thank you very much !

    EDIT NOTE : I notice this when run brew upgrade :

    ==> Upgrading ffmpeg
    ==> Installing ffmpeg dependency: libass
    Error: libass dependency fontconfig was built with the following
    C++ standard library: libstdc++ (from clang)

    This is incompatible with the standard library being used
    to build libass: libc++ (from clang)

    Please reinstall fontconfig using a compatible compiler.
    hint: Check https://github.com/mxcl/homebrew/wiki/C++-Standard-Libraries