
Recherche avancée
Médias (2)
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
Autres articles (63)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
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 (...)
Sur d’autres sites (9724)
-
FFmpeg encoding aac audio, encoded file can not be played
9 décembre 2020, par cs guyI am trying to encodea aac audio. Example of MP2 here. I followed this documentation. I encode the audio with the code below by calling
startEncoding
and after 2 seconds I callstopEncoding
. Everything seems to work fine I get an file with some size but the problem is I can not open or play it. I dont know why. I must be doing something wrong in the code.

header :


class MediaEncoder {
public:
 MediaEncoder(char *filePath);

 void startEncoding();
 void stopEncoding();

 void encode(AVFrame *frame);
 bool isEncoding() const;

 void startEncoderWorker();

 int32_t check_sample_fmt(enum AVSampleFormat sample_fmt);
 
 bool signalExitFuture = false;
 int32_t ret;

private:
 std::future<void> encodingFuture;
 AVCodecContext *avCodecContext;
 AVFrame *avFrame;
 AVPacket *avPacket;
 AVCodec *codec;
 FILE* file;
};
</void>


cpp :


MediaEncoder::MediaEncoder(char *filePath){
 buffer = std::make_unique>(recorderBufferSize);

 /* find the encoder */
 codec = avcodec_find_encoder(AV_CODEC_ID_AAC);
 avCodecContext = avcodec_alloc_context3(codec);

 avCodecContext->bit_rate = 64000;

 /* check that the encoder supports given sample format */
 avCodecContext->sample_fmt = AVSampleFormat::AV_SAMPLE_FMT_FLTP;
 
 /* select other audio parameters supported by the encoder */
 avCodecContext->sample_rate = defaultSampleRate;
 avCodecContext->channel_layout = AV_CH_LAYOUT_STEREO;
 avCodecContext->channels = av_get_channel_layout_nb_channels(avCodecContext->channel_layout);

 /* open it */
 avcodec_open2(avCodecContext, codec, nullptr)
 
 file = fopen(filePath, "wb");
 
 /* packet for holding encoded output */
 avPacket = av_packet_alloc();
 
 /* frame containing input raw audio */
 avFrame = av_frame_alloc();
 
 avFrame->nb_samples = avCodecContext->frame_size;
 avFrame->format = avCodecContext->sample_fmt;
 avFrame->channel_layout = avCodecContext->channel_layout;

 /* allocate the data buffers */
 av_frame_get_buffer(avFrame, 0);
}


void MediaEncoder::startEncoding() {
 // set flags for decoding thread
 signalExitFuture = false;

 encodingFuture = std::async(std::launch::async, &MediaEncoder::startEncoderWorker, this);
}

void MediaEncoder::stopEncoding() {
 signalExitFuture = true;
}

bool MediaEncoder::isEncoding() const {
 return !signalExitFuture;
}

void MediaEncoder::encode(AVFrame *frame) {
 /* send the frame for encoding */
 ret = avcodec_send_frame(avCodecContext, frame);
 if (ret < 0) {
 LOGE("Error sending the frame to the encoder %s",
 av_err2str(ret));
 *recorderStatePointer = MediaEncoderState::RUNTIME_FAIL;
 return;
 }

 /* read all the available output packets (in general there may be any
 * number of them */
 while (ret >= 0) {
 ret = avcodec_receive_packet(avCodecContext, avPacket);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
 return;
 } else if (ret < 0) {
 LOGE("Error encoding audio frame %s",
 av_err2str(ret));
 *recorderStatePointer = MediaEncoderState::RUNTIME_FAIL;
 return;
 }
 
 /* Solution begins here
 int aac_profile = 2; // AAC LC
 int frequencey_index = 4; // 44,100Hz
 int channel_configuration = 2; // stereo (left, right)

 int frame_length = avPacket->size + 7; // your frame length
 
 unsigned char adts_header[7];

 // fill in ADTS data
 adts_header[0] = (unsigned char) 0xFF;
 adts_header[1] = (unsigned char) 0xF9;
 adts_header[2] = (unsigned char) (((aac_profile -1) << 6 ) + (frequencey_index << 2) + (channel_configuration >> 2));
 adts_header[3] = (unsigned char) (((channel_configuration & 3) << 6) + (frame_length >> 11));
 adts_header[4] = (unsigned char) ((frame_length & 0x7FF) >> 3);
 adts_header[5] = (unsigned char) (((frame_length & 7) << 5) + 0x1F);
 adts_header[6] = (unsigned char) 0xFC;

 fwrite(adts_header, 1, 7, file); 
 Solution ends here */ 
 fwrite(avPacket->data, 1, avPacket->size, file);
 av_packet_unref(avPacket);
 }
}

void MediaEncoder::startEncoderWorker() {
 try {
 float *leftChannel;
 float *rightChannel;
 float val;

 while (!signalExitFuture) {
 ret = av_frame_make_writable(avFrame);
 if (ret < 0) {
 LOGE("av_frame_make_writable Can not Ensure that the frame data is writable. %s",
 av_err2str(ret));
 *recorderStatePointer = MediaEncoderState::RUNTIME_FAIL;
 return;
 }

 leftChannel = (float *) avFrame->data[0];
 rightChannel = (float *) avFrame->data[1];

 for (int32_t i = 0; i < avCodecContext->frame_size; ++i) {
 
 leftChannel[i] = 0.4;
 rightChannel[i] = 0.4;
 }

 encode(avFrame);
 }

 /* flush the encoder */
 encode(nullptr);

 fclose(file);
 LOGE("Encoding finished!");

 av_frame_free(&avFrame);
 av_packet_free(&avPacket);
 avcodec_free_context(&avCodecContext);
 } catch (std::exception &e) {
 LOGE("startEncoderWorker uncaught exception %s", e.what());
 }

 LOGE("Deleting Media Encoder!");

}



Here is an recorded 11 seconds of an aac file recorded with real float pcm data rather than 0.4 as it is in the code I posted. Google Drive Link


The code above works. Thanks to the legend @Markus-Schumann


-
Connection to tcp ://localhost:8090 failed : Connection refused
29 décembre 2020, par ScantyI am running into the following error when running this command to read a RTSP input for a HTTP output :


ffmpeg -i /root/videos/walker.mkv http://localhost:8090/feed.ffm



The following error I got :


Connection to tcp://localhost:8090 failed: Connection refused
http://localhost:8090/feed.ffm: Connection refused



/etc/ffsever.conf


Port 8090
BindAddress 0.0.0.0
MaxClients 100
MaxBandwidth 20000
NoDaemon

<feed>
ACL allow 127.0.0.1
ACL allow localhost
File /tmp/feed.ffm
FileMaxSize 3M
</feed>
<stream>

Feed feed.ffm
Format flv
VideoCodec flv
VideoFrameRate 30
VideoBufferSize 80000
VideoBitRate 200

VideoQMin 1
VideoQMax 5

VideoSize 352x288
PreRoll 1

Noaudio
</stream>

<stream>
Feed feed.ffm
</stream>


-
FFMPEG error when saving NDI stream to mp4
22 septembre 2020, par user1163234I am trying to record a NDI stream to a MP4 file(I want to stream the mp4 to rtmp endpoint after saving file). However I am getting this error when running this class. https://github.com/WalkerKnapp/devolay/blob/master/examples/src/main/java/com/walker/devolayexamples/recording/RecordingExample.java


Error :


Connecting to source: DESKTOP-GQNH46Q (Ari PC output)
[file @ 0x7fb4f2d48540] Setting default whitelist 'file,crypto'
x265 [info]: HEVC encoder version 0.0
x265 [info]: build info [Mac OS X][clang 8.1.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 1 / wpp(12 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 1 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing lslices=4 deblock sao
[SWR @ 0x7fb4f8893000] Using fltp internally between filters
[mp4 @ 0x7fb4f3820200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 135 >= 107
Failed to write video flush packet, skipping: Invalid argument
configurationVersion: 1
general_profile_space: 0
general_tier_flag: 0
general_profile_idc: 1
general_profile_compatibility_flags: 0x60000000
general_constraint_indicator_flags: 0x900000000000
general_level_idc: 93
min_spatial_segmentation_idc: 0
parallelismType: 0
chromaFormat: 1
bitDepthLumaMinus8: 0
bitDepthChromaMinus8: 0
avgFrameRate: 0
constantFrameRate: 0
numTemporalLayers: 1
temporalIdNested: 1
lengthSizeMinusOne: 3
numOfArrays: 4
array_completeness[0]: 0
NAL_unit_type[0]: 32
numNalus[0]: 1
nalUnitLength[0][0]: 24
array_completeness[1]: 0
NAL_unit_type[1]: 33
numNalus[1]: 1
nalUnitLength[1][0]: 41
array_completeness[2]: 0
NAL_unit_type[2]: 34
numNalus[2]: 1
nalUnitLength[2][0]: 7
array_completeness[3]: 0
NAL_unit_type[3]: 39
numNalus[3]: 1
nalUnitLength[3][0]: 2050
[AVIOContext @ 0x7fb4f2d48640] Statistics: 2 seeks, 4 writeouts
x265 [info]: frame I: 1, Avg QP:14.03 kb/s: 16.33 
x265 [info]: frame P: 36, Avg QP:21.67 kb/s: 0.04 
x265 [info]: frame B: 73, Avg QP:24.22 kb/s: 0.03 
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 28.9% 13.2% 18.4% 2.6% 36.8% 

encoded 110 frames in 15.13s (7.27 fps), 0.18 kb/s, Avg QP:23.29
[aac @ 0x7fb4f6aa6200] Qavg: 65536.000