Dake Gu | 9 Feb 21:36
Picon

NEON optimization alignment problem

I built ffmpeg on Cortex-A8 on CodeSourcery 2007q3-51 with:
--arch=arm --cpu=cortex-a8 --extra-cflags="-mfpu=neon -mfloat-abi=softfp"

It's causing thousands of alignment trap in /var/log/messages.  However if
set /proc/cpu/alignment to be 0 (ignored),  ffmpeg just works correctly.

It might be related to FAST_UNALIGNED,  but even I turned it off,  the
alignment is still happening from couple places of NEON code.  For example,
alignment trap is caught in ff_h264_h_loop_filter_luma_neon where "VLD1.64"
is loading from address not aligned to 64bits.

Is the alignment have to be set to ignored? or I didn't compile it
correctly?
Prince | 9 Feb 15:52
Picon

Maybe bit_rate is not correct?

Hi All,

I just want to decode a video which from my iPhone, get the many  
images and do some thing balabala...., then I will re-create a video  
from this images, the settings of video or audio is not change. This  
is my thinking.

According the output_simple.c sample code,  I write a test code, that  
just decode the video, then encode that to another video, but new  
there some issues with it.
The duration is decreased to half, and the quality is less that  
original, the file size is also less than original, what caused this,  
please give me a hand .
The following is the logs of ffmpeg, and some codes, any replies is  
welcome, thanks advance.

  The logs from dump_format:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/mobile/Applications/ 
E106BA0F-03B0-41EC-BCC4-D57688A3BBDE/mpegTest.app/IMG_0012.MOV':
   Metadata:
     major_brand     : qt
     minor_version   : 0
     compatible_brands: qt
     year            : 2010-02-08T14:47:17+0800
     year-eng        : 2010-02-08T14:47:17+0800
   Duration: 00:00:06.31, start: 0.000000, bitrate: 3696 kb/s
     Stream #0.0(und): Video: h264, yuv420p, 640x480, 3670 kb/s, 26.28  
fps, 300 tbr, 600 tbn, 1200 tbc
     Stream #0.1(und): Audio: aac, 44100 Hz, mono, s16, 63 kb/s
Output #0, mov, to '/var/mobile/Applications/E106BA0F-03B0-41EC-BCC4- 
D57688A3BBDE/Documents/TEST.MOV':
     Stream #0.0: Video: mpeg4, yuv420p, 640x480, q=2-31, 3670 kb/s,  
300 tbr, 600 tbn, 1200 tbc
     Stream #0.1: Audio: aac, 44100 Hz, 1 channels, 63 kb/s

Some codes that set the out put video stream:

static AVStream *add_video_stream(AVFormatContext *oc, int codec_id)
{
	AVCodecContext *c;
	AVStream *st;
	
	st = av_new_stream(oc, 0);
	if (!st) {
		fprintf(stderr, "Could not alloc stream\n");
		exit(1);
	}
	
	c = st->codec;
	c->codec_id = codec_id;
	c->codec_type = CODEC_TYPE_VIDEO;
	
	st->r_frame_rate.den = pFormatCtx->streams[videoStream]- 
 >r_frame_rate.den;
	st->r_frame_rate.num = pFormatCtx->streams[videoStream]- 
 >r_frame_rate.num;
	st->avg_frame_rate.den = pFormatCtx->streams[videoStream]- 
 >avg_frame_rate.den;
	st->avg_frame_rate.num = pFormatCtx->streams[videoStream]- 
 >avg_frame_rate.num;
	st->sample_aspect_ratio.den = pFormatCtx->streams[videoStream]- 
 >sample_aspect_ratio.den;
	st->sample_aspect_ratio.num = pFormatCtx->streams[videoStream]- 
 >sample_aspect_ratio.num;
	st->pts_wrap_bits = pFormatCtx->streams[videoStream]->pts_wrap_bits;
	
	st->quality = pFormatCtx->streams[videoStream]->quality;
	st->time_base.den = pFormatCtx->streams[videoStream]->time_base.den;
	st->time_base.num = pFormatCtx->streams[videoStream]->time_base.num;
	st->nb_frames = pFormatCtx->streams[videoStream]->nb_frames;
	
	/* put sample parameters */
	c->bit_rate = pCodecCtx->bit_rate;
	/* resolution must be a multiple of two */
	c->width = pCodecCtx->width;
	c->height = pCodecCtx->height;
	/* time base: this is the fundamental unit of time (in seconds) in  
terms
	 of which frame timestamps are represented. for fixed-fps content,
	 timebase should be 1/framerate and timestamp increments should be
	 identically 1. */
	c->coded_frame = pCodecCtx->coded_frame;
	c->time_base.den = pCodecCtx->time_base.den;
	c->time_base.num = pCodecCtx->time_base.num;
	c->gop_size = pCodecCtx->gop_size; /* emit one intra frame every  
twelve frames at most */
	c->pix_fmt = pCodecCtx->pix_fmt;
	c->max_b_frames = pCodecCtx->max_b_frames;
	c->me_method = pCodecCtx->me_method;
	c->rate_emu = 0;

	
	if (c->codec_id == CODEC_ID_MPEG2VIDEO) {
		/* just for testing, we also add B frames */
		c->max_b_frames = 2;
	}
	if (c->codec_id == CODEC_ID_MPEG1VIDEO){
		/* needed to avoid using macroblocks in which some coeffs overflow
		 this doesnt happen with normal video, it just happens here as the
		 motion of the chroma plane doesnt match the luma plane */
		c->mb_decision=2;
	}
	// some formats want stream headers to be separate
	if(!strcmp(oc->oformat->name, "mp4") || !strcmp(oc->oformat->name,  
"mov") || !strcmp(oc->oformat->name, "3gp"))
		c->flags |= CODEC_FLAG_GLOBAL_HEADER;
	
	return st;
}
Mark Shen | 9 Feb 15:49
Picon

Invitation to connect on LinkedIn

LinkedIn
------------Mark Shen requested to add you as a connection on LinkedIn:
------------------------------------------

Emre,

I'd like to add you to my professional network on LinkedIn.

- Mark

Accept invitation from Mark Shen
http://www.linkedin.com/e/vAKFaBxC6PLPsepqjSe4ff4h9MAYb3h_ILL_NX/blk/I539691810_3/pmpxnSRJrSdvj4R5fnhv9ClRsDgZp6lQs6lzoQ5AomZIpn8_cRYMcjwNejoVcPl9bSx4tTlSoDEQbP0Tc3kRdzARc34LrCBxbOYWrSlI/EML_comm_afe/

View invitation from Mark Shen
http://www.linkedin.com/e/vAKFaBxC6PLPsepqjSe4ff4h9MAYb3h_ILL_NX/blk/I539691810_3/0PnP0Ne34VdzAPdkALqnpPbOYWrSlI/svi/

------------------------------------------

Why might connecting with Mark Shen be a good idea?

People Mark Shen knows can discover your profile:
Connecting to Mark Shen will attract the attention of LinkedIn users. See who's been viewing your profile:

http://www.linkedin.com/e/wvp/inv18_wvmp/

 
------
(c) 2010, LinkedIn Corporation
João Tiago José | 9 Feb 13:40
Picon

Center images on video

Hi,

I'm using images with several widths. I would like to create a video
with those. But i would like the images to be centered in the video...
Is this possible?

Best regards,
João José
Picon

problems in parsing RTSP stream which uses VC-1 codec

hello every one,

      I have to parse I-frame in the RTSP stream which uses VC-1 codec.

ffmpeg has open source code. I tried to print the information about the RTSP
stream which uses VC-1 codec using ffmpeg -i rtsp://ipaddress/rtspstreamname

I get the following error message "Error while parsing header" This stream
works well with VLC player.

IF ANYBODY HAS IDEA FOR MY PROBLEM THEN PLEASE LET ME KNOW.

*(For testing*
I had downloaded the whole RTSP stream using NET transport tool. And I
checked the video which is now in my local HDD and was in RTSP server, could
be able to print all its information using ffmpeg -i localHDD/videofile .
Also I could be able to separate the I-frames into another video file.
So the video file which is in the server has no problem. )

Regards,
Arang
Michael | 9 Feb 11:15
Picon
Picon

Crystal HD

Hello,

I was wondering if there are any plans to add support for crystalhd
hardware decoder in ffmpeg?

The software stack (GPL2) is available from
http://www.broadcom.com/support/crystal_hd/ (the Linux
sources need to be dos2unix'ed first!). The kernel module seems to
build on modern distributions. XBMC have it working quite well.

Questioning the mplayer guys, they suggested that it would be much better to 
incorporate it into ffmpeg, so it triples down to VLC and mplayer and any 
other app that makes use of ffmpeg.

Regards,

Michael
avinash p.v | 9 Feb 10:50
Picon

Issues with Live screen casting using X11grab

Dear All,

I am a Student working on a Project in which I need to Stream my Desktop
Live to another System over a wireless Network. I am stuck very badly, any
help will be greatly appreciated.

*I am able to grab the Screen successfully* with the following command:
$ ./ffmpeg -f x11grab -r 24 -s 1024x720 -i :0.0 out.mpg
OR even better quality by
$ ffmpeg -an -f x11grab -r 25 -s 1024x768 -i ":0.0" -vcodec mpeg4 -sameq
/tmp/bla.mp4

Then I am trying to stream this to the ffserver with the following command ;
and I have* hit a road block*.*
$ ffmpeg -f x11grab  -r 3 -b 64 -g 12 -s 1024x720  -i :0.0
http://localhost:8090/screencast.ffm*

FFmpeg version SVN-r20911, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  built on Dec 24 2009 10:42:59 with gcc 4.3.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree
--enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame
--enable-libxvid --enable-x11grab
  libavutil     50. 7. 0 / 50. 7. 0
  libavcodec    52.43. 0 / 52.43. 0
  libavformat   52.44. 0 / 52.44. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 7. 2 /  0. 7. 2
WARNING: The bitrate parameter is set too low. It takes bits/s as argument,
not kbits/s
[x11grab @ 0x8c7a390]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1024
height: 720
[x11grab @ 0x8c7a390]shared memory extension  found
[x11grab @ 0x8c7a390]MAX_READ_SIZE:
5000000 reached
[x11grab @ 0x8c7a390]Estimating duration from bitrate, this may be
inaccurate
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1265699007.493820, bitrate: 70778 kb/s
    Stream #0.0: Video: rawvideo, bgra, 1024x720, 70778 kb/s, 3 tbr, 1000k
tbn, 3 tbc
[mpeg4 @ 0x8c8b7c0]bitrate tolerance too small for bitrate
Output #0, ffm, to 'http://localhost:8090/screencast.ffm':
    Stream #0.0: Video: mpeg4, yuv420p, 1360x768, q=3-31, 64 kb/s, 1000k
tbn, 3 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Error while opening encoder for output stream #0.0 - maybe incorrect
parameters such as bit_rate, rate, width or height
*
My ffserver.conf file is :*

Port 8090
BindAddress 0.0.0.0
MaxClients 1000
MaxBandwidth 1000
NoDaemon

<Feed screencast.ffm>
File /tmp/screencast.ffm
FileMaxSize 10M
ACL allow 127.0.0.1
</Feed>

<Stream screencast.avi>
Feed screencast.ffm
Format avi
AudioBitRate 32
AudioChannels 1
AudioSampleRate 22050
VideoBitRate 64
VideoBufferSize 40
VideoFrameRate 3
VideoSize 1024x720
VideoGopSize 12
NoAudio
</Stream>

<Stream stat.html>
Format status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>

<Redirect index.html>
URL http://www.ffmpeg.org/
</Redirect>

So, please help me by answering these qustions:

   1. *Am I heading in the right direction at all. Is it achievable from
   FFMPEG? I did'nt find much help online related to live streaming.
   *
   2. *If so, what are the changes i need to make either in the cofig file
   or in the command.. or is there any other way.
   *
   3. *Please suggest me some documentation [tutorials] with which i could
   work better.*

Thanks & Regards
Avinash P V
Andrew Hakman | 9 Feb 02:36
Picon

from multiple stereo mp2 streams to 6ch ac3 possible?

Hi

I have a transport stream that contains 3 stereo mp2 audio tracks, and
one h.264 video track. I would like to take the 3 stereo mp2 tracks
and turn them into 6 channel ac3, resulting in a transport stream with
1 h.264 video and 1 6ch ac3 audio. Also, I'd have to be able to
re-order the audio tracks to get them into the right order for ac3 as
well. Is there a way to do this with ffmpeg? In realtime?

Thanks,
Andrew
Grant Edwards | 8 Feb 21:49
Picon

How to get machine-friendly output from ffmpeg?

I've been working on some scripts/programs that use ffmpeg to
convert files from one video format to another.

I need to monitor the progress so I can calculate a %complete
and an ETA.  (I was pretty surprised that ffmpeg doesn't do
that since most other similar programs seem to).  I also need
to discard all of the preliminary stuff that ffmpeg spits out
on startup (configuration info and a table of codecs/formats).
All that stuff just makes the useful information harder to
spot.

I've got something working, but it's been painful using ffmpeg
programmatically because of the hostile output format -- mostly
the mixture of newlines and carriage returns for line endings.

It would also be a lot easier to handle output programmatically
if time values were displayed consistently rather than being a
mixture of hh:mm:ss.ss in some and just ssssss.ss in others.

I've searched the options and there doesn't seem to be any way
to get the output to use consistent line endings.  I don't care
what line endings, but they need to be consistent.

The problem of not having readily parsable output seems to have
come up several times in the past, but all I could find were
hacks that attempt work around the issues by filtering the
output through "strings" or perl scripts to try to fix up the
output.  [You can't use "tr" to fix the line ending problem
because it buffers it's output.]

Is there any proscpect of a real solution?

--

-- 
Grant Edwards                   grante             Yow! I'm a fuschia bowling
                                  at               ball somewhere in Brittany
                               visi.com            
Seaweed | 8 Feb 21:44
Picon

Artifacts after seekign to first frame of the file

I am trying to decode h264 video from a file using avcodec, I pull all the
frames into a circular buffer and get a frame from the buffer, submit to the
decoder. Everything seems to be fine except when I reach the end of the file, I
do a seek to the beginning, weird artifacts starts hapenning.Here is what I have
to seek to beginning:  

if(av_read_frame(pFormatCtx, packet) < 0)
{

   av_seek_frame(pFormatCtx, ffStreamIdx, 0, AVSEEK_FLAG_FRAME);
}
else
{
   stuff frame to buffer..
}

Is there something wrong in the way I am seeking to the beginning of file? If
not, is there something else I have to do to, like reset some element of
avformat or avcontext?

Thanks 
Andy Armstrong | 8 Feb 14:24
Gravatar

Get metadata then exit?

If I do

   $ ffmpeg -i somefile

it displays the duration and bitrate then exits with a non-zero status.

I'd like to use ffmpeg in this way to find the duration of a number of 
video files. I can scrape ffmpeg's output to get the information I need 
but I wonder if there's a 'proper' invocation which would make ffmpeg 
output the information and exit with 0 status?

--

-- 
Andy Armstrong, Hexten

Gmane