
Recherche avancée
Médias (33)
-
Stereo master soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (90)
-
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 (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (10244)
-
Crash on ffmpeg avcodec_encode_video in a Console app [closed]
11 janvier 2024, par Robel SharmaI want make an encoder which encode a raw image into h263 format.But after loading and initializing ffmpeg library I got crash on avcodec_encode_video for a demo image.



int _tmain(int argc, _TCHAR* argv[]) {
 avcodec_register_all();
 AVCodec *codec;
 AVCodecContext *c= NULL;
 int i, ret, x, y, got_output;
 FILE *f;
 AVFrame *frame;
 AVPacket pkt;

 int out_size, size, outbuf_size;

 AVFrame *picture;
 uint8_t *outbuf, *picture_buf;

 AVRational rp; 

 rp.den = 1;
 rp.num = 25;
 uint8_t endcode[] = { 0, 0, 1, 0xb7 };

 codec = avcodec_find_encoder(CODEC_ID_H263);

 c = avcodec_alloc_context3(codec);
 picture= avcodec_alloc_frame();
 c->bit_rate = 400000;
 /* resolution must be a multiple of two */
 c->width = 352;
 c->height = 288;
 /* frames per second */
 //c->time_base= (AVRational){1,25};
 c->time_base = rp;
 c->gop_size = 10; /* emit one intra frame every ten frames */
 c->max_b_frames=1;
 c->pix_fmt = PIX_FMT_YUV420P;
 avcodec_open(c, codec);


 outbuf_size = 100000;
 outbuf = (uint8_t*)malloc(outbuf_size);
 size = c->width * c->height;
 picture_buf = (uint8_t*)malloc((size * 3) / 2); /* size for YUV 420 */

 picture->data[0] = picture_buf;
 picture->data[1] = picture->data[0] + size;
 picture->data[2] = picture->data[1] + size / 4;
 picture->linesize[0] = c->width;
 picture->linesize[1] = c->width / 2;
 picture->linesize[2] = c->width / 2;

 /* encode 1 second of video */
 for(i=0;i<25;i++) {
 fflush(stdout);
 /* prepare a dummy image */
 /* Y */
 for(y=0;yheight;y++) {
 for(x=0;xwidth;x++) {
 picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3;
 }
 }
 /* Cb and Cr */
 for(y=0;yheight/2;y++) {
 for(x=0;xwidth/2;x++) {
 picture->data[1][y * picture->linesize[1] + x] = 128 + y + i * 2;
 picture->data[2][y * picture->linesize[2] + x] = 64 + x + i * 5;
 }
 }
 /* encode the image */

 **Crash is here** ---> ///////////////////////////////////////////////////
 out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);

 printf("encoding frame %3d (size=%5d)\n", i, out_size);
 fwrite(outbuf, 1, out_size, f);
 }
 /* get the delayed frames */
 for(; out_size; i++) {
 fflush(stdout);
 out_size = avcodec_encode_video(c, outbuf, outbuf_size, NULL);
 printf("write frame %3d (size=%5d)\n", i, out_size);
 fwrite(outbuf, 1, out_size, f);
 }
 /* add sequence end code to have a real mpeg file */
 outbuf[0] = 0x00;
 outbuf[1] = 0x00;
 outbuf[2] = 0x01;
 outbuf[3] = 0xb7;
 fwrite(outbuf, 1, 4, f);
 fclose(f);
 free(picture_buf);
 free(outbuf);

 avcodec_close(c);
 av_free(c);
 av_free(picture);
 printf("\n");
 return 0;
}



-
ffmpeg doesn't generate a ISO/IEC 14496-17 (MPEG-4 text) track when ingesting WebVTT subtitles to produce MPEGTS
10 avril 2024, par Daniel Andres Pelaez LopezWe are trying to create a mpegts with an ISO/IEC 14496-17 (MPEG-4 text) subtitles track, using WebVTT, but seems like ffmpeg creates a ISO 13818-1 PES private data instead.


The following is the ffmpeg command :


ffmpeg -i subtitle.vtt -c:s mov_text -f mpegts output3GPP.ts


This is using the following subtitle.vtt file :


WEBVTT

00:00.000 --> 00:01.000
Subtitle 1

00:01.000 --> 00:02.000
Subtitle 2

00:02.000 --> 00:03.000
Subtitle 3

00:03.000 --> 00:04.000
Subtitle 4



And the following is the output of the ffprobe for that file :


Input #0, mpegts, from 'output3GPP.ts':
 Duration: 00:00:19.00, start: 1.400000, bitrate: 1 kb/s
 Program 1
 Metadata:
 service_name : Service01
 service_provider: FFmpeg
 Stream #0:0[0x100]: Data: bin_data ([6][0][0][0] / 0x0006)
Unsupported codec with id 98314 for input stream 0



However, if we generate an mp4, it works, the following is the command :


ffmpeg -i subtitle.vtt -c:s mov_text -f mp4 output3GPP.ts


And the following is the output of the ffprobe for that file :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output3GPP.ts':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 encoder : Lavf57.83.100
 Duration: 00:00:20.00, start: 0.000000, bitrate: 0 kb/s
 Stream #0:0[0x1](und): Subtitle: mov_text (tx3g / 0x67337874), 0
kb/s (default)
 Metadata:
 handler_name : SubtitleHandler



Any reason why both commands behave differently ? is mpegts not supporting ISO/IEC 14496-17 (MPEG-4 text) ?


-
Transcoding Videos Using FastAPI and ffmpeg
15 janvier 2024, par Sanji VinsmokeI created an API using Fast API where I upload one or more videos, may specify the resolution of transcoding, and the output is transcoded video from 240p upto the resolution I specified. Available resolutions are - 240p, 360p, 480p, 720p, 1080p. I used ffmpeg for the transcoding job.


The problem that is bugging me since yesterday is that, after deploying to the s3 bucket and adding the url for the index.m3u8 file in any hls player, the video is blank. Only the audio and streaming are working. I have tried tweaking with the parameters in the ffmpeg parameters, the error is still there. I tried manually transcoding a video file locally, even that video's index.m3u8 file is blank in live version. I added the relevant codes for this project. I implemented each feature one by one, but I simply cannot find the reason why the video is totally blank on live.


def transcode_video(input_path, output_folder, res, video_id, video_resolution, progress_bar=None):
 # Transcode the video into .m3u8 format with segment format
 output_path = os.path.join(output_folder, f"{res}_{video_id}.m3u8")

 # Use subprocess for command execution
 chunk_size = 1 # Specify the desired chunk size in seconds

 transcode_command = [
 "ffmpeg", "-i", input_path, "-vf", f"scale={res}:'trunc(ow/a/2)*2'", "-c:a", "aac", "-strict", "-2",
 "-f", "segment", "-segment_time", str(chunk_size), "-segment_list", output_path, "-segment_format", "ts",
 f"{output_path.replace('.m3u8', '_%03d.ts')}"
 ]

 try:
 subprocess.run(transcode_command, check=True, capture_output=True)
 except subprocess.CalledProcessError as e:
 print(f"Error during transcoding: {e}")
 print(f"FFmpeg error output: {e.stderr}")
 # Continue with the next video even if an error occurs
 return False

 # Update the progress bar
 if progress_bar:
 progress_bar.update(1)
 return True


def get_bandwidth(resolution):
 # Define a simple function to calculate bandwidth based on resolution
 resolutions_and_bandwidths = {
 240: 400000,
 360: 850000,
 480: 1400000,
 720: 2500000,
 1080: 4500000,
 }
 
 return resolutions_and_bandwidths.get(resolution, 0)
def create_index_m3u8(video_id, resolutions_to_transcode):
 # Write the index.m3u8 file
 index_m3u8_path = os.path.join(OUTPUT_FOLDER, f"index_{video_id}.m3u8")
 with open(index_m3u8_path, "w") as index_file:
 index_file.write("#EXTM3U\n")
 index_file.write("#EXT-X-VERSION:3\n")

 for res in resolutions_to_transcode:
 aspect_ratio = 16 / 9
 folder_name = f"{res}p_{video_id}"
 resolution_file_name = f"{res}_{video_id}.m3u8"
 index_file.write(
 f"#EXT-X-STREAM-INF:BANDWIDTH={get_bandwidth(res)},RESOLUTION={int(res * aspect_ratio)}x{res}\n{folder_name}/{resolution_file_name}\n"
 )



I tried reducing or increasing chunk size, adding codecs, setting up dimensions. Where am I doing wrong ?


My python version is 3.8.18, ffmpeg version-4.4.4, ffmpeg-python version-0.2.0