
Recherche avancée
Médias (1)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (37)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (6225)
-
Compress video from Android before upload to server
26 juillet 2016, par Rahul PatelI am working with compress video using FFmpeg library.
selectedImagePath = getPath(selectedImage); // this is video path from gallery
File dir = new File(Environment.getExternalStorageDirectory().getPath(), "MyAPP" + "/" + "Video");
if (!dir.exists()) {
dir.mkdirs();
}
long time = System.currentTimeMillis();
String ffmpegCode = "ffmpeg -y -i " + selectedImagePath + " -strict experimental -s 480x320 -r 25 -vcodec mpeg4 -b 900k -ab 48000 -ac 2 -ar 22050 " + dir + "/" + time + "out.mp4";using this code I can compress video, but if there is
space between selected image path then this is not working
.I found the below solution from this LINK.
// Use this format to support files that contains spaces and special characters
String[] complexCommand = {"ffmpeg","-y" ,"-i", selectedImagePath,"-strict","experimental","-s", "480x320","-r","25", "-vcodec", "mpeg4", "-b", "900k", "-ab","48000", "-ac", "2", "-ar", "22050", dir + "/" + time + "out.mp4"};
Runtime.getRuntime().exec("chmod 744 "+dir + "/");
Process p = Runtime.getRuntime().exec(complexCommand);and Logcat :
07-26 18:59:24.609 29512-29535/com.examples.ffmpeg4android_demo I/OpenGLRenderer: Initialized EGL, version 1.4
07-26 18:59:24.616 29512-30045/com.examples.ffmpeg4android_demo W/System.err: java.io.IOException: Error running exec(). Command: [ffmpeg, -y, -i, /storage/emulated/0/WhatsApp/Media/WhatsApp Video/VID-20160726-WA0001.mp4, -strict, experimental, -s, 480x320, -r, 25, -vcodec, mpeg4, -b, 900k, -ab, 48000, -ac, 2, -ar, 22050, /storage/emulated/0/MyAPP/Video/1469539764559out.mp4] Working Directory: null Environment: null
07-26 18:59:24.622 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.lang.ProcessManager.exec(ProcessManager.java:211)
07-26 18:59:24.622 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.lang.Runtime.exec(Runtime.java:174)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.lang.Runtime.exec(Runtime.java:129)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at com.examples.ffmpeg4android.SimpleExample$TranscdingBackground1.doInBackground(SimpleExample.java:577)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at com.examples.ffmpeg4android.SimpleExample$TranscdingBackground1.doInBackground(SimpleExample.java:531)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:295)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.lang.Thread.run(Thread.java:818)
07-26 18:59:24.623 29512-30045/com.examples.ffmpeg4android_demo W/System.err: Caused by: java.io.IOException: Permission denied
07-26 18:59:24.624 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.lang.ProcessManager.exec(Native Method)
07-26 18:59:24.624 29512-30045/com.examples.ffmpeg4android_demo W/System.err: at java.lang.ProcessManager.exec(ProcessManager.java:209)
07-26 18:59:24.624 29512-30045/com.examples.ffmpeg4android_demo W/System.err: ... 10 moreI already given permission
android.permission.WRITE_EXTERNAL_STORAGE
how can I compress video before upload to server like whatsapp and facebook ? Is there any other solution ?
Please guide me.
-
PHP FFMPEG match the Instagram Video Requirements
19 février 2021, par LinesofcodeThis are the Instagram requirements in order to upload a video :


- Container: MOV or MP4 (MPEG-4 Part 14), no edit lists, moov atom at the front of the file.
- Audio codec: AAC, 48khz sample rate maximum, 1 or 2 channels (mono or stereo).
- Video codec: HEVC or H264, progressive scan, closed GOP, 4:2:0 chroma subsampling.
- Frame rate: 23-60 FPS.
- Picture size:
 - Maximum columns (horizontal pixels): 1920
 - Minimum aspect ratio [cols / rows]: 4 / 5
 - Maximum aspect ratio [cols / rows]: 16 / 9
 - Video bitrate: VBR, 5Mbps maximum
- Audio bitrate: 128kbps
- Duration: 60 seconds maximum, 3 seconds minimum
- File size: 100MB maximum



I'm using the https://github.com/PHP-FFMpeg/PHP-FFMpeg library and I'm able to get the metadata of the video this way :


$ffprobe = \FFMpeg\FFProbe::create();
$video = $ffprobe->streams('my_sample_video.mp4')->videos()->first();
$audio = $ffprobe->streams('my_sample_video.mp4')->audios()->first();



Printing
$video
&$audio
returns respectively the following data :

--- video ---
[index] => 0
[codec_name] => h264
[codec_long_name] => H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[profile] => Baseline
[codec_type] => video
[codec_time_base] => 1/1200
[codec_tag_string] => avc1
[codec_tag] => 0x31637661
[width] => 848
[height] => 480
[coded_width] => 848
[coded_height] => 480
[has_b_frames] => 0
[sample_aspect_ratio] => 0:1
[display_aspect_ratio] => 0:1
[pix_fmt] => yuv420p
[level] => 31
[color_range] => tv
[color_space] => bt709
[color_transfer] => bt709
[color_primaries] => bt709
[chroma_location] => left
[refs] => 1
[is_avc] => 1
[nal_length_size] => 4
[r_frame_rate] => 25/1
[avg_frame_rate] => 25/1
[time_base] => 1/600
[start_pts] => 0
[start_time] => 0.000000
[duration_ts] => 57888
[duration] => 96.480000
[bit_rate] => 1436391
[bits_per_raw_sample] => 8
[nb_frames] => 2412

--- audio ---
[index] => 1
[codec_name] => aac
[codec_long_name] => AAC (Advanced Audio Coding)
[profile] => LC
[codec_type] => audio
[codec_time_base] => 1/44100
[codec_tag_string] => mp4a
[codec_tag] => 0x6134706d
[sample_fmt] => fltp
[sample_rate] => 44100
[channels] => 2
[channel_layout] => stereo
[bits_per_sample] => 0
[r_frame_rate] => 0/0
[avg_frame_rate] => 0/0
[time_base] => 1/44100
[start_pts] => 0
[start_time] => 0.000000
[duration_ts] => 4255744
[duration] => 96.502132
[bit_rate] => 62026
[max_bit_rate] => 64000
[nb_frames] => 4156



Some things are easy to verify like the Video Codec, Audio Codec & Duration, but how to I manage to verify the rest ?


I also noticed that all the MP4 & MOV video samples I use, the metadata of
codec_long_name
always returns "MPEG-4 part 10" and the requirement is "MPEG-4 Part 14".

-
Setting up RTP on Nginx
2 février 2021, par SwapI'm trying to use Janus Media Server to relay WebRTC streams to a particular RTP host/port, from where ffmpeg can pick it up as an input and convert it further to an rtmp stream, which can then be used to broadcast to various social media platforms (such as, YouTube, Twitch, Facebook, etc.)


My inspiration for this has been the following blog - https://www.meetecho.com/blog/firefox-webrtc-youtube-kinda/


Specifically, I'm trying to replicate the following architecture -




And Janus, as per their documentation, has a very neat API for doing it -


{
 "request" : "rtp_forward",
 "room" : <unique numeric="numeric" of="of" the="the" room="room" publisher="publisher" is="is" in="in">,
 "publisher_id" : <unique numeric="numeric" of="of" the="the" publisher="publisher" to="to" relay="relay" externally="externally">,
 "host" : "<host address="address" to="to" forward="forward" the="the" rtp="rtp" and="and" packets="packets">",
 "host_family" : "",
 "audio_port" : <port to="to" forward="forward" the="the" audio="audio" rtp="rtp" packets="packets">,
 "audio_ssrc" : <audio ssrc="ssrc" to="to" use="use" when="when" optional="optional">,
 "audio_pt" : <audio payload="payload" type="type" to="to" use="use" when="when" optional="optional">,
 "audio_rtcp_port" : <port to="to" contact="contact" receive="receive" audio="audio" rtcp="rtcp" feedback="feedback" from="from" the="the" and="and" currently="currently" unused="unused" for="for">,
 "video_port" : <port to="to" forward="forward" the="the" video="video" rtp="rtp" packets="packets">,
 "video_ssrc" : <video ssrc="ssrc" to="to" use="use" when="when" optional="optional">,
 "video_pt" : <video payload="payload" type="type" to="to" use="use" when="when" optional="optional">,
 "video_rtcp_port" : <port to="to" contact="contact" receive="receive" video="video" rtcp="rtcp" feedback="feedback" from="from" the="the" optional="optional">,
 "simulcast" : ,
 "video_port_2" : <if simulcasting="simulcasting" and="and" forwarding="forwarding" each="each" port="port" to="to" forward="forward" the="the" video="video" rtp="rtp" packets="packets" from="from" second="second" substream="substream"></if>layer to>,
 "video_ssrc_2" : <if simulcasting="simulcasting" and="and" forwarding="forwarding" each="each" video="video" ssrc="ssrc" to="to" use="use" the="the" second="second" substream="substream"></if>layer; optional>,
 "video_pt_2" : <if simulcasting="simulcasting" and="and" forwarding="forwarding" each="each" video="video" payload="payload" type="type" to="to" use="use" the="the" second="second" substream="substream"></if>layer; optional>,
 "video_port_3" : <if simulcasting="simulcasting" and="and" forwarding="forwarding" each="each" port="port" to="to" forward="forward" the="the" video="video" rtp="rtp" packets="packets" from="from" third="third" substream="substream"></if>layer to>,
 "video_ssrc_3" : <if simulcasting="simulcasting" and="and" forwarding="forwarding" each="each" video="video" ssrc="ssrc" to="to" use="use" the="the" third="third" substream="substream"></if>layer; optional>,
 "video_pt_3" : <if simulcasting="simulcasting" and="and" forwarding="forwarding" each="each" video="video" payload="payload" type="type" to="to" use="use" the="the" third="third" substream="substream"></if>layer; optional>,
 "data_port" : <port to="to" forward="forward" the="the" messages="messages">,
 "srtp_suite" : <length of="of" authentication="authentication" tag="tag" or="or" optional="optional">,
 "srtp_crypto" : "<key to="to" use="use" as="as" crypto="crypto" encoded="encoded" key="key" in="in" optional="optional">"
}
</key></length></port></port></video></video></port></port></audio></audio></port></host></unique></unique>


For this, I've setup a Nginx server, where I've also installed Janus and everything's been running smoothly so far. But I'm quite clueless as to how to setup my Nginx server so that it accepts RTP connections (which will be forwarded as RTMP using ffmpeg).


Please guide me to any relevant resources that would help me achieve this. Thanks in advance !