Recherche avancée

Médias (1)

Mot : - Tags -/3GS

Autres articles (103)

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

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (11588)

  • Merge two videos with different HTTP Range header bytes

    5 avril 2022, par Mohammad Momeni

    I want to save 10 seconds from any part of a video by using its URL (without downloading it completely).
the server supports the Range header and it's possible to get specific byte ranges, the video is ok when I save it with something like Range: bytes=0-102400 but when I change the start byte and save a video with Range: bytes=307200-614400 it's no longer playable.

    


    I know maybe it lacks a MIME/header type that should be at the beginning of a file, but the first bytes are not in this response to specify the correct format of the file.
so I saved the video from 0-102400, which is ok and playable, and wanted to get that specific range and somehow append it after the first file to have both a correct file header (less than 1 sec) and that middle part of the video.

    


    first.webm Range : bytes=0-102400 (valid playable file)

    


    middle.webm Range : bytes=307200-614400 (not playable file)

    


    I tried to merge them using this command recommended by this answer

    


    ffmpeg -f concat -i list.txt -c copy merged.webm


    


    logs :

    


    [matroska,webm @ 000002143c3e77c0] File ended prematurely00 bitrate=3752.0kbits/s speed=N/A
[matroska,webm @ 000002143c429e40] Format matroska,webm detected only with low score of 1, misdetection possible!
[matroska,webm @ 000002143c429e40] EBML header parsing failed
[concat @ 000002143c3dda80] Impossible to open 'middle.webm'
list.txt: Invalid data found when processing input
frame=   42 fps=0.0 q=-1.0 Lsize=      10kB time=00:00:01.64 bitrate=  48.7kbits/s speed= 231x    
video:9kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.500000%


    


    generated video only shows the first video (which was already playable before merging) and ends.
I inspired this idea from this answer and don't want to download the complete video. If I can't merge them is it possible and how to write a MIME/header for the middle.webm manually to make it a valid playable video ?

    


  • Python : Error Combining Audio and Video Files using ffmpeg concat

    4 juillet 2022, par Aman

    I have a function that downloads videos using pytube. I have to download both the audio and the video files separately and then combine them using ffmpeg. This is what I have :

    


    def DownloadVideo(video_link,folder,maxres=None):
    if maxres==None:      
        print("Video Started")    
        video_file = YouTube(video_link).streams.order_by('resolution').desc().first().download()
        print("Video Done")
        
    else:
        print("Video Started")       
        video_file = YouTube(video_link).streams.filter(res=maxres).order_by('resolution').desc().first().download(output_path=folder)              
        print("Video Done", video_file)
       
    
    video_name = slugify(video_file.replace(".webm","").split("/")[-1])      
    print("Audio Started")

    audio_file = YouTube(video_link).streams.filter(only_audio=True).order_by('abr').desc().first().download(filename_prefix="audio_", output_path=folder)

    print("Audio Done")
    
    source_audio = ffmpeg.input(audio_file)
    source_video = ffmpeg.input(video_file)

    print("source audio: ", source_audio)
    print("source video: ", source_video)

    print("Concatenation Started")

    ffmpeg.concat(source_video, source_audio, v=1, a=1).output(f"{folder}/{video_name}.mp4").run()

    # Combine the video and audio
    
    print("Concatenation Done")
    return None


    


    However, this gives me the following error :

    


    ...&#xA;Video Started&#xA;Video Done D:/Data Projects/downloads/videos\The media.webm&#xA;Audio Started&#xA;Audio Done&#xA;source audio:  input(filename=&#x27;D:/Data Projects/downloads/videos\\audio_The media.webm&#x27;)[None] &lt;1792faaa507b>&#xA;source video:  input(filename=&#x27;D:/Data Projects/downloads/videos\\The media.webm&#x27;)[None] &lt;1f47beb69b93>&#xA;Concatenation Started&#xA;Traceback (most recent call last):&#xA;  File "<stdin>", line 4, in <module>&#xA;  File "<stdin>", line 20, in DownloadVideo&#xA;  File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python39\lib\site-packages\ffmpeg\_run.py", line 313, in run&#xA;    process = run_async(&#xA;  File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python39\lib\site-packages\ffmpeg\_run.py", line 284, in run_async&#xA;    return subprocess.Popen(&#xA;  File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__&#xA;    self._execute_child(args, executable, preexec_fn, close_fds,&#xA;  File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child&#xA;    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;</stdin></module></stdin>

    &#xA;

    But both The media.webm and audio_The media.webm exist in the folder.

    &#xA;

    What am I doing wrong and how can I fix this ?

    &#xA;

  • FFmpeg can't process videos with filenames containing emojis on Google Colab

    25 novembre 2022, par athena

    I mounted my Google Drive on Google Colab, inside the Drive, there's a video file with an emoji on it's filename (example : 20221124 [우리의식탁 W TABLE] 직접 기른 허브로 만들면 더 맛있는 허브포카치아 &#127807; (8m2hNIEoXEw).mkv).

    &#xA;

    !ffmpeg -i "/content/drive/MyDrive/DOWNLOAD/20221124 [우리의식탁 W TABLE] 직접 기른 허브로 만들면 더 맛있는 허브포카치아 &#127807; (8m2hNIEoXEw).mkv"&#xA;

    &#xA;

    Trying to run FFmpeg gives me this error :

    &#xA;

    ---------------------------------------------------------------------------&#xA;UnicodeEncodeError                        Traceback (most recent call last)&#xA; in <module>&#xA;      3 video = "/content/drive/MyDrive/DOWNLOAD/20221124 [\u110B\u116E\u1105\u1175\u110B\u1174\u1109\u1175\u11A8\u1110\u1161\u11A8 W TABLE] \u110C\u1175\u11A8\u110C\u1165\u11B8 \u1100\u1175\u1105\u1173\u11AB \u1112\u1165\u1107\u1173\u1105\u1169 \u1106\u1161\u11AB\u1103\u1173\u11AF\u1106\u1167\u11AB \u1103\u1165 \u1106\u1161\u11BA\u110B\u1175\u11BB\u1102\u1173\u11AB \u1112\u1165\u1107\u1173\u1111\u1169\u110F\u1161\u110E\u1175\u110B\u1161 \uD83C\uDF3F (8m2hNIEoXEw).mkv" #@param {type: "string"}&#xA;      4 &#xA;----> 5 get_ipython().system(&#x27;ffmpeg -i "$video" #-hide_banner&#x27;)&#xA;&#xA;4 frames&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_shell.py in system(self, *args, **kwargs)&#xA;     93       kwargs.update({&#x27;also_return_output&#x27;: True})&#xA;     94 &#xA;---> 95     output = _system_commands._system_compat(self, *args, **kwargs)  # pylint:disable=protected-access&#xA;     96 &#xA;     97     if pip_warn:&#xA;&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in _system_compat(shell, cmd, also_return_output)&#xA;    435   # stack.&#xA;    436   result = _run_command(&#xA;--> 437       shell.var_expand(cmd, depth=2), clear_streamed_output=False)&#xA;    438   shell.user_ns[&#x27;_exit_code&#x27;] = result.returncode&#xA;    439   if -result.returncode in _INTERRUPTED_SIGNALS:&#xA;&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in _run_command(cmd, clear_streamed_output)&#xA;    189           stdin=stdin,&#xA;    190           stderr=child_pty,&#xA;--> 191           close_fds=True)&#xA;    192       # The child PTY is only needed by the spawned process.&#xA;    193       os.close(child_pty)&#xA;&#xA;/usr/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)&#xA;    798                                 c2pread, c2pwrite,&#xA;    799                                 errread, errwrite,&#xA;--> 800                                 restore_signals, start_new_session)&#xA;    801         except:&#xA;    802             # Cleanup if the child failed starting.&#xA;&#xA;/usr/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)&#xA;   1480                             errread, errwrite,&#xA;   1481                             errpipe_read, errpipe_write,&#xA;-> 1482                             restore_signals, start_new_session, preexec_fn)&#xA;   1483                     self._child_created = True&#xA;   1484                 finally:&#xA;&#xA;UnicodeEncodeError: &#x27;utf-8&#x27; codec can&#x27;t encode characters in position 131-132: surrogates not allowed&#xA;</module>

    &#xA;

    My Colab uses Python 3.7.15 and ffmpeg/ffprobe version N-109226-g2ad199ae31-20221125 (from https://github.com/BtbN/FFmpeg-Builds).

    &#xA;

    I tried searching similar issues as mine here, but most of the solutions are way beyond my knowledge, I'm not sure how to apply them to my use case.

    &#xA;

    I'll appreciate your help, thank you !

    &#xA;