libav

FFmpeg transcoding on Lambda results in unusable (static) audio

与世无争的帅哥 提交于 2019-11-29 05:13:24
I'd like to move towards serverless for audio transcoding routines in AWS. I've been trying to setup a Lambda function to do just that; execute a static FFmpeg binary and re-upload the resulting audio file. The static binary I'm using is here . The Lambda function I'm using in Python looks like this: import boto3 s3client = boto3.client('s3') s3resource = boto3.client('s3') import json import subprocess from io import BytesIO import os os.system("cp -ra ./bin/ffmpeg /tmp/") os.system("chmod -R 775 /tmp") def lambda_handler(event, context): bucketname = event["Records"][0]["s3"]["bucket"]["name

How to load correct libavcodec.so shared library version? (53)

拟墨画扇 提交于 2019-11-28 10:53:36
问题 I am using libavcodec and libavformat in my project but when I execute a binary which was built on another machine, I get the following error: error while loading shared libraries: libavcodec.so.53: cannot open shared object file: No such file or directory I installed ffmpeg with libav and trying the following commands: sudo apt-get install ffmpeg libavcodec-dev libavformat-dev sudo apt-get install ffmpeg libavcodec-extra-53 sudo apt-get install libav-tools The error doesnt show up when I

ffmpeg: RGB to YUV conversion loses color and scale

冷暖自知 提交于 2019-11-28 02:13:57
问题 I am trying to convert RGB frames to YUV420P format in ffmpeg/libav. Following is the code for conversion and also the images before and after conversion. The converted image loses all color information and also the scale changes significantly. Does anybody have idea how to handle this? I am completely new to ffmpeg/libav! // Did we get a video frame? if(frameFinished) { i++; sws_scale(img_convert_ctx, (const uint8_t * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB-

How to control key-frame generation of ffmpeg?

怎甘沉沦 提交于 2019-11-27 09:16:49
I'm making a segmenter that intervene ffmpeg's write_frame function and write output data to separate files. Each segmented file contains segment of about 3 seconds video. The code does following: 1 - Get transcoded packet 2 - Check if it contains key frame data, if yes goto 3. 3 - Check the duration of current segment, if it exceed 3 seconds, goto 4 4 - Close file, and create new segment, write packet to segment file, goto-1 General speaking, every segment contains at least 3 seconds video data, and it starts with a key frame. The problem is that the output video's duration are very different

Libav linking error: undefined references

前提是你 提交于 2019-11-26 21:49:17
问题 Here's my problem: I built ffmpeg from source (version 1.2), the libav* libraries are in /usr/local/lib and they're static I'm compiling a ns3 (www.nsnam.org) module, so my only control over the linker is through the env variable LINKFLAGS In the source the headers are in a "extern C" block, so it's not the usual g++ name mangling I set LINKFLAGS="-I/usr/local/include/libavformat -I/usr/local/include/libavcodec -I/usr/local/include/libavutil -L/usr/local/lib -lavformat -lavcodec -lavutil",

How to control key-frame generation of ffmpeg?

妖精的绣舞 提交于 2019-11-26 17:49:13
问题 I'm making a segmenter that intervene ffmpeg's write_frame function and write output data to separate files. Each segmented file contains segment of about 3 seconds video. The code does following: 1 - Get transcoded packet 2 - Check if it contains key frame data, if yes goto 3. 3 - Check the duration of current segment, if it exceed 3 seconds, goto 4 4 - Close file, and create new segment, write packet to segment file, goto-1 General speaking, every segment contains at least 3 seconds video