Recherche avancée

Médias (91)

Autres articles (78)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (8830)

  • Python asyncio subprocess code returns "pipe closed by peer or os.write(pipe, data) raised exception."

    4 novembre 2022, par Duke Dougal

    I am trying to convert a synchronous Python process to asyncio. Any ideas what I am doing wrong ?

    


    This is the synchronous code which successfully starts ffmpeg and converts a directory of webp files into a video.

    


    import subprocess
import shlex
from os import listdir
from os.path import isfile, join

output_filename = 'output.mp4'
process = subprocess.Popen(shlex.split(f'ffmpeg -y -framerate 60 -i pipe: -vcodec libx265 -pix_fmt yuv420p -crf 24 output.mp4'), stdin=subprocess.PIPE)

thepath = '/home/ubuntu/webpfiles/'
thefiles = [f for f in listdir(thepath) if isfile(join(thepath, f))]
for filename in thefiles:
    absolute_path = f'{thepath}{filename}'
    with open(absolute_path, 'rb') as f:
        process.stdin.write(f.read())

process.stdin.close()
process.wait()
process.terminate()


    


    This async code fails :

    


    from os import listdir
from os.path import isfile, join
import shlex
import asyncio

outputfilename = 'output.mp4'

async def write_stdin(proc):
    thepath = '/home/ubuntu/webpfiles/'
    thefiles = [f for f in listdir(thepath) if isfile(join(thepath, f))]
    thefiles.sort()
    for filename in thefiles:
        absolute_path = f'{thepath}{filename}'
        with open(absolute_path, 'rb') as f:
            await proc.communicate(input=f.read())

async def create_ffmpeg_subprocess():
    bin = f'/home/ubuntu/bin/ffmpeg'
    params = f'-y -framerate 60 -i pipe: -vcodec libx265 -pix_fmt yuv420p -crf 24 {outputfilename}'
    proc = await asyncio.create_subprocess_exec(
        bin,
        *shlex.split(params),
        stdin=asyncio.subprocess.PIPE,
        stdout=asyncio.subprocess.PIPE,
        stderr=asyncio.subprocess.PIPE,
    )
    return proc

async def start():
    loop = asyncio.get_event_loop()
    proc = await create_ffmpeg_subprocess()
    task_stdout = loop.create_task(write_stdin(proc))
    await asyncio.gather(task_stdout)

if __name__ == '__main__':
    asyncio.run(start())


    


    The output for the async code is :

    


    pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.


    


    etc - one line for each webp file

    


  • fate : update ref files after a recent change

    29 octobre 2021, par James Almer
    fate : update ref files after a recent change
    

    Missed in 3925b826df365a2365118600bd7910cbca95286d.

    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] tests/ref/fate/iv8-demux
    • [DH] tests/ref/fate/segment-mp4-to-ts
  • "No JPEG data found in image" when using ffmpeg concat

    7 juillet 2021, par bpgeck

    We are using FFMPEG for some image processing. We are attempting to concatenate a series of images into one single video file using ffmpeg concat, similar to what is described in this guide.

    &#xA;

    Our full command is the following :

    &#xA;

    ffmpeg -loglevel debug -y concat -safe 0 -i /tmp/infile.txt -pix_fmt yuvj420p -c:v libx264 -bsf:v h264_mp4toannexb /tmp/outfile.ts&#xA;

    &#xA;

    This infile.txt contains a list of the image file names and the duration that image should take up in the video :

    &#xA;

    file /tmp/media/tmppjdk_2jd.jpg&#xA;duration 0.049911&#xA;file /tmp/media/tmptjuoz56b.jpg&#xA;duration 0.050015&#xA;file /tmp/media/tmpzywkxe16.jpg&#xA;duration 0.049960&#xA;...&#xA;

    &#xA;

    When running this command, however, I see the following error :

    &#xA;

    [mjpeg @ 0x565013c4b800] No JPEG data found in image&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mjpeg @ 0x565013c4b800] No JPEG data found in image&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mjpeg @ 0x565013c4b800] No JPEG data found in image&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mjpeg @ 0x565013c4b800] No JPEG data found in image&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;...&#xA;opping st:0&#xA;DTS 243, next:3170350840000 st:0 invalid dropping&#xA;PTS 243, next:3170350840000 invalid dropping st:0&#xA;DTS 244, next:3170350880000 st:0 invalid dropping&#xA;PTS 244, next:3170350880000 invalid dropping st:0&#xA;DTS 245, next:3170350920000 st:0 invalid dropping&#xA;PTS 245, next:3170350920000 invalid dropping st:0&#xA;DTS 246, next:3170350960000 st:0 invalid dropping&#xA;PTS 246, next:3170350960000 invalid dropping st:0&#xA;DTS 248, next:3170351000000 st:0 invalid dropping&#xA;PTS 248, next:3170351000000 invalid dropping st:0&#xA;

    &#xA;

    Any ideas on how I can properly debug this ?

    &#xA;