Advanced search

Medias (91)

Other articles (41)

  • Pas question de marché, de cloud etc...

    10 April 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

  • HTML5 audio and video support

    13 April 2011, by

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 April 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

On other websites (6492)

  • How do i install ffmpeg to my heroku hosted bot

    20 April 2021, by Alcatraz b312

    I am making a discord.py bot , so I installed FFMPEG on my PC and I also did it on the Heroku , but when I am giving the command of the song , its not playing . The Heroku is unable to find the Build pack I guess , what should I do ?
I downloaded this FFMPEG on the Heroku:
https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git

    


  • How to split a mp4 file into multiple .m4s chunks with one init.mp4 file

    29 November 2018, by JAVA Coder

    I am trying to split one audio.mp4 into multiple chunks(each of 10 seconds) with file format of .m4s or .mpd and one init.mp4 .

    1>I have successfully made chunks of 10 secs with one m3u8 file by this command-

    ffmpeg -i song.mp3 -c:a aac -b:a 64k -vn -hls_time 10 -hls_list_size 0 abc.m3u8

    2>Tried this command also

    MP4Box -dash 10000 -frag 1000 -rap -segment-name myDash -subsegs-per-sidx 5 -url-template test.mp4

    But not able to make .m4s chunks with one init.mp4.

  • FFMPEG eating up ram in railway deployment [flask app]

    23 June 2024, by Eshan Das

    I created a flask app , meme generator, hosting it in railway using gunicorn, i am suspecting ffmpeg is eating the most ram.....
so what i am doing is , generating a tts, and a text adding into one of the parts of the video , and then finally combining all together

    


    from flask import Flask, request, jsonify, send_file, url_for&#xA;from moviepy.editor import VideoFileClip, ImageClip, CompositeVideoClip, AudioFileClip, concatenate_videoclips&#xA;from pydub import AudioSegment&#xA;from PIL import Image, ImageDraw, ImageFont&#xA;from gtts import gTTS&#xA;from flask_cors import CORS&#xA;import os&#xA;&#xA;app = Flask(__name__)&#xA;CORS(app)&#xA;app.config[&#x27;UPLOAD_FOLDER&#x27;] = &#x27;uploads&#x27;&#xA;&#xA;def generate_video(name, profile_image_path, song_path, start_time):&#xA;    first_video = VideoFileClip("first.mp4")&#xA;    second_video = VideoFileClip("second.mp4")&#xA;    third_video = VideoFileClip("third.mp4")&#xA;&#xA;    #font_path = os.path.join("fonts", "arial.ttf")  # Updated font path&#xA;    font_size = 70&#xA;    font = ImageFont.load_default()&#xA;    text = name&#xA;    image_size = (second_video.w, second_video.h)&#xA;    text_image = Image.new(&#x27;RGBA&#x27;, image_size, (0, 0, 0, 0))&#xA;    draw = ImageDraw.Draw(text_image)&#xA;    text_width, text_height = draw.textsize(text, font=font)&#xA;    text_position = ((image_size[0] - text_width) // 2, (image_size[1] - text_height) // 2)&#xA;    draw.text(text_position, text, font=font, fill="black")&#xA;&#xA;    text_image_path = os.path.join(app.config[&#x27;UPLOAD_FOLDER&#x27;], f"text_{name}.png")&#xA;    text_image.save(text_image_path)&#xA;&#xA;    txt_clip = ImageClip(text_image_path, duration=second_video.duration)&#xA;&#xA;    tts = gTTS(text=name, lang=&#x27;en&#x27;)&#xA;    audio_path = os.path.join(app.config[&#x27;UPLOAD_FOLDER&#x27;], f"audio_{name}.wav")&#xA;    tts.save(audio_path)&#xA;&#xA;    sound = AudioSegment.from_file(audio_path)&#xA;    chipmunk_sound = sound._spawn(sound.raw_data, overrides={&#xA;        "frame_rate": int(sound.frame_rate * 1.5)&#xA;    }).set_frame_rate(sound.frame_rate)&#xA;&#xA;    chipmunk_audio_path = os.path.join(app.config[&#x27;UPLOAD_FOLDER&#x27;], f"chipmunk_audio_{name}.wav")&#xA;    chipmunk_sound.export(chipmunk_audio_path, format="wav")&#xA;&#xA;    audio_clip_second = AudioFileClip(chipmunk_audio_path)&#xA;&#xA;    second_video = CompositeVideoClip([second_video, txt_clip.set_position((45, 170))])&#xA;    second_video = second_video.set_audio(audio_clip_second)&#xA;&#xA;    song = AudioSegment.from_file(song_path)&#xA;    start_ms = start_time * 1000&#xA;    cropped_song = song[start_ms:start_ms &#x2B; 20000]&#xA;&#xA;    chipmunk_song = cropped_song._spawn(cropped_song.raw_data, overrides={&#xA;        "frame_rate": int(cropped_song.frame_rate * 1.5)&#xA;    }).set_frame_rate(cropped_song.frame_rate)&#xA;&#xA;    chipmunk_song_path = os.path.join(app.config[&#x27;UPLOAD_FOLDER&#x27;], f"chipmunk_song_{name}.wav")&#xA;    chipmunk_song.export(chipmunk_song_path, format="wav")&#xA;&#xA;    audio_clip_third = AudioFileClip(chipmunk_song_path)&#xA;    third_video = third_video.set_audio(audio_clip_third)&#xA;&#xA;    profile_image = ImageClip(profile_image_path).set_duration(first_video.duration).resize(height=first_video.h / 8).set_position((950, 500))&#xA;    first_video = CompositeVideoClip([first_video, profile_image])&#xA;    &#xA;    profile_image = ImageClip(profile_image_path).set_duration(second_video.duration).resize(height=second_video.h / 8).set_position((950, 500))&#xA;    second_video = CompositeVideoClip([second_video, profile_image])&#xA;    &#xA;    profile_image = ImageClip(profile_image_path).set_duration(third_video.duration).resize(height=third_video.h / 8).set_position((950, 500))&#xA;    third_video = CompositeVideoClip([third_video, profile_image])&#xA;&#xA;    final_video = concatenate_videoclips([first_video, second_video, third_video])&#xA;    final_video = final_video.subclip(0, 10)&#xA;&#xA;    output_path = os.path.join(app.config[&#x27;UPLOAD_FOLDER&#x27;], f"output_{name}.mp4")&#xA;    final_video.write_videofile(output_path, codec="libx264", audio_codec=&#x27;aac&#x27;)&#xA;&#xA;    final_video.close()&#xA;    first_video.close()&#xA;    second_video.close()&#xA;    third_video.close()&#xA;    audio_clip_second.close()&#xA;    audio_clip_third.close()&#xA;&#xA;    os.remove(audio_path)&#xA;    os.remove(text_image_path)&#xA;    os.remove(chipmunk_song_path)&#xA;    os.remove(chipmunk_audio_path)&#xA;    &#xA;    return output_path&#xA;&#xA;@app.route(&#x27;/generate&#x27;, methods=[&#x27;POST&#x27;])&#xA;async def generate():&#xA;    if not os.path.exists(app.config[&#x27;UPLOAD_FOLDER&#x27;]):&#xA;        os.makedirs(app.config[&#x27;UPLOAD_FOLDER&#x27;])&#xA;&#xA;    name = request.form[&#x27;name&#x27;]&#xA;    start_time = float(request.form[&#x27;start_time&#x27;])&#xA;&#xA;    profile_image = request.files[&#x27;profile_image&#x27;]&#xA;    profile_image_path = os.path.join(app.config[&#x27;UPLOAD_FOLDER&#x27;], profile_image.filename)&#xA;    profile_image.save(profile_image_path)&#xA;&#xA;    song = request.files[&#x27;song&#x27;]&#xA;    song_path = os.path.join(app.config[&#x27;UPLOAD_FOLDER&#x27;], song.filename)&#xA;    song.save(song_path)&#xA;&#xA;    video_path = generate_video(name, profile_image_path, song_path, start_time)&#xA;    return jsonify({"video_url": url_for(&#x27;uploaded_file&#x27;, filename=os.path.basename(video_path))})&#xA;&#xA;@app.route(&#x27;/uploads/<filename>&#x27;)&#xA;def uploaded_file(filename):&#xA;    path = os.path.join(app.config[&#x27;UPLOAD_FOLDER&#x27;], filename)&#xA;    return send_file(path, as_attachment=True)&#xA;&#xA;if __name__ == "__main__":&#xA;    if not os.path.exists(app.config[&#x27;UPLOAD_FOLDER&#x27;]):&#xA;        os.makedirs(app.config[&#x27;UPLOAD_FOLDER&#x27;])&#xA;    app.run(host=&#x27;0.0.0.0&#x27;, port=5000)&#xA;</filename>

    &#xA;

    I am trying to solve this issue, any way to optimize my code , or any other alternative of ffmpeg which i can use , to reduce the ram consumption

    &#xA;