
Recherche avancée
Autres articles (33)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP 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 (...)
Sur d’autres sites (5134)
-
Video codec specs through ffmpeg (not being achieved)
14 mars 2016, par JMRThe specs for the video format are the following :
- Aspect Ratio : 1:1
- H.264 video compression, high profile, square pixels, fixed frame rate, progressive scan
- .mp4 container with leading mov atom, no edit lists
- Audio : Stereo AAC audio compression, 128kbps +
Reading through posts and ffmpeg documentation I came up with the following (yeah, I run it on a Windows PC) :
ffmpeg.exe -r 30 -i input.webm -vf scale=iw*sar:ih -c:v libx264 -preset slow -profile:v high -c:a aac -strict experimental -ar 44100 -aspect 1:1 output.mp4
But when the video is played within the app that asks for this specification, it only displays black moving pixels, all broken, but you an hear the audio.
I don’t really know what else to change on the command, and I have no idea in regards to the ...with leading mov atom specification.
Thanks.
EDIT :
I’ve tried @Mulvya’s answer :
ffmpeg.exe -i input.webm -vf scale=iw*sar:ih,setsar=1 -c:v libx264 -preset slow -profile:v high -pix_fmt yuv420p -r 30 -c:a aac -strict experimental -ar 44100 -ac 2 -b:a 128k -movflags +faststart output.mp4
But the effect is the same once given to the app :
This is the information that ffmpeg spews about the input.webm file :
-
apply ffmpeg to many files
30 juillet 2015, par puchuI have written simple script :
#!/bin/bash
find . -name "*.m4a" | while read filename;
do
new_filename=$(echo "$filename" | sed "s/^\(.*\)m4a$/\1flac/g");
if [ ! -f "$new_filename" ]
then
#ffmpeg -i "$filename" -acodec flac "$new_filename" > /dev/null 2>&1;
#wait $!;
echo "$filename";
echo "$new_filename";
fi
doneit outputs correct result :
./Equilibrium, ALAC [GER] viking.folk/2003 - Demo 2003, ALAC/04 - Met.m4a
./Equilibrium, ALAC [GER] viking.folk/2003 - Demo 2003, ALAC/04 - Met.flac
./Equilibrium, ALAC [GER] viking.folk/2003 - Demo 2003, ALAC/02 - Nach Dem Winter.m4a
./Equilibrium, ALAC [GER] viking.folk/2003 - Demo 2003, ALAC/02 - Nach Dem Winter.flacif uncomment ffmpeg and wait :
./Equilibrium, ALAC [GER] viking.folk/2003 - Demo 2003, ALAC/04 - Met.m4a
./Equilibrium, ALAC [GER] viking.folk/2003 - Demo 2003, ALAC/04 - Met.flac
uilibrium, ALAC [GER] viking.folk/2003 - Demo 2003, ALAC/02 - Nach Dem Winter.m4a
uilibrium, ALAC [GER] viking.folk/2003 - Demo 2003, ALAC/02 - Nach Dem Winter.flacAnd no flacs has been done !
PS
#!/bin/bash
find . -name "*.m4a" | while read filename;
do
new_filename=$(echo "$filename" | sed "s/^\(.*\)m4a$/\1flac/g");
if [ ! -f "$new_filename" ]
then
ffmpeg -i "$filename" -acodec flac "$new_filename";
echo "$filename";
echo "$new_filename";
fi
sleep 5;
done1) encode start but suddenly stop with no error messages
2) encode couldn’t start because of "uilibrium" instead of "./Equilibrium"
3) = 1)
4) = 2)
...
last) correctly
-
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