You are not logged in.

#1 2011-12-10 23:03:36

Fal
Member
Registered: 2007-03-21
Posts: 30

ffmpeg problem, output information really odd.

Hi all

Just noticed something really weird trying to code videos to watch on my Xbox 360. Seems that my ffmpeg generates only 40ms long videos with all the data forced there.. Well quite obviously videos don't work at all. Could be some broken package other than ffmpeg but not quite sure how it would affect, since ffmpeg only makes the container..

Will report soon more as I can dig out some details of this dilemma.

ADD:

Here's an example of output from command ffmpeg -i video.h264 -i audio.aac -acodec copy -vcodec copy -f mp4 test.m4v

frame=135387 fps=1347 q=-1.0 Lsize=  952707kB time=00:00:00.04 bitrate=187124280.4kbits/s    
video:810011kB audio:139566kB global headers:0kB muxing overhead 0.329623%

Last edited by Fal (2011-12-10 23:14:43)

Offline

#2 2011-12-11 00:02:20

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: ffmpeg problem, output information really odd.

It may be an ordering thing or a map thing. Maybe this will work?

ffmpeg -i video.h264 -i audio.aac -map 0:0 -map 1:0 -vcodec copy -acodec copy -f mp4 test.m4v

Offline

#3 2011-12-11 00:30:41

Fal
Member
Registered: 2007-03-21
Posts: 30

Re: ffmpeg problem, output information really odd.

Already tried a few different combinations without anykind of success.. And the weirdest part so far: Everything else seems to work. I can recode anything into anything but copying both like that simply fails.

This used to work few weeks ago...

Offline

#4 2011-12-11 00:37:43

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: ffmpeg problem, output information really odd.

It worked before with these particular streams or just in general? If the steams are new and you haven't tried this already, you may want to take a look at each stream with mediainfo and see if anything looks out of place.

Offline

#5 2011-12-11 00:44:46

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: ffmpeg problem, output information really odd.

try to encapsulate just the audio and just the video, to see which on makes ffmpeg go insane. As you say, the problem can be in video.h264 or audio.aac

Offline

#6 2011-12-11 00:49:34

Fal
Member
Registered: 2007-03-21
Posts: 30

Re: ffmpeg problem, output information really odd.

Just tested with 3 weeks old files I found in the archive. Those worked back then, not anymore.

Add:
video.h264 seems to be the culprit..

Last edited by Fal (2011-12-11 00:50:47)

Offline

#7 2011-12-11 03:14:44

DrZaius
Member
Registered: 2008-01-02
Posts: 193

Re: ffmpeg problem, output information really odd.

Fal wrote:

Seems that my ffmpeg generates only 40ms long videos...

40ms according to ... ? Does the output play as expected with ffplay?

Fal wrote:

Here's an example of output from command ffmpeg -i video.h264 -i audio.aac -acodec copy -vcodec copy -f mp4 test.m4v

Can you also show the complete FFmpeg console output?

Fal wrote:

video.h264 seems to be the culprit..

Where did video.h264 come from?

Offline

#8 2011-12-11 10:20:05

Fal
Member
Registered: 2007-03-21
Posts: 30

Re: ffmpeg problem, output information really odd.

video.h264 comes from x264. I've made a simple shellscript for generating those files from mplayer output (I usually need to burn subtitles into the video and that is an easy way for it).

Playing tose files with mplayer (or vlc) works. There is no problem with the files. MP4Box seemed to be able to produce ~working mp4 file for the xbox with the same files.

Normally when wrapping those files into a container ffmpeg shows a line which tells about the process. There's a section "time" in that line which tells how long it has gone into the video. and I get:

frame=135387 fps=1347 q=-1.0 Lsize=  952707kB time=00:00:00.04 bitrate=187124280.4kbits/s

Complete ffmpeg output:

ffmpeg version N-35110-g0b9a69f, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov 23 2011 12:55:01 with gcc 4.6.2
  configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-libgsm --enable-libspeex --enable-postproc --enable-shared --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-librtmp --enable-gpl --enable-version3 --enable-runtime-cpudetect --disable-debug --disable-static
  libavutil    51. 26. 0 / 51. 26. 0
  libavcodec   53. 37. 0 / 53. 37. 0
  libavformat  53. 21. 0 / 53. 21. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 49. 0 /  2. 49. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[h264 @ 0x806760] max_analyze_duration 5000000 reached at 5000000
[h264 @ 0x806760] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 48.00 (48/1) -> 24.00 (48/2)
Input #0, h264, from 'video.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1200k tbn, 48 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'audio.aac':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: M4A mp42isom
    creation_time   : 2011-12-08 22:19:51
    encoder         : Nero AAC codec / 1.5.4.0
  Duration: 01:24:03.13, start: 0.000000, bitrate: 195 kb/s
    Chapter #1.0: start 0.054667, end 5043.136000
    Metadata:
      title           : 
    Stream #1:0(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 193 kb/s
    Metadata:
      creation_time   : 2011-12-08 22:19:51
      handler_name    : 
Output #0, mp4, to 'test.m4v':
  Metadata:
    encoder         : Lavf53.21.0
    Chapter #0.0: start 0.054667, end 5043.136000
    Metadata:
      title           : 
    Stream #0:0: Video: h264 (![0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 24 fps, 24 tbn, 24 tbc
    Stream #0:1(und): Audio: aac (@[0][0][0] / 0x0040), 48000 Hz, stereo, 193 kb/s
    Metadata:
      creation_time   : 2011-12-08 22:19:51
      handler_name    : 
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=121030 fps=1516 q=-1.0 Lsize= 1796882kB time=00:00:00.04 bitrate=353278629.3kbits/s    
video:1674861kB audio:119225kB global headers:0kB muxing overhead 0.155845%

When I try to play this file with mplayer, I only get the video without audio. When I try to seek forward the video stops and I start to hear the audio. vlc is stuck on one image of the video, audio plays. ffplay plays at double speed without audio.

Last edited by Fal (2011-12-11 10:29:38)

Offline

#9 2011-12-11 19:07:21

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: ffmpeg problem, output information really odd.

I seem to recall having a similar problem. One trick that might work is to use the "pass 1" and "pass 2" flags.

Offline

#10 2011-12-11 22:47:53

Fal
Member
Registered: 2007-03-21
Posts: 30

Re: ffmpeg problem, output information really odd.

Using the pass flag doesn't do a thing. Passes matter when encoding the video. I'm not encoding anything.

Video encoding has already been done with mplayer / x264 using yuv4mpeg. Audio is done with neroAacEnc and individual files work as intented. Putting them in a mp4 container doesn't work with ffmpeg.

Strange enough I deviced an alternative way to do this.. I make conversion to h264 and burning of the subtitles with mencoder and use ffmpeg to recode the audio (-acodec aac -strict experimental) and it works. So it is quite weird problem.

Here's my wannabe tool for the conversion:

mplayer -nosound -benchmark -fontconfig -font 'Sans:style=Bold' \
	-subfont-outline 2 -subfont-text-scale 2.1 -sub-bg-alpha 0 \
	-subfont-blur 0 -sub-bg-color 0 -vf harddup -vo yuv4mpeg:file=>(x264 \
	--demuxer y4m --crf $4 --preset fast --profile baseline \
	--threads auto --output video.h264 - 2>x264.log) \
	"$1" -sub "$2" $5

mplayer -nocorrect-pts -vo null -vc null \
	-ao pcm:fast:file=>(neroAacEnc -ignorelength -lc -q 0.6 -if - \
	-of audio.mp4 2>nero.log) "$1" $5

ffmpeg -y -i video.h264 -i audio.mp4 -acodec copy -vcodec copy -f mp4 "$3"
$1 = Videofile
$2 = Subtitles (/dev/null works if no subtitles wanted)
$3 = Target filename
$4 = CRF value (I usually use ~23)
$5 = Extra parameters to mplayer (eg. "-endpos 0:00:30")

Last edited by Fal (2011-12-11 22:48:36)

Offline

Board footer

Powered by FluxBB