
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (70)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (10048)
-
Duplicated PTS value when using rtsp transport UDP (H264 FU-A)
25 janvier, par ChristophI’m implementing a packet loss counter based on the PTS from the av_packet, and it works fine when using RTSP/TCP as the transport mode. However, when I switched to RTSP/UDP, two packets consistently share the same PTS. This puzzled me because I assumed that av_read_frame would parse the stream and provide "valid" packets.


In both cases, the stream is FU-A H.264, and I expected FFmpeg to handle reassembly in both transport modes identically. My understanding was that if UDP packets were splitted, FFmpeg would reassemble them into a single av_packet, similar to how it handles reassembly for TCP packets split due to MTU and FU-A.


I could adapt my packet loss calculation by simply ignoring packets with the same PTS as the previous one, but I want to understand what’s happening here.


TCP


packet pts: -9223372036854775808, dts: -9223372036854775808, size: 52672, key-frame: true, discard: false, corrupt: false
packet pts: 3598, dts: 3598, size: 6034, key-frame: false, discard: false, corrupt: false
packet pts: 7196, dts: 7196, size: 5730, key-frame: false, discard: false, corrupt: false
packet pts: 10794, dts: 10794, size: 6153, key-frame: false, discard: false, corrupt: false
packet pts: 14392, dts: 14392, size: 2269, key-frame: false, discard: false, corrupt: false
packet pts: 17989, dts: 17989, size: 2656, key-frame: false, discard: false, corrupt: false
packet pts: 21587, dts: 21587, size: 2659, key-frame: false, discard: false, corrupt: false



UDP


packet pts: -9223372036854775808, dts: -9223372036854775808, size: 1391, key-frame: true, discard: false, corrupt: false
packet pts: 0, dts: 0, size: 109265, key-frame: true, discard: false, corrupt: false
packet pts: 3598, dts: 3598, size: 878, key-frame: false, discard: false, corrupt: false
packet pts: -> 3598, dts: 3598, size: 7728, key-frame: false, discard: false, corrupt: false
packet pts: 7195, dts: 7195, size: 887, key-frame: false, discard: false, corrupt: false
packet pts: -> 7195, dts: 7195, size: 7149, key-frame: false, discard: false, corrupt: false
packet pts: 10793, dts: 10793, size: 795, key-frame: false, discard: false, corrupt: false
packet pts: -> 10793, dts: 10793, size: 7777, key-frame: false, discard: false, corrupt: false
packet pts: 14391, dts: 14391, size: 119, key-frame: false, discard: false, corrupt: false
packet pts: -> 14391, dts: 14391, size: 2075, key-frame: false, discard: false, corrupt: false



For reference here my code


// PackageLossDetection detects possible packet loss based on PTS (Presentation Time Stamp) values.
// It compares the PTS of the packet with the expected PTS, calculated using the stream's time base and average frame rate.
// If the deviation between the expected and actual PTS exceeds a defined tolerance.
//
// Parameters:
// - pkt: incoming packet whose PTS is to be checked.
// - stream: the stream containing time base and average frame rate information.
func (s *AvSource) PackageLossDetection(pkt *astiav.Packet, stream *astiav.Stream) {

 // When using UDP as RTSP Transport packages in tuple has same PTS
 // TODO: Maybe we should invest more time to find a better solution
 if s.lastPts == pkt.Pts() {
 return
 }

 if pkt.Pts() > 0 {

 const tolerance = 4 // Allowable deviation in PTS steps
 if stream.AvgFrameRate().Num() == 0 {
 s.log.Warn().Str("stream", s.stream.Name).Msg("PackageLossDetection, no frame rate information available")
 return
 }

 var ptsBetween = stream.TimeBase().Den() * stream.TimeBase().Num() / stream.AvgFrameRate().Num()
 if math.Abs(float64(pkt.Pts()-(s.lastPts+int64(ptsBetween)))) > tolerance {
 s.log.Warn().Str("stream", s.stream.Name).Msgf("PackageLossDetection, PTS steps: %d, expected: %d, got: %d", int(ptsBetween), s.lastPts+int64(ptsBetween), pkt.Pts())
 utils.SafeIncrementInt64(&s.metrics.LossCount)
 }

 s.lastPts = pkt.Pts()
 }
}



-
How can I remove silence from an MP3 programmatically ?
27 mars, par Benjamin OakesI have MP3 files that sometimes have silence at the end. I would like to remove this silence automatically. From what I can tell, it is "perfect" silence (0 amplitude), not background noise. The length of the content and the silence varies.



I found some other questions about cropping to the first 30 seconds or cropping to X and X+N seconds using
ffmpeg
. I would think I could use a similar approach, as long as I have a way to find when the silence starts. How would I do that programatically ?


For example, one possible solution would be to have a command that finds the beginning of the "silence". I'd expect a sequence like this



end=$(ffmpeg some-command-to-find-start-of-silence)
ffmpeg -t "$end" -acodec copy -i inputfile.mp3 outputfile.mp3




The solution does not have to use
ffmpeg
, but it does need to be available on Ubuntu.

-
FFmpeg zoompan filter always arcs when panning — how to get a straight‐line pan to a focus rectangle center ?
26 mai, par Mykyta ManuilenkoI’m trying to generate a 10s video from a single PNG image with FFmpeg’s
zoompan
filter, where the crop window zooms in from the image center and simultaneously pans in a perfectly straight line to the center of a predefined focus rectangle.

My input parameters :


"zoompan": {
 "timings": {
 "entry": 0.5, // show full frame
 "zoom": 1, // zoom-in/zoom-out timing
 "outro": 0.5 // show full frame in the end
 },
 "focusRect": {
 "x": 1086.36,
 "y": 641.87,
 "width": 612.44,
 "height": 344.86
 }
}



My input/output values :


- 

- fps : 25
- image input dimensions : 1920 × 1080
- output video dimensions : 1920 × 1080








My calculations :


// Width of the bounding box to zoom into
 const bboxWidth = focusRect.width;

 // Height of the bounding box to zoom into
 const bboxHeight = focusRect.height;

 // X coordinate (center of the bounding box)
 const bboxX = focusRect.x + focusRect.width / 2;

 // Y coordinate (center of the bounding box)
 const bboxY = focusRect.y + focusRect.height / 2;

 // Time (in seconds) to wait before starting the zoom-in
 const preWaitSec = timings.entry;

 // Duration (in seconds) of the zoom-in/out animation
 const zoomSec = timings.zoom;

 // Time (in seconds) to wait on the last frame after zoom-out
 const postWaitSec = timings.outro;

 // Frame counts
 const preWaitF = Math.round(preWaitSec * fps);
 const zoomInF = Math.round(zoomSec * fps);
 const zoomOutF = Math.round(zoomSec * fps);
 const postWaitF = Math.round(postWaitSec * fps);

 // Calculate total frames and holdF
 const totalF = Math.round(duration * fps);

 // Zoom target so that bbox fills the output
 const zoomTarget = Math.max(
 inputWidth / bboxWidth,
 inputHeight / bboxHeight,
 );

 // Calculate when zoom-out should start (totalF - zoomOutF - postWaitF)
 const zoomOutStartF = totalF - zoomOutF - postWaitF;

 // Zoom expression (simple linear in/out)
 const zoomExpr = [
 // Pre-wait (hold at 1)
 `if(lte(on,${preWaitF}),1,`,
 // Zoom in (linear)
 `if(lte(on,${preWaitF + zoomInF}),1+(${zoomTarget}-1)*((on-${preWaitF})/${zoomInF}),`,
 // Hold zoomed
 `if(lte(on,${zoomOutStartF}),${zoomTarget},`,
 // Zoom out (linear)
 `if(lte(on,${zoomOutStartF + zoomOutF}),${zoomTarget}-((${zoomTarget}-1)*((on-${zoomOutStartF})/${zoomOutF})),`,
 // End
 `1))))`,
 ].join('');

 // Center bbox for any zoom
 const xExpr = `${bboxX} - (${outputWidth}/zoom)/2`;
 const yExpr = `${bboxY} - (${outputHeight}/zoom)/2`;

 // Build the filter string
 const zoomPanFilter = [
 `zoompan=`,
 `s=${outputWidth}x${outputHeight}`,
 `:fps=${fps}`,
 `:d=${totalF}`,
 `:z='${zoomExpr}'`,
 `:x='${xExpr}'`,
 `:y='${yExpr}'`,
 `,gblur=sigma=0.5`,
 `,minterpolate=mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=${fps}`,
 ].join('');



So, my FFmpeg command looks like :


ffmpeg -t 10 -framerate 25 -loop 1 -i input.png -y -filter_complex "[0:v]zoompan=s=1920x1080:fps=25:d=250:z='if(lte(on,13),1,if(lte(on,38),1+(3.1350009796878058-1)*((on-13)/25),if(lte(on,212),3.1350009796878058,if(lte(on,237),3.1350009796878058-((3.1350009796878058-1)*((on-212)/25)),1))))':x='1392.58 - (1920/zoom)/2':y='814.3 - (1080/zoom)/2',gblur=sigma=0.5,minterpolate=mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=25,format=yuv420p,pad=ceil(iw/2)*2:ceil(ih/2)*2" -vcodec libx264 -f mp4 -t 10 -an -crf 23 -preset medium -copyts output.mp4



Actual behavior :


The pan starts at the image center, but follows a curved (arc-like) trajectory before it settles on the focus‐rect center (first it goes to the right bottom corner and then to the focus‐rect center).


Expected behavior :


The pan should move the crop window’s center in a perfectly straight line from (iw/2, ih/2) to (1392.58, 814.3) over the 25-frame zoom‐in (similar to pinch-zooming on a smartphone).


Questions :


- 

-
How can I express a truly linear interpolation of the crop window center inside zoompan so that the pan path is a straight line in source coordinates ?


-
Is there a better way (perhaps using different FFmpeg filters or scripting) to achieve this effect ?