Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#77 closed defect (invalid)

Incomplete result

Reported by: curtis69 Owned by: michael
Priority: normal Component: ffmpeg
Version: git Keywords:
Cc: lou@lrcd.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I'm trying to transcode (-> MP4) a 2h video, but I never get a full time result; the result duration seems to be random (command line is the same)

The problem occurs quite often on many videos, maybe it's a command problem

I tried to encode 4 times, result duration are 15min, 28min, 60min, 95min.

Log:
http://pastebin.com/h0vrbECN
http://pastebin.com/1CFsEmPU

Command line:

/usr/local/bin/ffmpeg -i '__DaisyVol27.avi' -vcodec libx264 -f mp4 -acodec libfaac -ab 128k -ac 2 -ar 44100 $$$-flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method hex -subq 2 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 3 -refs 1 -directpred 1 -trellis 0 -flags2 +bpyramid-mixed_refs+wpred+dct8x8+fastpskip -wpredp 0 -rc_lookahead 10$$$ -b 1370k -bt 300k -maxrate 1644k -bufsize 2740k -threads 4 -coder ac '713.mp4' 2> ffmpeg.log

The $$$bla$$$ part is libx264-veryfast.ffpreset (of course the stars don't appear in command line)

ffmpeg -v 9 -loglevel 99 -i DaisyVol27.avi :

FFmpeg version git-6a7e074, Copyright (c) 2000-2011 the FFmpeg developers
  built on Mar  8 2011 13:16:19 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
  libavutil    50. 39. 0 / 50. 39. 0
  libavcodec   52.113. 2 / 52.113. 2
  libavformat  52.102. 0 / 52.102. 0
  libavdevice  52.  2. 3 / 52.  2. 3
  libavfilter   1. 76. 0 /  1. 76. 0
  libswscale    0. 12. 0 /  0. 12. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[NULL @ 0x13125b0] Probed with size=2048 and score=100
[avi @ 0x13125b0] All info found
Input #0, avi, from 'DaisyVol27.avi':
  Metadata:
    title           : Dorothy DAISY27
    album           : DAY 027
    encoder         : Lavf52.17.0
  Duration: 02:00:28.08, start: 0.000000, bitrate: 2056 kb/s
    Stream #0.0, 1, 1001/30000: Video: mpeg4, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 1001/30000, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0.1, 1, 1/16000: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
At least one output file must be specified

Change History (7)

comment:1 Changed 6 years ago by cehoyos

  • Status changed from new to open

Please provide a minimal command line (leave out everything that is not required to reproduce your problem) and please attach output: External resources might get unavailable.

Does the problem also occur if you do not use external libraries (i.e. without -acodec libfaac and without -vcodec libx264)?

comment:2 Changed 6 years ago by curtis69

Many hours of search lead me to this minimal command line :

ffmpeg -i test.avi -ab 128k -ar 44100 -ac 2 -f flv -s 640x480 test.flv

One more time, output length seems to be random (it can be full length, or just the begin, ...)

How to know if ffmpeg meet a problem but stop encoding without notice ? (ram, ...)
I see no error in ffmpeg output

FFmpeg version git-6a7e074, Copyright (c) 2000-2011 the FFmpeg developers
  built on Mar  8 2011 13:16:19 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
  libavutil    50. 39. 0 / 50. 39. 0
  libavcodec   52.113. 2 / 52.113. 2
  libavformat  52.102. 0 / 52.102. 0
  libavdevice  52.  2. 3 / 52.  2. 3
  libavfilter   1. 76. 0 /  1. 76. 0
  libswscale    0. 12. 0 /  0. 12. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[mpeg4 @ 0x1314fa0] Invalid and inefficient vfw-avi packed B frames detected
Input #0, avi, from 'test.avi':
  Duration: 01:25:00.48, start: 0.000000, bitrate: 581 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 720x304 [PAR 1:1 DAR 45:19], 25 tbr, 25 tbn, 25 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
[buffer @ 0x1333210] w:720 h:304 pixfmt:yuv420p
[scale @ 0x13335f0] w:720 h:304 fmt:yuv420p -> w:640 h:480 fmt:yuv420p flags:0xa0000004
Output #0, flv, to 'test.flv':
  Metadata:
    encoder         : Lavf52.102.0
    Stream #0.0: Video: flv, yuv420p, 640x480 [PAR 135:76 DAR 45:19], q=2-31, 200 kb/s, 1k tbn, 25 tbc
    Stream #0.1: Audio: adpcm_swf, 44100 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpeg4 @ 0x1314fa0] Invalid and inefficient vfw-avi packed B frames detected
Input stream #0.1 frame changed from rate:48000 fmt:s16 ch:6 to rate:48000 fmt:s16 ch:2
frame=   38 fps=  0 q=7.6 size=     171kB time=1.53 bitrate= 913.7kbits/s    
frame=  160 fps=151 q=31.0 size=     723kB time=6.36 bitrate= 930.4kbits/s    
frame=  287 fps=168 q=24.8 size=    1116kB time=11.47 bitrate= 797.3kbits/s    
frame=  357 fps=162 q=31.0 size=    1393kB time=14.30 bitrate= 798.1kbits/s    
frame=  445 fps=164 q=31.0 size=    1759kB time=17.79 bitrate= 810.0kbits/s    
frame=  488 fps=140 q=31.0 size=    1928kB time=19.55 bitrate= 807.9kbits/s    
frame=  654 fps=164 q=31.0 size=    2382kB time=26.15 bitrate= 746.4kbits/s    
[no problem in cut lines]
frame=25418 fps=124 q=31.0 size=  118126kB time=1016.71 bitrate= 951.8kbits/s    
frame=25542 fps=124 q=31.0 size=  118638kB time=1021.68 bitrate= 951.3kbits/s    
frame=25659 fps=124 q=31.0 size=  119024kB time=1026.32 bitrate= 950.0kbits/s    
frame=25787 fps=124 q=31.0 size=  119478kB time=1031.48 bitrate= 948.9kbits/s    
frame=25915 fps=125 q=31.0 size=  119962kB time=1036.59 bitrate= 948.0kbits/s    
frame=25965 fps=119 q=31.0 Lsize=  120167kB time=1038.58 bitrate= 947.8kbits/s    
video:74574kB audio:44837kB global headers:0kB muxing overhead 0.632647%

comment:3 Changed 6 years ago by cehoyos

How does the result of 'ffmpeg -i test.avi -f null -' looks like?
Note that no similar problem was ever reported, so I am not sure what the cause could be.

comment:4 Changed 6 years ago by curtis69

After a very long search, problem seems to be caused by crontab. FFmpeg jobs are launched by cron but I didn't know cron can break what it launch (that's why I come to here). That's really strange ...

I know it's not a ffmpeg related question, but have you any idea on how to prevent cron to act this way, or an alternative to cron to launch not manually ffmpeg encodings ?

Everywhere I asked nobody seems to get an answser

Thank you !

comment:5 Changed 6 years ago by curtis69

Finally I've found a solution : don't use cron, it's not reliable for big tasks like videos encoding.
You can use a bash script with an infinite loop and a sleep, simulating perfectly a cron

comment:6 Changed 6 years ago by llogan

  • Resolution set to invalid
  • Status changed from open to closed

Closing as invalid since reporter indicated the issue is with cron and not FFmpeg.

comment:7 Changed 6 years ago by llogan

  • Cc lou@lrcd.com added
Note: See TracTickets for help on using tickets.