Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Extended client ownership of MediaCodec encoder output buffers for RTMP streaming
13 février 2014, par dbroBackground:
I've connected Android's MediaCodec to FFmpeg for muxing a variety of formats not supported by MediaMuxer, including
rtmp://
output via a.flv
container. Such streaming muxers require longer, unpredictable ownership of MediaCodec's output buffers, as they may perform networking I/O on any packet processing step. For my video stream, I'm using MediaCodec configured for Surface input. To decouple muxing from encoding, I queue MediaCodec's ByteBuffer output buffers to my muxer via a Handler.All works splendidly if I mux the
.flv
output to file, rather than rtmp endpoint.Problem:
When muxing to
rtmp://...
endpoint I notice my streaming application begins to block on calls toeglSwapBuffers(mEGLDisplay, mEncodingEGLSurface)
atdequeueOutputBuffer()
once I'm retaining even a few MediaCodec output buffers in my muxing queue as MediaCodec seems to be locked to only 4 output buffers.Any tricks to avoid copying all encoder output returned by
MediaCodec#dequeueOutputBuffers
and immediately callingreleaseOutputBuffer(...)
?The full source of my project is available on Github. Specifically, see:
- AndroidEncoder.java: Abstract Encoder class with shared behavior between Audio and Video encoders: mainly drainEncoder(). Writes data to a
Muxer
instance. - FFmpegMuxer.java: Implements
Muxer
- CameraEncoder.java. Sends camera frames to an AndroidEncoder subclass configured for Video encoding.
Systrace
Here's some systrace output streaming 720p @ 2Mbps video to Zencoder.
Solved
Copying then releasing the MediaCodec encoder output ByteBuffers as soon as they're available solves the issue without significantly affecting performance. I recycle the ByteBuffer copies in an
ArrayDeque
for each muxer track, which limits the number of allocations. - AndroidEncoder.java: Abstract Encoder class with shared behavior between Audio and Video encoders: mainly drainEncoder(). Writes data to a
-
ffmpeg progress status to multiple txt files depending on loglevel values [on hold]
13 février 2014, par koutzasnewWhen I use this ffmpeg command:
ffmpeg -i inputVideo.avi -loglevel info -strict -2 outputVideo.mp4 1>progress_output.txt 2>&1
all the progress info goes to progress_output.txt.
When I use this ffmpeg command:
ffmpeg -i inputVideo.avi -loglevel fatal -strict -2 outputVideo.mp4 1>error_output.txt 2>&1
all the fatal error info goes to error_output.txt
Is there a way that I can use ONE ffmpeg command and save:
- the
-loglevel info information to
progress_output.txt` - the
-loglevel fatal
information to differenterror_output.txt
so, from the progress_output.txt file to check the conversion progress, and from the error_output.txt file to check if a fatal error occurred.
Is there any other way to do that?
- the
-
Is "video:24803kB audio:945kB........." a succesful conversion output line type ? [on hold]
13 février 2014, par koutzasnewI redirect the output of ffmpeg conversions into txt files and I noticed that after multiple line that show the progress of the conversion, for example:
..... ..... frame= 867 fps= 18 q=29.0 q=31.0 size= 17846kB time=00:00:28.96 bitrate=5047.6kbits/s frame= 879 fps= 18 q=29.0 q=31.0 size= 18012kB time=00:00:29.36 bitrate=5025.3kbits/s frame= 890 fps= 18 q=29.0 q=31.0 size= 18175kB time=00:00:29.72 bitrate=5008.0kbits/s frame= 900 fps= 18 q=29.0 q=31.0 size= 18429kB time=00:00:30.06 bitrate=5021.8kbits/s frame= 901 fps= 17 q=-1.0 Lq=31.0 size= 20219kB time=00:00:30.14 bitrate=5494.6kbits/s
it outputs every time a line of this type:
video:24803kB audio:945kB subtitle:0 global headers:0kB muxing overhead 21.473556%
Could this line be a safe clue to understand that the conversion completed succesfully, or could that line also appear when the conversion fails?
-
Separate Audio and Video in android
13 février 2014, par ManojI am beginner to Android application development,The aim of my project is to separate a audio and video from video file. after surfing in internet i came to know that, using FFmpeg we can do it.
ffmpeg -i input.mkv # show stream numbers and formats ffmpeg -i input.mkv -c copy audio.m4a # AAC ffmpeg -i input.mkv -c copy audio.mp3 # MP3 ffmpeg -i input.mkv -c copy audio.ac3 # AC3 ffmpeg -i input.mkv -an -c copy video.mkv ffmpeg -i input.mkv -map 0:1 -c copy audio.m4a # stream 1
separated video file wouldn't contain any audio it must be contain only video type. whether this option too possible in ffmpeg? is any other alternative option there?.
-
is "video:24803kB audio:945kB........." standar succesfull conversion output line type ?
13 février 2014, par koutzasnewI redirect the outputs during ffmpeg conversions into txt files and I noticed that after multiple line that show the progres of the conversion, for example:
..... .....
frame= 867 fps= 18 q=29.0 q=31.0 size= 17846kB time=00:00:28.96 bitrate=5047.6kbits/s
frame= 879 fps= 18 q=29.0 q=31.0 size= 18012kB time=00:00:29.36 bitrate=5025.3kbits/s
frame= 890 fps= 18 q=29.0 q=31.0 size= 18175kB time=00:00:29.72 bitrate=5008.0kbits/s
frame= 900 fps= 18 q=29.0 q=31.0 size= 18429kB time=00:00:30.06 bitrate=5021.8kbits/s
frame= 901 fps= 17 q=-1.0 Lq=31.0 size= 20219kB time=00:00:30.14 bitrate=5494.6kbits/sit outputs every time a line of this type:
video:24803kB audio:945kB subtitle:0 global headers:0kB muxing overhead 21.473556%
Could this line be a safe clue to understand that the conversion completed succesfully, or this line type: video:24803kB audio:945kB subtitle:0 global headers:0kB muxing overhead 21.473556%
could also appear in cases that the conversion fails?
Thanx!!