Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Adding total duration information in mp4 audio stream file with FFMPEG
6 avril 2016, par lex82I'm trying to write an AAC audio stream into an mp4 file using the FFMPEG libraries. I am using a custom IO context that writes directly to a socket so I have to set
ioContext->seekable = 0
. To make this work I had to add the "movflags"empty_moov
andfrag_keyframe
when writing the header.After writing the output to a file on the other end of the socket, I can play the file in VLC or Windows Media Player. However, seeking to a specific position in the file is not working properly in both players. WMP also does not show the total duration and VLC only flashes it shortly when reaching the end of the audio.
Is there a way to add more metadata when muxing so the players are able to treat the file as if it was not written as a stream? Transfer via the socket is not interrupted abruptly, so I could write metadata at the end of the file. I also know the total duration in advance, so I could add it to the header of the file if it was possible. I cannot use the
faststart
flag because this would require output to a seekable file before writing to the socket.Update: Tried setting
nb_frames
andavg_frame_rate
on the stream but it didn't help. -
Building static FFmpeg libs for Windows 64-bit application
6 avril 2016, par Igor R.I build static FFmpeg libs for Windows 64 bit. Configuring as follows:
./configure --disable-everything --enable-static --disable-shared --enable-memalign-hack --disable-debug --enable-stripping --enable-protocol=file --enable-yasm --enable-decoder=mp3,mpeg4,h264 --enable-muxer=mp4,avi --enable-encoder=mjpeg
.The application is built in Visual Studio 2012 with
/MT
option and linked withlibavformat.a
,libavcodec.a
etc. I also link it withlibmingwex.a
,libgcc.a
.The linker fails with the following errors:
6>libavformat.a(file.o) : error LNK2001: unresolved external symbol __imp__wrmdir 6>libavformat.a(file.o) : error LNK2001: unresolved external symbol __imp__rmdir 6>libavformat.a(file.o) : error LNK2001: unresolved external symbol __imp__wunlink 6>libavformat.a(file.o) : error LNK2001: unresolved external symbol __imp__unlink 6>libavutil.a(time.o) : error LNK2001: unresolved external symbol clock_gettime 6>libavutil.a(time.o) : error LNK2001: unresolved external symbol nanosleep
As for the 2 latter errors, I can solve them by manually defining macros in
config.h
:#define HAVE_NANOSLEEP 1
and#define HAVE_CLOCK_GETTIME 1
.The question is how to solve the former 4. These look like functions imported from a dll (
__imp
prefix), but my application is built with/MT
, and I don't want any dynamic dependencies in FFmpeg. How to get rid of them?I tried to configure FFmpeg with
--extra-cflags="-static"
, but it doesn't help. -
Fast Video Streaming and Upload Android
6 avril 2016, par vminindFast Streaming & Uploading Videos On Mobile Apps with AWS S3
Im developing a app witch has Android, iOS Clients were users can upload videos and photos and view as news feed. I store my video file on Amazone s3. Video length is limited to 30sec.
When user is uploading 30 sec video from their gallery there are some high quality videos witch is even exceed 100MB so those video files take ages to upload. So i tried to convert them before upload using ffmpeg-android library but it also take almost same amount of time to convert the file so it seems this solution also point less. (convert in the scene reducing the video resolution and frame rate)
Im using ExoPlayer to play videos
Note : Videos uploading from iOS are not that huge files.
I want videos to upload fast and stream fast. Its big help if anyone can share their thoughts on this.
-
FFmpeg Creating Video from images with different duration [duplicate]
6 avril 2016, par Ma YuboThis question already has an answer here:
I have created a txt file
file '01.jpg' duration 5 file '02.jpg' duration 10 file '04.jpg' duration 15
then output ffmpeg -f concat -i d.txt out.mp4 the last image duration does not match the 15s , it become 5s about, if i put 50s then become 30 about.
any ideas?
-
imagemagick gradient mask file creation
6 avril 2016, par lang2I'm playing with this creative script here: http://www.fmwconcepts.com/imagemagick/transitions/. The plan is to mimic what happens with the script with
ffmpeg
and generate video with transition effects between pictures. My current understanding is this:- I have two pictures A and B.
- I need in between a couple of pictures (say 15) that are partially A and partially B.
- To do that I use the
composite -compose src-over A.jpg B.jpg mask-n.jpg out.jpg
command. - During the process, the mask-n.jpg gets generated automatically that gradually change from all black to all white.
- Depends on the mathematically equations, the way the transition effect looks is different.
In one of the example, Fred the author gave this:
convert -size 128x128 gradient: maskfile.jpg
This will generate a image like this:
This is partially black and partially white. For the transition to work, I'll need an all white one and an all black one and a couple of others in between. What's the magical command to do that?