
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (16)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (2971)
-
avformat/wvdec : Check rate for overflow
20 septembre 2020, par Michael Niedermayeravformat/wvdec : Check rate for overflow
Fixes : signed integer overflow : 6000 * -2147483648 cannot be represented in type 'int'
Fixes : 25700/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6578316302352384Found-by : continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
ffmpeg capture for usb v4l2 card
8 décembre 2020, par elbarnaI have a Grabby Terratec USB card.


Bus 001 Device 006: ID 0ccd:10af TerraTec Electronic GmbH Terratec G1



With mencoder I capture fine video and audio using a script like this one


#!/bin/sh
#script for capture
#settings for pal 25 fps 720:576 normid=5
#settings for ntsc 30000/1001 fps normid 0 720:480
#settings for INPUT,0=composite,1=s-video,but depend on card

TITLE="MYMOVIE"
CROP="612:467:16:1"
SCALE="560:432"
DEVVID=0
INPUT=1
ADEVICE=hw.2,0
NORMID=5
WIDTH=640
HEIGHT=480
FPS=25
AUDIORATE=48000
ASPECT=4/3
VFS="yadif,crop=$CROP,scale=$SCALE,harddup"

mencoder tv:// -tv driver=v4l2:normid=$NORMID:width=$WIDTH:height=$HEIGHT:device=/dev/video$DEVVID:input=$INPUT:fps=$FPS:alsa:adevice=$ADEVICE:audiorate=${AUDIORATE}:amode=1:forceaudio:immediatemode=0 -of mpeg -mpegopts format=dvd -oac lavc -ovc lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=8000:vbitrate=6000:keyint=15:acodec=ac3:abitrate=320 -aspect $ASPECT -vf $VFS -o "$TITLE".mpg



The script capture audio because this line is present


:amode=1:forceaudio:immediatemode=0



Now the problem, I want to capture using ffmpeg with libx265 and aac


#!/bin/sh
SCALE=528:400
CROP=616:471:14:0
ASPECT=4:3
TITLE="MYTITLE"

#usbstream:CARD=Generic
# HD-Audio Generic
# USB Stream Output
#sysdefault:CARD=G1
# Terratec G1, USB Audio
# Default Audio Device
#front:CARD=G1,DEV=0
# Terratec G1, USB Audio
# Front output / input
#usbstream:CARD=G1
# Terratec G1
# USB Stream Output

ffmpeg -y -f video4linux2 -i /dev/video0 -thread_queue_size 512 -f alsa -i hw:CARD=G1 -ac 2 -vf yadif,crop=$CROP,scale=$SCALE -c:v libx265 -c:a aac -b:v 1200k -b:a 320k -metadata language=eng -metadata title="Mymovie" -aspect $ASPECT "$TITLE".mkv



The problem is.. video is captured but without audio, I have tried the line


-f alsa -i hw:CARD=G1



and


-f alsa -i hw:CARD=G1,DEV=0



and


-f alsa -i hw:2,0



But no way. The option " :amode=1:forceaudio:immediatemode=0" doesn't exist on ffmpeg.
Any suggestion ?Thanks


-
FFmpeg - generate x264 CBR video transport stream with C-API
6 juillet 2020, par ZeroDefectUsing various posts sprinkled around the Internet, including this one here on SO, I've been able to understand how to use the FFmpeg cli to generate a CBR video bitrate using the x264 codec (wrapped in an MPEG-2 transport stream). Note : I'm concerned with the video bitrate - nothing else.


ffmpeg -i cbr_test_file_input.mp4 -c:v libx264 -pix_fmt yuv420p -b:v 6000000 -preset fast -tune film -g 25 -x264-params vbv-maxrate=6000:vbv-bufsize=6000:force-cfr=1:nal-hrd=cbr -flags +ildct+ilme x264_cbr_test_output.ts



However, I'm trying to approach this from an FFmpeg C-API point of view. I'm having issues. I've knocked together some code to try do something very similar to what is being done in the FFmpeg CLI. I can generate a transport stream of what I think should be CBR, but the profile of the video bitrate is very different from what I thought was the FFmpeg cli equivalent :


The initialisation of the AVCodecContext looks something like :


av_dict_set(&pDict, "preset", "faster", 0);
 av_dict_set(&pDict, "tune", "film", 0);
 av_dict_set_int(&pDict, "rc-lookahead", 25, 0);

 pCdcCtxOut->width = pCdcCtxIn->width;
 pCdcCtxOut->height = pCdcCtxIn->height;
 pCdcCtxOut->pix_fmt = AV_PIX_FMT_YUV420P;
 pCdcCtxOut->gop_size = 25;

 // Going for 6Mbit/s
 pCdcCtxOut->bit_rate = 6000000;
 //pCdcCtxOut->rc_min_rate = pCdcCtxOut->bit_rate;
 pCdcCtxOut->rc_max_rate = pCdcCtxOut->bit_rate;
 pCdcCtxOut->rc_buffer_size = pCdcCtxOut->bit_rate;
 pCdcCtxOut->rc_initial_buffer_occupancy = static_cast<int>((pCdcCtxOut->bit_rate * 9) / 10);

 std::string strParams = "vbv-maxrate="
 + std::to_string(pCdcCtxOut->bit_rate / 1000)
 + ":vbv-bufsize="
 + std::to_string(pCdcCtxOut->bit_rate / 1000)
 + ":force-cfr=1:nal-hrd=cbr";

 av_dict_set(&pDict, "x264-params", strParams.c_str(), 0);

 pCdcCtxOut->field_order = AV_FIELD_TT;
 pCdcCtxOut->flags = (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME | AV_CODEC_FLAG_CLOSED_GOP);

 // WARN: Make some assumptions here!
 pCdcCtxOut->time_base = AVRational{1,25};
 pCdcCtxOut->framerate = AVRational{25,1};
 pCdcCtxOut->sample_aspect_ratio = AVRational{64,45};
</int>


The output graphs appear very different :




Above is the FFmpeg CLI output - video bitrate holds fairly steady.




Above is the output of my sample application - some significant dips in the video bitrate.


I've taken this a step further and created a git repo consisting of :


- 

- Code of sample application
- Test input file (.mp4)
- Outputs (.ts file) of tests
- Graphs of output bitrates.