
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 (111)
-
Changer son thème graphique
22 février 2011, parLe thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
Modifier le thème graphique utilisé
Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
Il suffit ensuite de se rendre dans l’espace de configuration du (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
Initialisation de MediaSPIP (préconfiguration)
20 février 2010, parLors de l’installation de MediaSPIP, celui-ci est préconfiguré pour les usages les plus fréquents.
Cette préconfiguration est réalisée par un plugin activé par défaut et non désactivable appelé MediaSPIP Init.
Ce plugin sert à préconfigurer de manière correcte chaque instance de MediaSPIP. Il doit donc être placé dans le dossier plugins-dist/ du site ou de la ferme pour être installé par défaut avant de pouvoir utiliser le site.
Dans un premier temps il active ou désactive des options de SPIP qui ne le (...)
Sur d’autres sites (9974)
-
Go / Cgo - How to access a field of a Cstruct - could not make it
15 août 2021, par ChrisGI develope an application in Go for transcode an audio file from one format to another one :


I use the goav library that use Cgo to bind the FFmpeg C-libs :
https://github.com/giorgisio/goav/



The goav library ;
package avformat
has a typedef that cast the original FFmpeg lib C-Struct AVOutputFormat :

type ( 
 OutputFormat C.struct_AVOutputFormat
)



In my code i have a variable called
outputF
of the typeOutputFormat
that is aC.struct_AVOutputFormat
.

The
C
realAVOutputFormat
struct has fields :

name, long_name, mime_type, extensions, audio_codec, video_codec, subtitle_codec,..



and many fields more.


See : https://ffmpeg.org/doxygen/2.6/structAVOutputFormat.html



I verified the situation by
fmt.Println(outputF)
and reached :

{0x7ffff7f23383 0x7ffff7f23907 0x7ffff7f13c33 0x7ffff7f23383 86017 61 0 128 <nil> 0x7ffff7f8cfa0 <nil> 3344 0x7ffff7e3ec10 0x7ffff7e3f410 0x7ffff7e3ecc0 <nil> 0x7ffff7e3dfc0 <nil> <nil> <nil> <nil> <nil> <nil> 0 0x7ffff7e3e070 0x7ffff7e3e020 <nil>}
</nil></nil></nil></nil></nil></nil></nil></nil></nil></nil>


The audio codec field is on position
5
and contains86017


I verified the field name by using the package
reflect
:

val := reflect.Indirect(reflect.ValueOf(outputF))
fmt.Println(val)
fmt.Println("Fieldname: ", val.Type().Field(4).Name)

Output:
Fieldname: audio_codec




I try to access the field
audio_codec
of the originalAVOutputFormat
using :

fmt.Println(outputF.audio_codec)
ERROR: outputF.audio_codec undefined (cannot refer to unexported field or method audio_codec)


fmt.Println(outputF._audio_codec)
ERROR: outputF._audio_codec undefined (type *avformat.OutputFormat has no field or method _audio_codec)





As i read in the Cgo documentation :
Within the Go file, C's struct field names that are keywords in Go can be accessed by prefixing them with an underscore : if x points at a C struct with a field named "type", x._type accesses the field. C struct fields that cannot be expressed in Go, such as bit fields or misaligned data, are omitted in the Go struct, replaced by appropriate padding to reach the next field or the end of the struct.




But I have no idea what im doing wrong.


Edit :
Okay for sure no underscore is required as audio_codec is not a keyword in Go. This i understood for now. But still there is the question why im not able to access the CStruct field "audio_codec".


-
avformat_seek_file timestamps not using the correct time base
19 juin 2021, par CharlieI am in the process of creating a memory loader for ffmpeg to add more functionality. I have audio playing and working, but am having an issue with
avformat_seek_file
timestamps using the wrong format.

avformat.avformat_seek_file(file.context, -1, 0, timestamp, timestamp, 0)



From looking at the docs it says if the stream index is -1 that the time should be based on
AV_TIME_BASE
. When I load the file throughavformat_open_input
with a nullAVFormatContext
and a filename, this works as expected.

However when I create my own
AVIOContext
andAVFormatContext
throughavio_alloc_context
andavformat_alloc_context
respectively, the timestamps are no longer based onAV_TIME_BASE
. When testing I received an access violation when I first tried seeking, and upon investigating, it seems that the timestamps are based on actual seconds now. How can I make these custom contexts time based onAV_TIME_BASE
?

The only difference between the two are the custom loading of
AVIOContext
andAVFormatContext
:

data = fileobject.read()

 ld = len(data)

 buf = libavutil.avutil.av_malloc(ld)
 ptr_buf = cast(buf, c_char_p)

 ptr = ctypes.create_string_buffer(ld)
 memmove(ptr, data, ld)

 seeker = libavformat.ffmpeg_seek_func(seek_data)
 reader = libavformat.ffmpeg_read_func(read_data)
 writer = libavformat.ffmpeg_read_func(write_data)

 format = libavformat.avformat.avio_alloc_context(ptr_buf, buf_size, 0,
 ptr_data,
 reader,
 writer,
 seeker
 )

 file.context = libavformat.avformat.avformat_alloc_context()
 file.context.contents.pb = format
 file.context.contents.flags |= AVFMT_FLAG_CUSTOM_IO

 result = avformat.avformat_open_input(byref(file.context),
 b"",
 None,
 None)

 if result != 0:
 raise FFmpegException('avformat_open_input in ffmpeg_open_filename returned an error opening file '
 + filename.decode("utf8")
 + ' Error code: ' + str(result))

 result = avformat.avformat_find_stream_info(file.context, None)
 if result < 0:
 raise FFmpegException('Could not find stream info')

 return file




Here is the filename code that does work :


result = avformat.avformat_open_input(byref(file.context),
 filename,
 None,
 None)
 if result != 0:
 raise FFmpegException('avformat_open_input in ffmpeg_open_filename returned an error opening file '
 + filename.decode("utf8")
 + ' Error code: ' + str(result))

 result = avformat.avformat_find_stream_info(file.context, None)
 if result < 0:
 raise FFmpegException('Could not find stream info')

 return file



I am new to ffmpeg, but any help fixing this discrepancy is greatly appreciated.


-
FFmpeg what is the correct way to manually write silence through pipe:0 ?
19 juillet 2023, par Bohdan PetrenkoI have an ffmpeg process running with this parameters :


ffmpeg -y -f s16le -ac {Channels} -ar 48000 -re -use_wallclock_as_timestamps true -i pipe:0 -f segment -segment_time {_segmentSize} -segment_list \"{_segmentListPath}\" -segment_format mp3 -segment_wrap 2 -reset_timestamps 0 -af aresample=async=1 \"{_filePath}\"



I also have a
DateTimeOffset
which represents the time when the recording was started. When an FFMpeg process is created, I need to add some some amount of silence that equals to the delay between current time and when the recording was started. This delay may be bigger than ffmpeg segments, so I calculate it relatively to the time when last ffmpeg segment should begin.
I store silence in a static byte array with length of two ffmpeg segments :

_silenceBuffer ??= new byte[_segmentSize * 2 * Channels * SampleRate * 2];



I tried two ways of writing silence :


First code I tried is this :


var delay = DateTimeOffset.UtcNow - RecordingStartDateTime;

var time = CalculateRelativeMilliseconds(delay.TotalMilliseconds); // this returns time based on current segment. It works fine.

var amount = (int)(time * 2 * Channels * SampleRate / 1000);

WriterStream.Write(_silenceBuffer, 0, amount);



As the result, I have a very loud noise everywhere in output from ffmpeg. It brokes audio, so this way doesn't work for me.


Second code I tried is this :


var delay = DateTimeOffset.UtcNow - RecordingStartDateTime;

var time = CalculateRelativeMilliseconds(delay.TotalMilliseconds); // this returns time based on current segment. It works fine.

var amount = (int)time * 2 * Channels * SampleRate / 1000;

WriterStream.Write(_silenceBuffer, 0, amount);



Difference between first and second code is that now I cast only
time
toint
type, not the result of the whole expression. But it also doesn't work. This time at the beginning I have no silence I wrote, the recording begins with voice data I piped after writing silence. But if I use this ffmpeg command :

ffmpeg -y -f s16le -ac {Channels} -ar 48000 -i pipe:0 -f segment -segment_time {_segmentSize} -segment_list \"{_segmentListPath}\" -segment_format mp3 -segment_wrap 2 -reset_timestamps 0 \"{_filePath}\"



Then it works as expected. Recording begins with silence what I need, and then goes voice data I piped.


So, how can I manually calculate and write silence to my ffmpeg instance ? Is there some universal way of writing and calculating silence that will work with any ffmpeg command ? I don`t want to use filters and other ffmpeg instances for offsetting piped voice data, because I do it only once per session. I think that I can write silence with byte arrays. I look forward to any suggestions.