transcoding

FFMPEG audio transcoding using libav* libraries

拟墨画扇 提交于 2019-11-30 04:09:24
问题 I am writing an audio transcoding application using ffmpeg libraries. Here is my code /* * File: main.cpp * Author: vinod * Compile with "g++ -std=c++11 -o audiotranscode main.cpp -lavformat -lavcodec -lavutil -lavfilter" * */ #if !defined PRId64 || PRI_MACROS_BROKEN #undef PRId64 #define PRId64 "lld" #endif #define __STDC_FORMAT_MACROS #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <stdint.h> #include <libavutil/imgutils.h>

What is the difference between AV_SAMPLE_FMT_S16P and AV_SAMPLE_FMT_S16?

自闭症网瘾萝莉.ら 提交于 2019-11-30 03:36:12
What happens when you do a conversion from AV_SAMPLE_FMT_S16P to AV_SAMPLE_FMT_S16? How is the AVFrame structure going to contain the planar and non-planar data? Harit Vishwakarma AV_SAMPLE_FMT_S16P is planar signed 16 bit audio, i.e. 2 bytes for each sample which is same for AV_SAMPLE_FMT_S16 . The only difference is in AV_SAMPLE_FMT_S16 samples of each channel are interleaved i.e. if you have two channel audio then the samples buffer will look like c1 c2 c1 c2 c1 c2 c1 c2... where c1 is a sample for channel1 and c2 is sample for channel2. while for one frame of planar audio you will have

How do I transcode a Javascript string to ISO-8859-1?

自作多情 提交于 2019-11-27 08:21:38
I'm writing a Chrome extension that works with a website that uses ISO-8859-1. Just to give some context, what my extension does is making posting in the site's forums quicker by adding a more convenient post form. The value of the textarea where the message is written is then sent through an Ajax call (using jQuery). If the message contains characters like á these characters appear as á in the posted message. Forcing the browser to display UTF-8 instead of ISO-8859-1 makes the á appear correctly. It is my understanding that Javascript uses UTF-8 for its strings, so it is my theory that if I

How do I transcode a Javascript string to ISO-8859-1?

牧云@^-^@ 提交于 2019-11-26 14:07:18
问题 I'm writing a Chrome extension that works with a website that uses ISO-8859-1. Just to give some context, what my extension does is making posting in the site's forums quicker by adding a more convenient post form. The value of the textarea where the message is written is then sent through an Ajax call (using jQuery). If the message contains characters like á these characters appear as á in the posted message. Forcing the browser to display UTF-8 instead of ISO-8859-1 makes the á appear