Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (62)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • HTML5 audio and video support

    13 avril 2011, par

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

Sur d’autres sites (8338)

  • ffmpeg encoder streaming issues

    8 août 2017, par bobsingh1

    I am trying to build ffmpeg encoder on linux. I started with a custom built server Dual 1366 2.6 Ghz Xeon CPUs (6 cores) with 16 GB RAM with Ubuntu 16.04 minimal install. Built ffmpeg with h264 and aac. I am taking live source OTA channels and encoding/streaming them with following parameters

    -vcodec libx264 -preset superfast -crf 25 -x264opts keyint=60:min-keyint=60:scenecut=-1 -bufsize 7000k -b:v 6000k -maxrate 6300k -muxrate 6000k -s 1920x1080 -format yuv420p -g 60 -sn -c:a aac -b:a 384k -ar 44100

    And I am able to successfully udp out using mpegts. My problem starts with 5th stream. The server can handle four streams and as soon as I introduce 5th stream I start seeing hiccups in output. Looking at my cpu usage using top I still see only 65% to 75% usage with occasional 80% hit. Memory usage is well within acceptable parameters. So I am wondering either top is not giving me accurate cpu usage or something is not right with ffmpeg. The server is isolated for udp in/out on a 1 Gbps network.

    I decided to up the cpu power and installed two 3.5 Ghz CPUs (6 cores) thinking it was perhaps the cpu clock. To my surprise the results were no different. So now I am wondering is there some built in limit I am hitting when I process at 1080p. If I change the resolution to 720p it is able to process 8 streams but 720 is not acceptable.
    My target is 10 1080p streams per server.
    So my questions are
    1. If I use a quad motherboard and up the cpu count to 4 (6 or 8 cores) will I get 10 1080p streams ? Is there any theoretical max I can go with ffmpeg per machine ?
    2. Do cores matter more or does clock matter more ?
    3. Any suggestions in improvement with my options. I have tried ultrafast preset but the output quality is unacceptable.

    Thanks in advance

  • Combine many videos in list using FFMPEG

    2 septembre 2022, par anoor1234

    I have a bunch of videos that are MP4s with different FPS, resolution, aspect ratio, basically everything. I'm trying to see if its possible to use FFMPEG to combine them into a single 1080/720 video using a single command, or at least make them all similar format so that combining is easy. Speed and less CPU power would be preferred but I'm in no rush and

    


    I found this command on another stack overflow question :

    


    ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -filter_complex \
"[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1,setsar=1,fps=30,format=yuv420p[v0];
 [1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1,setsar=1,fps=30,format=yuv420p[v1];
 [2:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1,setsar=1,fps=30,format=yuv420p[v2];
 [v0][0:a][v1][1:a][v2][2:a]concat=n=3:v=1:a=1[v][a]" \
-map "[v]" -map "[a]" -c:v libx264 -c:a aac -movflags +faststart output.mp4


    


    The problem is that I have more that 3 videos to combine and I don't know how to work this command with more, I have an entire list of videos in a list.txt file structured as such :

    


    file './videos/video1.mp4'
file './videos/video2.mp4'
file './videos/video3.mp4'


    


    The code that somewhat worked for me was this

    


    ffmpeg -safe 0 -f concat -i list.txt -c copy output.mp4


    


    It combines the video well and fairly fast but I get weird glitches with the audio and the resolution is weird (I'm hoping for 1920x1080). I suspect this is due to the varying attributes of each video but I'm not sure. I'm familiar with Python but I have found no Python script that can do what I ask. If there any way to combine my list into one video (using FFMPEG or not) reliably ?

    


  • FFMPEG on AWS Lambda works selectively

    20 novembre 2020, par Arindam Baral

    I am using FFMpeg on AWS Lambda to convert mp4 files to m3u8 format.

    


    Here's my code :

    


    ENCODE_SIZE = {
    '360p': ('360:640', '1000000'),
    '540p': ('540:960', '2000000'),
    '720p': ('720:1280', '5000000')
}
@app.route('/encode', methods=['GET'])
@token_required
def encodeVideo(current_user):
    try:
        userEmail = current_user.emailID
        
        courseID = request.args.get('courseID')
        fileKey = request.args.get('fileKey')
        print ('Input file key received ', fileKey)
        convType = 'all'
        if 'convType' in request.args:
            convType = request.args.get('convType')
        print ('Conv Type::::', convType)
        instiID = Course.query.filter_by(id=courseID).first().instiID
        adminEmail = Institute.query.filter_by(id=instiID).first().adminEmail
        if adminEmail != userEmail:
            return jsonify({'message': 'Not authorized'}), 403
        
        bucket = app.config['S3_CONTENT_FOLDER']
        folder = '/'.join(fileKey.split('/')[:-1])
        
        os.system('cp /var/task/ffmpeg /tmp/; chmod 755 /tmp/ffmpeg;')
        FFMPEG_STATIC = '/tmp/ffmpeg' #"/opt/bin/ffmpeg" # 
        # FFMPEG_STATIC = 'ffmpeg' #"/opt/bin/ffmpeg" # 
        
        preSignURL = getPreSignedS3URL(fileKey, bucket)
        print (preSignURL)
        
        outputFlag = []
        
        # outFileName = 'final_out.m3u8'
        outFileName = '/tmp/final_out.m3u8'
        with open(outFileName, 'a') as outFile:
            outFile.write('#EXTM3U\n')
            
            if convType == 'all':
                for ver in ENCODE_SIZE:
                    print ('Starting for ver ', ver)
                    outFileNameM3 = '/tmp/%s_out.m3u8' %(ver) 
                    # outFileNameM3 = '%s_out.m3u8' %(ver) 
                    
                    subprocess.call([FFMPEG_STATIC, '-i', preSignURL, '-c:a', 'aac', '-c:v', 'libx264', '-s', ENCODE_SIZE[ver][0], '-f', 'hls', '-hls_list_size', '0', '-hls_time', '10', outFileNameM3])
                    
                    outFile.write('#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=%s %s\n' %(
                        ENCODE_SIZE[ver][1], outFileName
                    ))
                    # ret = os.system(commandStr)
                    # outputFlag.append(ret)
                    print ('Encoding completed for ver ', ver)
            else:
                ver = convType
                outFileNameM3 = '/tmp/%s_out.m3u8' %(ver) 
                # outFileNameM3 = '%s_out.m3u8' %(ver) 

                subprocess.call([FFMPEG_STATIC, '-i', preSignURL, '-c:a', 'aac', '-c:v', 'libx264', '-s', ENCODE_SIZE[ver][0], '-f', 'hls', '-hls_list_size', '0', '-hls_time', '10', outFileNameM3])  
                    
                outFile.write('#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=%s %s\n' %(
                        ENCODE_SIZE[ver][1], outFileName
                ))
                # ret = os.system(commandStr)
                # outputFlag.append(ret)
        outFile.close()
        print ('File Key Generated')
        #Upload files to s3
        streamFiles = glob.glob('/tmp/*.ts')
        print (streamFiles)
        for fl in streamFiles:
            finFileName = fl.split('/')[-1]
            fileKeyName = folder + '/' + finFileName
            uploadFileToS3(fl, fileKeyName, app.config['S3_CONTENT_FOLDER'])
        # m3u8Files = glob.glob('/tmp/*.m3u8')
        # print (m3u8Files)
        # for fl in m3u8Files:
        #     finFileName = fl.split('/')[-1]
        #     fileKeyName = folder + '/' + finFileName
        #     uploadFileToS3(fl, fileKeyName, app.config['S3_CONTENT_FOLDER'])
        # print ('S3 upload completed')
        
        # files = glob.glob('/tmp/*')
        # for f in files:
        #     os.remove(f)
        return jsonify({'message': 'Completed file encoding'}), 201
    except:
        print (traceback.format_exc())
        return jsonify({'message': 'Error in encoding file'}), 504
if __name__ == '__main__':
    app.run(debug=True,host="0.0.0.0", port=5000)



    


    When I request for "540p", the m3u8 file gets converted perfectly.
However, when I request for "360p" and "720p", I see only the first 1 second of the video.

    


    Please note - All the tls files are generated in all the cases. The problem is only in creation of the m3u8 playlist file.

    


    Can someone please help in this regard ?

    


    EDIT 1 : I am quite new to FFMPEG. So any help here will be very welcome

    


    The log files are present here :
https://drive.google.com/file/d/1QFgi-4jDIN3f6mWLoR999mlXzZ-Ij83R/view?usp=sharing