
Recherche avancée
Autres articles (70)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
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
Sur d’autres sites (9620)
-
FFmpeg - Issue scaling and overlaying image
19 juillet 2019, par HB.Firstly, the screen dimensions of the device I’m using is
1080 x 2280 pixels, 19:9 ratio
, this is important and will be explained later in the question.
Few months ago I asked this question. The answer provided worked perfectly :
"-i", video.mp4, "-i", image.png, "-filter_complex", "[0:v]pad=iw:2*trunc(iw*16/9/2):(ow-iw)/2:(oh-ih)/2[v0];[1:v][v0]scale2ref[v1][v0];[v0][v1]overlay=x=(W-w)/2:y=(H-h)/2[v]", "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-preset", "ultrafast", "-r", outFPS, output.mp4
Shortly after I implemented and releasing this, I started getting messages from users complaining that the image that was placed on-top of the video is not at the same position after saving it.
I noticed that in the command above the ratio for the pad is set for16:9
ratio, in other words the above will not work on devices that has a screen ratio of19:9
.I then asked another question about this issue, and after a long conversation with @Gyan, the command is changed to the following :
"-i", video.mp4, "-i", image.png, "-filter_complex", "[0:v]scale=iw*sar:ih,setsar=1,pad='max(iw\,2*trunc(ih*9/16/2))':'max(ih\,2*trunc(ow*16/9/2))':(ow-iw)/2:(oh-ih)/2[v0];[1:v][v0]scale2ref[v1][v0];[v0][v1]overlay=x=(W-w)/2:y=(H-h)/2[v]", "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-preset", "ultrafast", "-r", outFPS, output.mp4
Testing on a device that has a
16:9
ratio works perfectly.
Now testing with the device mentioned above, I replace the ratio in the command to the following (
19/9/2
and9/19/2
) :"-i", video.mp4, "-i", image.png, "-filter_complex", "[0:v]scale=iw*sar:ih,setsar=1,pad='max(iw\,2*trunc(ih*9/19/2))':'max(ih\,2*trunc(ow*19/9/2))':(ow-iw)/2:(oh-ih)/2[v0];[1:v][v0]scale2ref[v1][v0];[v0][v1]overlay=x=(W-w)/2:y=(H-h)/2[v]", "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-preset", "ultrafast", "-r", outFPS, output.mp4
Here is the result I get :
I changed my players background to green to make it easier to see. The blue line is the image that I want to overlay
Original video
After processing
Here is the issues with the above.
- The line that was drawn on the original video is not scaled, but it is still at the correct position.
- The video is no longer the original size, the width and hight is reduced and my players background can now be seen on the left and right of the video.
Here is the result I’m trying to achieve :
You will notice the following :
- The video is not resized, it still has the same dimensions as the original.
- The line that was drawn is still at the same position and is not scaled
- Black padding was added to the top and bottom of the video, to fill the remaining space. The green background is no longer visible.
Any advice to achieve the above would greatly be appreciated.
I will be giving 300 bounty points to the user that can help me fix this.
EDIT 1
Here is an input video, image and the expected output as asked for in the comment section. This is using a device that has
16:9
aspect ratio and screen dimensions of1920x1080
.Here is another example of the expected output (I also included the input image and input video).
EDIT 2
I think it’s worth mentioning that the input image will always be the size/dimensions of the devices screen, so it will always have the same aspect ratio as the screen as well. The size/dimensions of input video will vary.
-
ffmpeg same bit rate in hls file
2 août 2019, par SaurabhWe are using following command to generate dash and hls file for a given video :
ffmpeg -y -nostdin -loglevel error -i input.mp4 \
-map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:a\?:0 \
-maxrate:v:0 350k -bufsize:v:0 700k -c:v:0 libx264 -filter:v:0 "scale=320:-2" \
-maxrate:v:1 1000k -bufsize:v:0 2000k -c:v:1 libx264 -filter:v:1 "scale=640:-2" \
-maxrate:v:2 3000k -bufsize:v:0 6000k -c:v:2 libx264 -filter:v:2 "scale=1280:-2" \
-maxrate:v:3 245k -bufsize:v:3 600k -c:v:3 libvpx-vp9 -filter:v:3 "scale=320:-2" \
-maxrate:v:4 700k -bufsize:v:3 1400k -c:v:4 libvpx-vp9 -filter:v:4 "scale=640:-2" \
-maxrate:v:5 2100k -bufsize:v:3 4200k -c:v:5 libvpx-vp9 -filter:v:5 "scale=1280:-2" \
-use_timeline 1 -use_template 1 -adaptation_sets "id=0,streams=v id=1,streams=a" \
-threads 8 -seg_duration 5 -hls_playlist true -f dash output/output.mpdThis works and generates hls files also as expected, one sample m3u8 file below :
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_A1",NAME="audio_6",DEFAULT=YES,URI="media_6.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=129663,RESOLUTION=320x168,CODECS="avc1.64000c,mp4a.40.2",AUDIO="group_A1"
media_0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=129663,RESOLUTION=640x336,CODECS="avc1.64001e,mp4a.40.2",AUDIO="group_A1"
media_1.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=129663,RESOLUTION=1280x670,CODECS="avc1.64001f,mp4a.40.2",AUDIO="group_A1"
media_2.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=330756,RESOLUTION=320x168,CODECS="vp09.00.11.08,mp4a.40.2",AUDIO="group_A1"
media_3.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=329663,RESOLUTION=640x336,CODECS="vp09.00.21.08,mp4a.40.2",AUDIO="group_A1"
media_4.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=329663,RESOLUTION=1280x670,CODECS="vp09.00.31.08,mp4a.40.2",AUDIO="group_A1"
media_5.m3u8Now as you notice, the Bandwidth is same for resolution of
320x168
,640x336
and1280x670
, which might have happened because of nature of video.But the issue with this is in iOS’s AVPlayer it always picks the minimum resolution one and never picks the better resolution stream even if it is available because of same bitrate.
So the question I want to ask is : is there some option available to ensure - I always have some difference in the bitrates of different resolutions or more specific, bit rate always increase(may be just by few bytes) for increasing resolutions.
-
ffmpeg editing metadata major_brand
4 avril 2022, par circlerHello I have an MP4 video, I want to change the creation_time using ffmepg, without changing the rest of metadata. but I am facing some problems..


The major_brand and more stuff are changed. I want those to be the same. if I put it in ffprobe.exe this is what I see :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '6.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 1
 compatible_brands: mp41mp42isom
 creation_time : 2013-03-23 16:25:53
 Duration: 00:00:06.55, start: 0.000000, bitrate: 919 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 480x480,
862 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc
 Metadata:
 creation_time : 2013-03-23 16:25:53
 handler_name : Core Media Video
 Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 k
b/s
 Metadata:
 creation_time : 2013-03-23 16:25:53
 handler_name : Core Media Audio



I want to change the creation_time of the video, when I run :




ffmpeg.exe -i 6.mp4 -metadata creation_time="2013-06-22 15:00:00" -acodec copy -vcodec copy output.mp4




I get :


Output #0, mp4, to 'output.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 1
 compatible_brands: mp41mp42isom
 creation_time : 2013-06-22 15:00:00
 encoder : Lavf55.12.102
 Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 480x480, q=
2-31, 862 kb/s, 29.97 fps, 19200 tbn, 600 tbc
 Metadata:
 creation_time : 2013-03-23 16:25:53
 handler_name : Core Media Video
 Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, 62 kb
/s
 Metadata:
 creation_time : 2013-03-23 16:25:53
 handler_name : Core Media Audio
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 194 fps=0.0 q=-1.0 Lsize= 738kB time=00:00:06.61 bitrate= 913.9kbits
/s



According to the output and because I chose "-acodec copy -vcodec copy" everything should stay the same. But when I run ffprobe for the newly created .mp4 file. Here is the output :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 creation_time : 2013-06-22 15:00:00
 encoder : Lavf55.12.102
 Duration: 00:00:06.62, start: 0.000000, bitrate: 913 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 480x480,
862 kb/s, 29.97 fps, 30 tbr, 19200 tbn, 38400 tbc
 Metadata:
 creation_time : 2013-06-22 15:00:00
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 k
b/s
 Metadata:
 creation_time : 2013-06-22 15:00:00
 handler_name : SoundHandler



As you see everything has changed, even though i chose to keep everything the same.


Please help me on this. Thanks !