
Recherche avancée
Autres articles (112)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (15995)
-
FFMPEG on AWS Lambda works selectively
20 novembre 2020, par Arindam BaralI 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


-
ffmpeg QSV hardware encoder with x11grab screen capture
11 janvier 2020, par Toby EggittI believe I have built ffmpeg with support for my motherboard’s Intel graphics processor chip, but I have not succeeded in showing this working in any way. My goal is to use it for screen capture (the ffmpeg I built does capture screen successfully using the software encoding, but this is far too slow to be useful—it manages about 12fps at a very modest quality).
My main problem—I think—is that I don’t know how to use these encoders, the examples I found all fail, which makes me suspect that what I’ve built is broken in some way. However, I also have no idea how I can verify that I built this correctly, but the following are true :
- The five components that I built to get to this all compiled without
errors (they were libva, gmmlib, intel-media-driver, libmfx, and
ffmpeg - The output of ffmpeg -encoders includes four encoders with _qsv in
their names including h264_qsv - Most of the commands I have tried result in output of this form :
[h264_qsv @ 0x55ef1dc72040] Low power mode is unsupported
[h264_qsv @ 0x55ef1dc72040] Current frame rate is unsupported
[h264_qsv @ 0x55ef1dc72040] Current picture structure is unsupported
[h264_qsv @ 0x55ef1dc72040] Current resolution is unsupported
[h264_qsv @ 0x55ef1dc72040] Current pixel format is unsupported
[h264_qsv @ 0x55ef1dc72040] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or heightI have the impression this thing might be fussy about many parameters of this sort but have no idea where to find out what it would like. Any suggestions at all, how to verify it, or better yet, how to issue a command that captures screen and encodes with the hardware, would be most welcome.
- The five components that I built to get to this all compiled without
-
lavc/h264dsp : optimise R-V V weight for shorter heights
1er septembre 2024, par Rémi Denis-Courmontlavc/h264dsp : optimise R-V V weight for shorter heights
The height is a power of two of up to 16 rows. The current code was
optimised for large sample counts.T-Head C908 :
h264_weight2_8_c : 211.7 ( 1.00x)
h264_weight2_8_rvv_i32 : before 184.0 ( 1.15x)
h264_weight2_8_rvv_i32 : after 54.2 ( 3.90x)
h264_weight4_8_c : 285.7 ( 1.00x)
h264_weight4_8_rvv_i32 : before 341.2 ( 0.86x)
h264_weight4_8_rvv_i32 : after 82.2 ( 3.47x)
h264_weight8_8_c : 498.7 ( 1.00x)
h264_weight8_8_rvv_i32 : before 683.7 ( 0.73x)
h264_weight8_8_rvv_i64 : after 128.5 ( 3.95x)
h264_weight16_8_c : 878.2 ( 1.00x)
h264_weight16_8_rvv_i32 : unchanged 239.5 ( 3.67x)SpacemiT X60 :
h264_weight2_8_c : 207.2 ( 1.00x)
h264_weight2_8_rvv_i32 : before 259.6 ( 0.80x)
h264_weight2_8_rvv_i32 : after 82.2 ( 2.52x)
h264_weight4_8_c : 290.8 ( 1.00x)
h264_weight4_8_rvv_i32 : before 509.6 ( 0.57x)
h264_weight4_8_rvv_i32 : after 61.5 ( 4.73x)
h264_weight8_8_c : 498.8 ( 1.00x)
h264_weight8_8_rvv_i32 : before 1019.8 ( 0.49x)
h264_weight8_8_rvv_i64 : after 71.8 ( 6.95x)
h264_weight16_8_c : 874.0 ( 1.00x)
h264_weight16_8_rvv_i32 : unchanged 249.0 ( 3.51x)