Dmitry Adjiev | 31 Oct 04:31 2014

Does ffmpeg support tx3g eubtitles in mp4?


Libav-user mailing list
Ankush | 31 Oct 02:38 2014

Finding gop size

Hi guys I am in a need to carry out seeking of a h264 stream. I tried almost all the combinations with avseek_frame() but non gave me the results as expected which is of seeking to a I frame and then decoding further to the desired frame. So I developed a algo of my own which would seek to the I frame by calculation from the frame number. But the problem I am facing now is that I don't get the gop size of a stream, so is there a way to figure out the gop size of a stream.
Thank you.
Libav-user mailing list

What's the ultimate correct way of seeking

Hey there,

got another question regarding seeking in QuickTime and MXF containers.
For my own video player, I need frame-accurate access to all video frames in the file stream.

So far I’m using this code:

int64_t seekPos = ((theFrameIndex/self.frameRate) * 1000000);

av_seek_frame(self.formatContext, -1, seekPos, AVSEEK_FLAG_BACKWARD);

It works pretty well for all intra-frame only codecs I’ve tried so far.
However, when using inter frame codecs like H.264, it doesn’t work properly.

Whenever I’m one frame after a keyframe and want to move backwards by one frame, 
seeking using the above code does not yield the previous I-frame but rather the next keyframe.

I could solve the issue by simply modifying the seek position to be one frame earlier than the actual desired frame index.

int64_t oneFrame = (1.0/self.frameRate) * 1000000;
seekPos -= oneFrame;

However, with some MXF files this also didn’t help.

Thus, I’d like to ask what the correct way of seeking really is at the time being.
I’m assuming that I’m not the only one that wants to seek to defined frame indices.

I read in the source files that there’s a new seeking API  (avformat_seek_file).
Are there any information as to when this will be available and if this addresses the issue (in case it’s not just my problem)?


Libav-user mailing list
Jabotical | 30 Oct 21:53 2014

Improving HTTP demux throughput

It's delightful that libav can directly open remote files for demuxing via
HTTP, and I've been impressed with its usability and performance in that
regard for most cases. It handles HLS like a champ.

But certain videos are demuxed extremely slowly, with calls to
av_read_frame() averaging out to 100 ms or more even on a local network. The
examples I see this happen on are usually Quicktime videos, some created by
iOS devices and some not. And this is on Windows systems, if that matters (I
haven't been in a position to try it on anything else).

The only thread I could find that seemed relevant was this one:
Which never really got resolved other than postulating that the socket
buffer size was to blame. I tried increasing the socket receive buffer in
ff_listen_connect(), but all that did was make it considerably worse.

The culprit videos seem to require frequent seeking in the muxed content, in
order to demux it. It's no surprise, then, that libav demuxes them much more
slowly, if it only maintains one socket connection at a time and has to keep
creating new sockets each time it dances back and forth instead of
downloading contiguous data.

I suspect the problem is the way the separate streams within the file are
arranged, since it seems as though the audio is all demuxed from a few MB at
the beginning, while the video comes from the entire length of the file. So
is there any way to get libav to demux only one stream when av_read_frame()
is called, rather than dancing about creating new sockets each time it moves
back and forth between the streams?

Or, barring that, is it possible to get it to maintain more than one socket
while demuxing content streamed via HTTP over a network, so that separate
streams of contiguous data can be efficiently read? Or any other suggestions
for speeding up demuxing in this sort of case would of course be


View this message in context:
Sent from the libav-users mailing list archive at
Marcus Johnson | 30 Oct 09:58 2014


I need to seek X bytes into a file, and I'm not sure which function will do that?

I found a function called bytestream2_seek() but that only works with GetByteContext, and obviously the file is using GetBitContext, so I'm not really sure what to do.

Libav-user mailing list
Parth Shah | 29 Oct 07:04 2014

FFMPEG : Redirecting Matroska muxed data to socket

Hi all,

I am using FFMPEG library to mux H.264 and AAC frames to Matroska (.mkv) file. I can do that both using command line and C program.

Now, instead of writing the muxed matroska data into file I want to write these muxed data directly on to socket or pipe. My actual goal is to write a C program that send muxed data to socket and server will receive this muxed data.

I tried using protocol tcp. They are working with the matroska format.
So, My C program is able to send muxed data successfully over socket and server is able to receive this muxed data.

But when I apply ffprobe command over the received file, I am getting duration and bitrate field N/A. and when I tried to play this file with vlc i am unable to seek the file and getting garbage duration.

Below the output of the ffprobe.

    ffprobe version N-65784-g50a35f0 Copyright (c) 2007-2014 the FFmpeg developers
      built on Aug 25 2014 12:31:36 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
      libavutil      54.  5.100 / 54.  5.100
      libavcodec     56.  0.101 / 56.  0.101
      libavformat    56.  1.100 / 56.  1.100
      libavdevice    56.  0.100 / 56.  0.100
      libavfilter     5.  0.101 /  5.  0.101
      libswscale      3.  0.100 /  3.  0.100
      libswresample   1.  1.100 /  1.  1.100
    Input #0, matroska,webm, from 'Array.mkv':
        ENCODER         : Lavf54.29.104
      Duration: N/A, start: 1412858260.281000, bitrate: N/A
        Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg), 2000x1496 [SAR 1:1 DAR 250:187], 27 fps, 27 tbr, 1k tbn, 1k tbc (default)
        Stream #0:1: Video: mjpeg, yuvj422p(pc, bt470bg), 2000x1496 [SAR 1:1 DAR 250:187], 27 fps, 27 tbr, 1k tbn, 1k tbc (default)
        Stream #0:2: Video: mjpeg, yuvj422p(pc, bt470bg), 2000x1496 [SAR 1:1 DAR 250:187], 27 fps, 27 tbr, 1k tbn, 1k tbc (default)
        Stream #0:3: Video: mjpeg, yuvj422p(pc, bt470bg), 2000x1496 [SAR 1:1 DAR 250:187], 27 fps, 27 tbr, 1k tbn, 1k tbc (default)

As You can see Duration and Bitrate field shows N/A. However I am getting correct startTime.

Any help or advice? Thank you in advance.

Libav-user mailing list
Timothy Reed | 29 Oct 02:42 2014

Windows fails at assertion pkt->size

Good evening.

I have the same application running on Windows 7 with libraries from Zeranoe and Linux Mint with a build of FFMPEG from GIT source.  

My code is the same on both platforms and I am trying to add KLV to a MPEG-2 TS.  Under Linux it works with out any issues, the KLV is added to the video and the video is sent out.  

But on Windows, when I goto write the KLV packet to the frame I get the following error:
Assertion pkt->size == ((-214748367 -1) / 3 * 2 + (int)sizeof(AVFrame))

Where did I go wrong?  What should I be looking at to correct this?


Libav-user mailing list
Jasleen Kaur | 28 Oct 06:02 2014

Color space conversion

I am using sws_scale to change the color space of the image buffer.

Source data is in BGRA and destination color space is YUV420(12 bit).

The code snippet for conversion is -


Convert(int iWidth, int iHeight, BYTE* pBGRABuff)


int ystride = iWidth;

int uvstride = iWidth / 2;

int ysize = ystride * iHeight;

int vusize = uvstride * ( iHeight / 2 );

int size = ysize + ( 2 * vusize );

if(g_sws_ctx == NULL)


g_sws_ctx = sws_getContext(iWidth,



iWidth, iHeight,



m_picture_buf = (uint8_t*)malloc(size);


uint8_t *plane[] = { m_picture_buf, m_picture_buf + ysize, m_picture_buf + ysize + vusize, 0 };

int stride[] = { ystride, uvstride, uvstride, 0 };

uint8_t *inData[1] = { pARGBBuff };

int inLinesize[1] = { 4 * iWidth};

sws_scale(g_sws_ctx, inData, inLinesize, 0, iHeight, plane, stride );


The problem I am facing is that the colours are not right in the converted image.

What is the problem with the above code?

Attaching the snapshot of the source and destination images.


Libav-user mailing list
Ramesh Karanam | 28 Oct 18:31 2014

Problem With Playing Mp3 Audio Files

 When Playing mp3 Audio Files some songs are playing successfully but some
songs are not playing.When decoding audio file  getting error like No Data
found when processing input.

    dec_ctx = fmt_ctx->streams[audio_stream_index]->codec;

Finding Audio Stream :

    audio_st = fmt_ctx->streams[audio_stream_index];

Finally I am Decoding Audio

    if (packet.stream_index == audio_stream_index)
    				frame = avcodec_alloc_frame();
    				got_frame = 0;
    				ret = avcodec_decode_audio4(dec_ctx, frame, &got_frame, &packet);

Here avcodec_decode_audio4 returns the negative value when printing error it
shows Inavalid Data Found When Processing input.

 I am Using ffmpeg 2.0.1 My configure options are 

     --prefix=$PREFIX \
        --enable-shared \
        --enable-static \
        --enable-doc \
        --enable-ffmpeg \
        --enable-ffplay \
        --enable-ffprobe \
        --enable-ffserver \
        --enable-avdevice \
        --enable-doc \
        --enable-symver \
        --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
        --target-os=linux \
        --arch=arm \
        --enable-cross-compile \

  I am not understanding whats the problem?code or any modifications
required in ffmpeg configure file.Please Provide any information about this

View this message in context:
Sent from the libav-users mailing list archive at
greeshma | 28 Oct 03:09 2014

New MLP Encoder(urgent)


I am working on validating Mlp encoder in Libavcodec .
I have converted .wav file to .pcm file using acodec pcm_s16le .
Now i want to convert .pcm file to .mlp file using mlp encoder which i am working on.

the command line tool i am using is
./ffmpeg -i ~/file.pcm -acodec mlp -b:a 18m -r 29.97 -strict unofficial -sample_fmt s16 ~/final.mlp

But  i am getting the below error

user <at> user:~/ffmpeg_sources/ffmpeg$ ./ffmpeg -i ~/file.raw -acodec mlp -b:a 18m -r 29.97 -strict unofficial -sample_fmt s16 ~/final.mlp
ffmpeg version 2.4.git Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct 27 2014 22:58:52 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
  configuration: --prefix=/home/soumya/ffmpeg_build --extra-cflags=-I/home/soumya/ffmpeg_build/include --extra-ldflags=-L/home/soumya/ffmpeg_build/lib --bindir=/home/soumya/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab --cc=c99
  libavutil      54. 10.100 / 54. 10.100
  libavcodec     56.  9.102 / 56.  9.102
  libavformat    56.  9.101 / 56.  9.101
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  2.100 /  5.  2.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[image2 <at> 0x3d6ff60] Format image2 detected only with low score of 5, misdetection possible!
[rawvideo <at> 0x3d70d80] Invalid pixel format.
[image2 <at> 0x3d6ff60] Failed to open codec in av_find_stream_info
[rawvideo <at> 0x3d70d80] Invalid pixel format.
[image2 <at> 0x3d6ff60] Could not find codec parameters for stream 0 (Video: rawvideo, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
/home/user/file.raw: could not find codec parameters
Input #0, image2, from '/home/soumya/file.raw':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo, none, 25 tbr, 25 tbn, 25 tbc
Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (/home/soumya/final.mlp) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
File '/home/user/final.mlp' already exists. Overwrite ? [y/N] y
Output #0, mlp, to '/home/user/final.mlp':
Output file #0 does not contain any stream

and one more kind of error

/home/user/file.pcm: Invalid data found when processing input

Please help me out

Greeshma Balabhadra

Libav-user mailing list
Ierum Shanaya | 27 Oct 11:38 2014

ffmpeg threading

I am trying to run ffmpeg video decoding by creating multiple threads. The problem i am facing is that only one thread is created, irrespective of setting the thread_count to 0 or any no like say 2 , 4 etc.
I did check the config as below:
it doesnt have --enable pthreads things.. Is this the issue??.
If so, how to set the --enable pthread again in ffmpeg?? Can someone please help me understand.
I have Ubuntu 12.4 on my system(64 bit)

ierumshanaya <at> ubuntu:~/ffmpeg_sources/ffmpeg$ ffmpeg
ffmpeg version git-2014-01-05-f5f6e59 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan 22 2014 19:00:25 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --prefix=/home/ierumshanaya/ffmpeg_build/lib/pkgconfig --extra-cflags=-I/home/ierumshanaya/ffmpeg_build/include --extra-ldflags=-L/home/ierumshanaya/ffmpeg_build/lib --bindir=/home/ierumshanaya/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 60.100 / 52. 60.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.102 / 55. 22.102
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Libav-user mailing list