
Recherche avancée
Autres articles (113)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
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 ) (...) -
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 (11336)
-
Automatic encoder selection failed for output stream #0:0 [duplicate]
2 octobre 2016, par mgt1234This question already has an answer here :
-
recompile ffmpeg with libmp3lame
1 answer
I use this command on ffmpeg :
/usr/local/bin/ffmpeg -ss 40 -t 40 -i mymusic.mp3 -ab 15 voice.mp3 2>&1
but I see this error :
Automatic encoder selection failed for output stream #0:0. Default encoder for format mp3 (codec png) is probably disabled. Please choose an encoder manually. Error selecting an encoder for stream 0:0
Also lamemp3 installed and enabled, how can I fix it ?
this is complete output :
ffmpeg version N-81842-g0fbd423 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
configuration: --enable-decoder=png --enable-encoder=png
libavutil 55. 32.100 / 55. 32.100
libavcodec 57. 60.101 / 57. 60.101
libavformat 57. 51.102 / 57. 51.102
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 63.100 / 6. 63.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 2.100 / 2. 2.100
[mp3 @ 0x3ccd3c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'mymusic.mp3':
Metadata:
album_artist : .:.:. WWW.NEWSONG3.COM .:.:.
title : Eshtebah .:.:. WWW.NEWSONG3.COM .:.:.
artist : Abolfazl Fallah .:.:. WWW.NEWSONG3.COM .:.:.
album : .:.:. WWW.NEWSONG3.COM .:.:.
comment : .:.:. WWW.NEWSONG3.COM .:.:.
genre : .:.:. WWW.NEWSONG3.COM .:.:.
track : .:.:. WWW.NEWSONG3.COM .:.:.
copyright : .:.:. WWW.NEWSONG3.COM .:.:.
TOPE : .:.:. WWW.NEWSONG3.COM .:.:.
composer : .:.:. WWW.NEWSONG3.COM .:.:.
TBPM : .:.:. WWW.NEWSONG3.COM .:.:.
TIT3 : .:.:. WWW.NEWSONG3.COM .:.:.
encoded_by : .:.:. WWW.NEWSONG3.COM .:.:.
disc : .:.:. WWW.NEWSONG3.COM .:.:.
MusicMatch_Mood : .:.:. WWW.NEWSONG3.COM .:.:.
date : 2013
Duration: 00:04:08.77, start: 0.000000, bitrate: 129 kb/s
Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
Metadata:
comment : Cover (front)
Automatic encoder selection failed for output stream #0:0. Default encoder for format mp3 (codec png) is probably disabled. Please choose an encoder manually.
Error selecting an encoder for stream 0:0 -
recompile ffmpeg with libmp3lame
-
ffmpeg : error on large input file [duplicate]
1er octobre 2016, par ingeniousThis question already has an answer here :
I have a large Mov file with this info :
I want convert it to mp4 by this ffmpeg command :
ffmpeg -i 57d5092f59418.mov -codec:v libx264 -profile:v high -preset slow
-b:v 360k -maxrate 424k -bufsize 720k -vf scale=-1:360 -threads 0 -b:a 64k
out.movBut I get this error :
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
detail :
ffmpeg version N-81784-g92de2c2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dx
va2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-lib
ebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --ena
ble-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfree
type --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enab
le-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-lib
openh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschr
oedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheor
a --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvo
rbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --ena
ble-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --e
nable-decklink --enable-zlib
libavutil 55. 30.100 / 55. 30.100
libavcodec 57. 58.100 / 57. 58.100
libavformat 57. 51.100 / 57. 51.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 63.100 / 6. 63.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 2.100 / 2. 2.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '57d5092f59418.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2016-02-09T07:33:27.000000Z
Duration: 00:00:13.71, start: 0.000000, bitrate: 72247 kb/s
Stream #0:0(eng): Video: qtrle (rle / 0x20656C72), bgra, 1920x1080, 72242 k
b/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default)
Metadata:
creation_time : 2016-02-09T07:33:27.000000Z
handler_name : Apple Alias Data Handler
encoder : Animation
timecode : 00:00:08;17
Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
creation_time : 2016-02-09T07:33:46.000000Z
handler_name : Apple Alias Data Handler
timecode : 00:00:08;17
File 'out.mov' already exists. Overwrite ? [y/N] y
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
x264 [error]: high profile doesn't support 4:4:4
[libx264 @ 00000000006f2f20] Error setting profile high.
[libx264 @ 00000000006f2f20] Possible profiles: baseline main high high10 high42
2 high444
Output #0, mov, to 'out.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
Stream #0:0(eng): Video: h264, none, q=2-31, SAR 1:1 DAR 0:0, 29.97 fps (def
ault)
Metadata:
creation_time : 2016-02-09T07:33:27.000000Z
handler_name : Apple Alias Data Handler
timecode : 00:00:08;17
encoder : Lavc57.58.100 libx264
Stream mapping:
Stream #0:0 -> #0:0 (qtrle (native) -> h264 (libx264))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters
such as bit_rate, rate, width or heightWhat shoud I do ?
thanks
-
FFMPEG Api conversion from YUV420P to RGB produces strange output
20 novembre 2024, par fasc8I'm using the FFMPEG Api in Rust to get RGB images from video files.


While some videos work correct and I get the frames back as expected, some work not. Or at least the result is not the way I expected it to be.


The code I use in Rust :


ffmpeg::init().unwrap();

let in_ctx = input(&Path::new(source)).unwrap();
let input = in_ctx
 .streams()
 .best(Type::Video)
 .ok_or(ffmpeg::Error::StreamNotFound)?;

let decoder = input.codec().decoder().video()?;

let scaler = Context::get(
 decoder.format(),
 decoder.width(),
 decoder.height(),
 Pixel::RGB24,
 decoder.width(),
 decoder.height(),
 Flags::FULL_CHR_H_INT | Flags::ACCURATE_RND,
)?; // <--- Is basically sws_getContext

// later to get the actual frame
let mut decoded = Video::empty();
if self.decoder.receive_frame(&mut decoded).is_ok() {
 let mut rgb_frame = Video::empty();
 self.scaler.run(&decoded, &mut rgb_frame)?; // <--- Does sws_scale
 println!("Converted Pixel Format: {}", rgb_frame.format() as i32);
 Ok(Some(rgb_frame))
}



Which should roughly translate to C like so :


// Get the context and video stream
SwsContext * ctx = sws_getContext(imgWidth, imgHeight,
 imgFormat, imgWidth, imgHeight,
 AV_PIX_FMT_RGB24, 0, 0, 0, 0);
sws_scale(ctx, decoded.data, decoded.linesize, 0, decoded.height, rgb_frame.data, rbg_frame.linesize);



And like I said earlier, sometimes it works fine and I get the expected frame back. But sometimes I get something like this :
Weird result image


I saved the images as .ppm files for quick visual comparison. I used this method, which basically writes the bytes to a file with a simple .ppm header :


fn save_file(frame: &Video, index: usize) -> std::result::Result<(), std::io::Error> 
{
 let mut file = File::create(format!("frame{}.ppm", index))?;
 file.write_all(format!("P6\n{} {}\n255\n", frame.width(), frame.height()).as_bytes())?;
 file.write_all(frame.data(0))?;
 Ok(())
}



Here you can see that on the left side there is a good image result vs. on the right side there is a bad image result.
Comparison of the .ppm files


To come to the question now :


Why is this happening. I tested everything on my side and the only thing left is ffmpeg conversion. FFMPEG seems to convert these two test files differently even though it reports YUV420P as format for both. I cannot figure out what the difference may be...


Here the info for the two video files i used :


Good video file :


General
Complete name : /mnt/smb/Snapchat-174933781.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/mp42)
File size : 1.90 MiB
Duration : 9 s 612 ms
Overall bit rate : 1 661 kb/s
Encoded date : UTC 2021-07-28 22:09:36
Tagged date : UTC 2021-07-28 22:09:36
eng : -180.00

Video
ID : 512
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 1 frame
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 9 s 598 ms
Bit rate : 1 597 kb/s
Width : 480 pixels
Height : 944 pixels
Display aspect ratio : 0.508
Frame rate mode : Variable
Frame rate : 29.797 FPS
Minimum frame rate : 15.000 FPS
Maximum frame rate : 30.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.118
Stream size : 1.83 MiB (96%)
Title : Snap Video
Language : English
Encoded date : UTC 2021-07-28 22:09:36
Tagged date : UTC 2021-07-28 22:09:36
Color range : Full
colour_range_Original : Limited
Color primaries : BT.709
Transfer characteristics : BT.601
transfer_characteristics_Original : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC

Audio
ID : 256
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 9 s 612 ms
Bit rate mode : Constant
Bit rate : 62.0 kb/s
Channel(s) : 1 channel
Channel layout : C
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 73.3 KiB (4%)
Title : Snap Audio
Language : English
Encoded date : UTC 2021-07-28 22:09:36
Tagged date : UTC 2021-07-28 22:09:36



Bad video file :


General
Complete name : /mnt/smb/Snapchat-1989594918.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/mp42)
File size : 2.97 MiB
Duration : 6 s 313 ms
Overall bit rate : 3 948 kb/s
Encoded date : UTC 2019-07-11 06:43:04
Tagged date : UTC 2019-07-11 06:43:04
com.android.version : 9

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3.1
Format settings : 1 Ref Frames
Format settings, CABAC : No
Format settings, Reference frames : 1 frame
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 6 s 313 ms
Bit rate : 3 945 kb/s
Width : 496 pixels
Height : 960 pixels
Display aspect ratio : 0.517
Frame rate mode : Variable
Frame rate : 29.306 FPS
Minimum frame rate : 19.767 FPS
Maximum frame rate : 39.508 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.283
Stream size : 2.97 MiB (100%)
Title : VideoHandle
Language : English
Encoded date : UTC 2019-07-11 06:43:04
Tagged date : UTC 2019-07-11 06:43:04
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC



Or as a diff image :


The problem is that I am not that familiar with ffmpeg yet I don't know all the quirks it has.


I hope someone can point me in the right direction.