
Recherche avancée
Médias (91)
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (78)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (6512)
-
Can't share few FFMPEG encoded videos on WhatsApp
2 juin 2019, par t6nandI am using FFMPEG to stitch a video to another video. However, I have observed that few of these videos are not being shared on WhatsApp with the message "Can’t send this video. Choose a different video and try again".
I am using the following command for stitching :
ffmpeg -y -i <input1> -i
<input2> -filter_complex "color=black:input1Width x input1Height:d=(input1time + input2time -1)[base]
;[0:v]setpts=PTS-STARTPTS[v0];[1:v] scale = iw * min(input1Width / iw\\, input1Height / ih):ih * min(input1Width/iw\\,input1Height/ih),
pad=input1Width:input1Height:(input1Width-iw*min(input1Width/iw\\,input1Height/ih))/2:(input1Height -
ih*min(input1Width/iw\\,input1Height/ih))/2,setsar=1:1,format=yuva420p,fade=in:st=0:d=1.0:alpha=1,
setpts=PTS-STARTPTS+((input1Time - 1)/TB)[v1];[base][v0]overlay[tmp]; [tmp][v1]overlay,format=yuv420p[fv];
[0:a][1:a]acrossfade=d=1[fa]" -map [fv] -map [fa] -crf 23 -c:v libx264 -b:v 300K
-preset slow outputvideo.mp4
</input2></input1>Here : input1Width - Input 1 Video’s width, input1Height - Input 2 Video’s height.
Interestingly running this command directly on terminal produces a file which plays correctly on media players and I am able to share it across platforms including WhatsApp.
However, the same command when triggered from a java code produces a similar file in terms of size, bit rate (near about same as produced when directly executed). I am running the same command from java using ProcessBuilder like :
ProcessBulider stitchVideoCommandArray = new ProcessBuilder(
"ffmpeg", "-y",
"-i", <input1>,
"-i", <input2>,
"-filter_complex", "color=black:" + String.valueOf(width) + "x" + String.valueOf(height) + ":d=" +
String.valueOf(originalVideoTime + ASSET_VIDEOSTREAM_DURATION - CROSS_FADE_TIME_DURATION) + "[base];" +
"[0:v]setpts=PTS-STARTPTS[v0];[1:v]scale=iw*" + String.valueOf(minMultiplicable) + ":ih*" + String.valueOf(minMultiplicable) +
",pad=" + String.valueOf(width) + ":" + String.valueOf(height) + ":(" + String.valueOf(width) + "-iw*" + String.valueOf(minMultiplicable) + "/2" +
"):(" + String.valueOf(height) + "-ih*" + String.valueOf(minMultiplicable) + "/2)" + ",fade=in" +
":st=0:d=" + String.valueOf(CROSS_FADE_TIME_DURATION) + ":alpha=1,setpts=PTS-STARTPTS+((" + String.valueOf(originalVideoTime - CROSS_FADE_TIME_DURATION) +
")/TB)[v1];[base][v0]overlay[tmp];[tmp][v1]overlay,format=yuv420p[fv];[0:a][1:a]acrossfade=d=1[fa]",
"-map", "[fv]",
"-map", "[fa]",
"-c:v", MP4Transcode.MP4VideoStreamEncoder.H264.videoEncoders,
"-b:v", "300K",
"-c:a", MP4Transcode.MP4AudioStreamEncoders.AAC.audioEncoders,
"-b:a", "128K",
"-crf", String.valueOf(constantRateFactor),
"-preset", presetRequired,
outputVideoPath
);
</input2></input1>I then use this object to execute the command using
command.start()
and waiting for exitvalue using
command.waitFor()
This also produces a file which I am able to play correctly on media players but was not successful in sharing the video on WhatsApp.
Also, the file produced by executing FFmpeg commands as mentioned above from java produces media files with their loudness slightly increased.
I am not able to figue out if it’s video specific issue or something else. It only happens to few random videos.
Here are the links to videos with the problem :
input 1 - input1Link
input 2 - inpt2LinkEDIT 1 :
To add, adding-loglevel debug
in java command takes forever and I haven’t seen it yet responding for even 5-6 minutes. However, using it directly from terminal returns quickly after processing. -
Some videos produce corrupted output on the last frame with OpenGL based video encoder [closed]
21 mars 2023, par london_utkuWe have implemented an opengl based video encoder and it works fine with most of the videos.


The video frames are constructed on opengl buffer in a frame by frame iterative manner and then encoded using ffmpeg into an output video without audio.


However, when we export the final video, for some input videos, only the last frame of the video sometimes gets a corrupted view as below :




Note : The original video plays fine without any errors with mplayer and vlc.


Here is our write video frame function :


int video_encoder::write_frame(AVFormatContext *fmt_ctx, AVCodecContext *c,
 AVStream *st, AVFrame *frame, AVPacket *pkt)
{
 int ret;
 // Conditional jump or move depends on uninitialised value
 // Use of uninitialised value of size 8
 // send the frame to the encoder

 // Error is about c.
 ret = avcodec_send_frame(c, frame);

 if (ret < 0) {
 std::cout << "Error sending a frame to the encoder: " << ret << std::endl;
 exit(1);
 }

 while (ret >= 0) {
 ret = avcodec_receive_packet(c, pkt);

 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 break;
 else if (ret < 0) {
 std::cout << "Error encoding a frame: " << ret << std::endl;
 exit(1);
 }

 /* rescale output packet timestamp values from codec to stream timebase */
 av_packet_rescale_ts(pkt, c->time_base, st->time_base);
 pkt->stream_index = st->index;

 ret = av_interleaved_write_frame(fmt_ctx, pkt);

 /* pkt is now blank (av_interleaved_write_frame() takes ownership of
 * its contents and resets pkt), so that no unreferencing is necessary.
 * This would be different if one used av_write_frame(). */
 if (ret < 0) {
 std::cout << "Error while writing output packet: " << ret << std::endl;
 exit(1);
 }
 }
 return ret == AVERROR_EOF ? 1 : 0;
}



The strategy for adding a new stream while creating the video container is given as below :


/* Add an output stream. */
void video_encoder::add_stream(OutputStream *ost, AVFormatContext *oc,
 const AVCodec **codec,
 enum AVCodecID codec_id)
{
 AVCodecContext *c;

 /* find the encoder */
 *codec = avcodec_find_encoder(codec_id);
 
 ...

 switch ((*codec)->type) {
 case AVMEDIA_TYPE_VIDEO:
 c->codec_id = codec_id;

 c->bit_rate = OUTPUT_BIT_RATE;
 /* Resolution must be a multiple of two. */
 c->width = width;
 c->height = height;
 /* timebase: This is the fundamental unit of time (in seconds) in terms
 * of which frame timestamps are represented. For fixed-fps content,
 * timebase should be 1/framerate and timestamp increments should be
 * identical to 1. */
 ost->st->time_base = av_d2q(1 / STREAM_FRAME_RATE, std::numeric_limits<int>::max());//(AVRational){ 1000, STREAM_FRAME_RATE};
 c->time_base = ost->st->time_base;

 c->gop_size = 7; /* emit one intra frame every twelve frames at most */
 //c->codec_id = AV_CODEC_ID_H264;
 c->pix_fmt = STREAM_PIX_FMT;
 //if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) 
 // c->max_b_frames = 2;
 if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
 /* Needed to avoid using macroblocks in which some coeffs overflow.
 * This does not happen with normal video, it just happens here as
 * the motion of the chroma plane does not match the luma plane. */
 c->mb_decision = 2;
 }

 if ((*codec)->pix_fmts){
 //c->pix_fmt = (*codec)->pix_fmts[0];
 }

 int ret;
 //avcodec_find_best_pix_fmt_of_list((*codec)->pix_fmts, AV_PIX_FMT_RGBA, 1, &ret);
 std::cout << "Output: FPS: " << STREAM_FRAME_RATE 
 << " Bit rate: " << c->bit_rate
 << " Codec: " << avcodec_get_name(c->codec_id)
 << " Resolution: " << c->width << " x " << c->height << std::endl;
 break;
 }
</int>


What should be the parameters that might cause the last frame to get corrupted ?


-
ffmpeg same bit rate in hls file across resolutions
4 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.
EDIT
Earlier I was using
-b:v
option per output instead of-maxrate:v
, I was getting following output for same video :#EXT-X-STREAM-INF:BANDWIDTH=479663,RESOLUTION=320x168,CODECS="avc1.64000c,mp4a.40.2",AUDIO="group_A1"
media_0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1129663,RESOLUTION=640x336,CODECS="avc1.64001e,mp4a.40.2",AUDIO="group_A1"
media_1.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3129663,RESOLUTION=1280x670,CODECS="avc1.64001f,mp4a.40.2",AUDIO="group_A1"
media_2.m3u8If you see, Bandwidth has increased considerably, for the same video and same video quality, also all the file sizes also increased 4x. as par my understanding with
maxrate
option,ffmpeg
optimises the output and provides only required bandwidth, while withb:v
option it forcefully increases the bandwidth to given values without any benefit in terms of quality. So essentially you get same quality video at much higher bandwidth.Which is why I want to use
maxrate
option but with increasing bandwidth. If I manually change the bandwidth to increasing order in the output withmaxrate
option, adaptive bit rate starts to work in iOS’s AVPlayer.