Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

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

Autres articles (94)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (7424)

  • ffmpeg with Flutter - Error in my code - Video not created

    30 juillet 2020, par cssler

    I try to create a video from images with flutter and ffmpeg. I think the logic of my code is correct, but I always get the return value 1 which says that the execute was not successfull.

    


    Do you find the error in my code ?

    


    Future<void> _onCreateVideoFromImages() async {&#xA;      Directory tempDir = await getTemporaryDirectory();&#xA;      String tempPath = tempDir.path;&#xA;&#xA;      final allPictures = await picturesData.getPicturesFromAlbum(albumID);&#xA;&#xA;      List textFileMap = [];&#xA;&#xA;      for (var i = 0; i &lt; allPictures.length; i&#x2B;&#x2B;) {&#xA;        var file = File(allPictures[i].path);&#xA;&#xA;        final newFile = await file&#xA;            .copySync("$tempPath/img${i.toString().padLeft(4, &#x27;0&#x27;)}.jpg");&#xA;&#xA;        print("File has been moved successfully to temporary folder: $newFile");&#xA;&#xA;        textFileMap.add("file &#x27;" &#x2B; newFile.path &#x2B; "&#x27;");&#xA;      }&#xA;&#xA;      print("Final list:");&#xA;      print(textFileMap);&#xA;&#xA;      print("Create txt file for ffmpeg");&#xA;      final File file = File(&#x27;${tempPath}/images.txt&#x27;);&#xA;      final textFile = await file.writeAsString(textFileMap.join("\n"));&#xA;      print("txt file created successfully: $textFile");&#xA;&#xA;      await _flutterFFmpeg.execute(&#xA;              "ffmpeg -f concat -safe 0 -i $textFile -c copy $tempPath/output.mp4")&#xA;          .then((rc) {&#xA;        if (rc == 0) {&#xA;          print("Video completed");&#xA;        } else {&#xA;          print(rc); // Returns 1&#xA;        }&#xA;      });&#xA;    }&#xA;</void>

    &#xA;

    And here the console log

    &#xA;

    flutter: File has been moved successfully to temporary folder: File: &#x27;/var/mobile/Containers/Data/Application/C28A04D5-76DF-450B-8F63-75CD39BC927F/Library/Caches/img0001.jpg&#x27;&#xA;flutter: Final list::&#xA;flutter: [file &#x27;/var/mobile/Containers/Data/Application/C28A04D5-76DF-450B-8F63-75CD39BC927F/Library/Caches/img0000.jpg&#x27;, file &#x27;/var/mobile/Containers/Data/Application/C28A04D5-76DF-450B-8F63-75CD39BC927F/Library/Caches/img0001.jpg&#x27;]&#xA;flutter: Create txt file for ffmpeg"&#xA;flutter: txt file created successfully: &#x27;/var/mobile/Containers/Data/Application/C28A04D5-76DF-450B-8F63-75CD39BC927F/Library/Caches/images.txt&#x27;&#xA;flutter: Code: 1&#xA;

    &#xA;

    I appreciate your help !

    &#xA;

  • How to build list of tasks for asyncio.gather in Python 3.8

    22 juillet 2020, par mcgregor94086

    Below I have attached a test program to demonstrate a problem I am having with asyncio.gather throwing a TypeError.

    &#xA;

    My objective : To make multiple concurrent asynchronous calls to capture camera images to files from an array of USB cameras attached to my computer. When all cameras have completed their async captures, I want then resume processing.

    &#xA;

    The async coroutine take_image() shown here makes a system call to the "ffmpeg" application that captures an image from the specified camera to a specified file.

    &#xA;

    import asyncio&#xA;import os&#xA;import subprocess&#xA;import time&#xA;&#xA;async def take_image(camera_id, camera_name, image_file_path, image_counter):&#xA;    image_capture_tic = time.perf_counter()&#xA;    try:&#xA;        run_cmd = subprocess.run( ["ffmpeg", &#x27;-y&#x27;, &#x27;-hide_banner&#x27;, &#x27;-f&#x27;, &#x27;avfoundation&#x27;, &#x27;-i&#x27;, camera_id,&#xA;                                   &#x27;-frames:v&#x27;, &#x27;1&#x27;, &#x27;-f&#x27;, &#x27;image2&#x27;, image_file_path], universal_newlines=True,&#xA;                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)  # Note, ffmpeg writes to stderr, not stdout!&#xA;    except Exception as e:&#xA;        print("Error: Unable to capture image for", image_file_path)&#xA;        return "NO IMAGE!"&#xA;&#xA;    image_capture_toc = time.perf_counter()&#xA;    print(f"{image_counter}: Captured {camera_name} image in: {image_capture_toc - image_capture_tic:0.0f} seconds")&#xA;    return camera_name&#xA;

    &#xA;

    The main() routine shown below takes a list of multiple cameras, and iterating over each camera in the list, main() makes creates an asyncio task for each camera using asyncio.create_task(). Each task is added to a list of tasks.

    &#xA;

    Once all image capture tasks have been started, I await their completion using await asyncio.gather(tasks).

    &#xA;

    async def main():&#xA;    tic = time.perf_counter()&#xA;    camera_list = [(&#x27;0&#x27;, &#x27;FHD Camera #1&#x27;),  (&#x27;1&#x27;, &#x27;FHD Camera #2&#x27;), (&#x27;2&#x27;, &#x27;FHD Camera #3&#x27;), ]&#xA;    image_counter = 1&#xA;    tasks = []&#xA;    for camera_pair in camera_list:&#xA;        camera_id, camera_name = camera_pair&#xA;        image_file_name = &#x27;img&#x27; &#x2B; str(image_counter) &#x2B; "-cam" &#x2B; str(camera_id)  &#x2B; "-" &#x2B; camera_name &#x2B; &#x27;.jpg&#x27;&#xA;        image_file_path = os.path.join("/tmp/test1/img", image_file_name)&#xA;&#xA;        # schedule all image captures calls *concurrently*:&#xA;        tasks.append(asyncio.create_task(take_image(camera_id, camera_name, image_file_path, image_counter),&#xA;                     name=image_file_name))&#xA;        image_counter = image_counter &#x2B; 1&#xA;&#xA;    await asyncio.gather(tasks) # &lt;-- This line throws a TypeError!&#xA;    toc = time.perf_counter()&#xA;    print(f"Captured list of {image_counter - 1} cameras in: {toc - tic:0.0f} seconds")&#xA;&#xA;asyncio.run(main())&#xA;

    &#xA;

    Unfortunately, when I attempt to run this program, I am getting this error :

    &#xA;

    TypeError : unhashable type : 'list'

    &#xA;

    and the following Traceback :

    &#xA;

    Traceback (most recent call last):&#xA;  File "scratch_10.py", line 41, in <module>&#xA;    asyncio.run(main())&#xA;  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 43, in run&#xA;    return loop.run_until_complete(main)&#xA;  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 608, in run_until_complete&#xA;    return future.result()&#xA;  File "scratch_10.py", line 36, in main&#xA;    await asyncio.gather(tasks)&#xA;  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/tasks.py", line 805, in gather&#xA;    if arg not in arg_to_fut:&#xA;TypeError: unhashable type: &#x27;list&#x27;&#xA;</module>

    &#xA;

    I have been trying to puzzle through the 3.8 documentation on asyncio, but I don't understand what is wrong.

    &#xA;

    How can I have each take_image request run asynchronously, and then resume processing in my calling routine once each task is complete ?

    &#xA;

  • Getting List of default argument values if not used in FFMPEG command execution

    12 juillet 2020, par Pradeep Prabhu

    When I use FFMPEG to capture a live IPTV stream on my MAC, I generally end up with an interrupted video. When I send these four arguments, the capture is successful.

    &#xA;

    -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2

    &#xA;

    I don't want to specify these arguments everytime, So I decided to update the default values in the source code. Unsure if I have done it right - I updated http.c which contains these arguments. I re-compiled FFMPEG successfully.

    &#xA;

    I want to know if my changes are applied. Is there a way I can list out all the default values of the arguments. I can use this compiled version of FFMPEG for a week, and determine if the fix is applied or not, I was wondering, if there is a quicker and easier way to do it.

    &#xA;

    If this is successful, I can use this version of FFMPEG for Emby & TellyTV.

    &#xA;