Recherche avancée

Médias (91)

Autres articles (92)

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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

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

Sur d’autres sites (10121)

  • .exe file, works different than .py file

    29 août 2024, par r_b

    I've made the YouTube Dowbloader App. Everything is working properly (run in PyCharm), but when I try to make it into an executable with pyinstaller, it does not work.

    


    This is the link to the repo :

    


    YouTube Downloader

    


    Command for making exe file :
pyinstaller project.spec

    


    project.spec file :

    


    # project.spec
# -*- mode: python ; coding: utf-8 -*-

block_cipher = None

a = Analysis(
    ['gui.py'],
    pathex=['.'],
    binaries=[],
    datas=[('static_files/*', 'static_files')],
    hiddenimports=[],
    hookspath=[],
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
    pyz,
    a.scripts,
    [],
    exclude_binaries=True,
    name='YouTube Downloader',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=False,
    icon='static_files/logo.ico'
)
coll = COLLECT(
    exe,
    a.binaries,
    a.zipfiles,
    a.datas,
    strip=False,
    upx=True,
    upx_exclude=[],
    name='YouTube Downloader'
)

app = BUNDLE(
    coll,
    name='YouTube Downloader',
    icon='static_files/logo.ico',
    bundle_identifier=None
)


    


    The file structure :

    


    project/
├── backend.py
├── gui.py
├── temp_mp3 # temporary mp3 for Audio player
├── static_files/
│   ├── icon.ico
│   ├── image1.png
│   ├── image2.png
│   └── setup.json  # setup.json file
└── project.spec


    


    Search block diagram :
Search block diagram

    


    After searching and fetching the YouTube URL, the app downloads an MP3 file (in temp_mp3) for the audio player section.

    


    And here is the difference between .exe and the .py, when I run .exe the APP downloads the audio segment from the URL in .webm format and stops there. Even if the format is different, it should be converted to MP3 (in PyCharm does).

    


    Find possible problem with moviepy/ffmpeg.exe (library for converting files).

    


    project.spec

    


    a = Analysis(
    ['gui.py'],
    pathex=['.'],
    binaries=[('C:\\path\\to\\ffmpeg\\bin\\ffmpeg.exe', 'ffmpeg')],
    datas=[('static_files/*', 'static_files')],


    


    Added binaries => path to ffmpeg.exe , but it still doesn't work.

    


  • How create a circular video (transparent area on top of video) effect without applying image mask to video

    26 septembre 2024, par Arina Lubimova

    Basically i googled a lot and solutions suggests apply some PNG mask or do not provide needed solution.

    


    What i've found.

    


    ffmpeg -i main.mkv -i facecloseup.mkv
 -filter_complex "[1]trim=end_frame=1,
  geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':128:128,
  loop=-1:1,setpts=N/FRAME_RATE/TB[mask];
  [1][mask]alphamerge[cutout];
  [0][cutout]overlay=x=W-w:y=0[v];
  [0][1]amix=2[a]"
 -map "[v]" -map "[a]"  out.mp4


    


    command = "-i " + this.video1Path.getPath() + " -i " + this.video2Path.getPath() + " -filter_complex [1]trim=end_frame=1,geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3)," + (this.mZoomLayout.getZoomedWidth()/2) + "*" + (this.mZoomLayout.getZoomedWidth()/2) + "),255,0)':128:128,format=gray,loop=-1:1,setpts=N/FRAME_RATE/TB[mask];[1][mask]alphamerge,format=rgba,lutrgb=a=if(gte(val\\,16)\\,val)[cutout];[0][cutout]overlay=" + this.mZoomLayout.getCircleX() + ":" + this.mZoomLayout.getCircleY() + ":enable='between(t,0," + this.videoTwoDuration + ") -c:v libx264 -crf 24 -preset ultrafast " + videoPath.getPath(); 


    


    So i tried to extract needed things from them, but i don't understand how exactly i need to do that, i did this :

    


    ffmpeg -i video.mp4 -filter_complex "[0]geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge" out.mp4


    


    [mov,mp4,m4a,3gp,3g2,mj2 @ 000001f761dd8e40] Invalid stream specifier: mask.
    Last message repeated 1 times
Stream specifier 'mask' in filtergraph description [0]geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge matches no streams.


    


    ffmpeg -i video.mp4 -filter_complex "[0]geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge" out.mp4


    


    [mov,mp4,m4a,3gp,3g2,mj2 @ 000001bfd9218e80] Invalid stream specifier: mask.
    Last message repeated 1 times
Stream specifier 'mask' in filtergraph description [0]geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge matches no streams.


    


    And one more time, guys, if you are going to post some "prepared image mask" solution - just leave, the question is about creating mask on air.

    


    So, let's say we have red square (yes, ratio is static, always 1:1), yes, i can't post it because i dont have 10 rep. (...).

    


    https://i.sstatic.net/MsL71.png - red square.

    


    https://i.sstatic.net/aIFEV.png - circle

    


    https://i.sstatic.net/R8EAx.png - result

    


    https://i.sstatic.net/WtqQg.png - final result

    


    I actually want to get the answer from @Gyan or @llogan because i searched a lot and only these two guys do understand how to make things programmatically.

    


    More tech details :
Aspect ratio is constant - 1:1, width and height should be taken from the video in auto way, we need to create a white square with transparent circle inside it, the end result must contain "rounded" video with white background.

    


  • Crop a video in Python, centered on a 16x9 video, cropped to 9x16, moviepy ?

    22 décembre 2022, par Levfo

    I want to crop a video that is 16x9 resolution to 9x16. This can be done by cropping a centered 607px wide rectangle on the 16x9 video. Can this be done ? EDIT : I do not care to stay within moviepy. I want to use something with speed. Currently, writing a 5 min video file with moviepy is taking 10+ minutes.

    


    cropping video from 16x9 to 9x16

    


    from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
import moviepy.editor as mpy

origVideo = 'video.mp4'
video = mpy.VideoFileClip(origVideo)

#Crop 'video' here and output 'cropped-video.mp4'

video.write_videofile('video-cropped.mp4')


    


    Currently only getting a black screen with no audio. The video won't play, but it has a time code.