Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3682 closed defect (invalid)

The picture freezes but the audio continues when using ffplay on a video coming from a Samsung S3

Reported by: gouessej Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When I play a video filmed with a Samsung S3 4G i9305, it works correctly on my phone, it works correctly under Windows 7 64 bits with ffmpeg 2.2.2 and ffmpeg 2.0.3 but not under Mageia Linux 4 (32 bits) with ffmpeg 2.0.3, the picture freezes and the audio continues. Remultiplexing the video doesn't fix it whereas it is a known workaround for videos made with a Samsung S2. The container format is 3gp4 as far as I know. Someone else succeeded in playing it under ArchLinux. My machine is quite old (2005), it has no support of SSE2, the processor isn't a dual core (AMD Sempron 2600+), I don't know whether it affects the decoding.

Please find below some information about this video:
Duration: 00:06:22.98, start: 0.000000, bitrate: 17149 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 17021 kb/s, 30.04 fps, 30.08 tbr, 90k tbn, 180k tbc

Metadata: creation_time : 2014-05-24 13:35:39 handler_name : VideoHandle Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s Metadata: creation_time : 2014-05-24 13:35:39

How to reproduce:
Use ffplay with this video:
http://tuer.sourceforge.net/videos/Video20140524_152907_remuxed.mp4

Change History (20)

comment:1 by Carl Eugen Hoyos, 10 years ago

Please test current FFmpeg git head and please post the complete, uncut console output to make this a valid ticket.

in reply to:  1 comment:2 by gouessej, 10 years ago

Replying to cehoyos:

Please test current FFmpeg git head and please post the complete, uncut console output to make this a valid ticket.

I'll test with the latest static build tonight:
http://ffmpeg.gusari.org/static/32bit/

In the meantime, can you explain exactly which console output you expect? Should I post everything?

comment:3 by Carl Eugen Hoyos, 10 years ago

If you are not on Windows, "everything" should be ~50 lines and nothing should be omitted.
On Windows, there is a possibility to make your shell window wider (so that you get the same fifty lines).
If you cannot make your window wider, post at least the top and the tail of the console output, only cut the repeated lines in-between.

in reply to:  3 ; comment:4 by gouessej, 10 years ago

Replying to cehoyos:

If you are not on Windows, "everything" should be ~50 lines and nothing should be omitted.
On Windows, there is a possibility to make your shell window wider (so that you get the same fifty lines).
If you cannot make your window wider, post at least the top and the tail of the console output, only cut the repeated lines in-between.

I've just tried the very latest build, I get the following error message:
instruction not allowed

It has probably been compiled with SSE2 :(

comment:5 by gouessej, 10 years ago

ffplay version 2.0.3 Copyright (c) 2003-2013 the FFmpeg developers

built on Feb 9 2014 23:12:27 with gcc 4.8.2 (GCC)
configuration: --prefix=/usr --enable-shared --libdir=/usr/lib --shlibdir=/usr/lib --incdir=/usr/include --disable-stripping --enable-postproc --enable-gpl --enable-pthreads --enable-libtheora --enable-libvorbis --disable-encoder=vorbis --enable-libvpx --enable-x11grab --enable-runtime-cpudetect --enable-libdc1394 --enable-libschroedinger --enable-librtmp --enable-libspeex --enable-libfreetype --enable-libnut --enable-libgsm --enable-libcelt --enable-libopus --disable-libopencv --enable-libopenjpeg --enable-libtwolame --enable-libxavs --enable-frei0r --enable-libmodplug --enable-libass --enable-gnutls --enable-libcdio --enable-libpulse --enable-libv4l2 --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libx264 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libxvid
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Video20140524_152907_remuxed.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf54.59.106

Duration: 00:00:28.98, start: 0.000000, bitrate: 17146 kb/s

Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 17016 kb/s, 30.02 fps, 30.08 tbr, 90k tbn, 180k tbc
Metadata:

handler_name : VideoHandler

Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s
Metadata:

handler_name : SoundHandler

11.24 A-V: 7.374 fd= 113 aq= 0KB vq=15381KB sq= 0B f=0/0

in reply to:  4 ; comment:6 by Carl Eugen Hoyos, 10 years ago

Replying to gouessej:

I've just tried the very latest build, I get the following error message:
instruction not allowed

This sounds important, how can I reproduce this?

in reply to:  6 comment:7 by gouessej, 10 years ago

Replying to cehoyos:

Replying to gouessej:

I've just tried the very latest build, I get the following error message:
instruction not allowed

This sounds important, how can I reproduce this?

I assume the static library has been compiled with some SIMD instructions only available in SSE2 and later. As there were only ffmpeg and ffprobe in the archive, just run "ffmpeg -version" on a computer whose microprocessor has no support of SSE2, for example an Intel Pentium 3 or an AMD Sempron. If I'm right, it's not very important as it's possible to disable this requirement. Mageia Linux 5 (Cauldron, unstable) bundles ffmpeg 2.2.2, the packager always does its best to make it work with non SSE2 microprocessors.

Is this ticket valid if I reproduce the bug with ffmpeg 2.2.2 or do you want me to rebuild ffmpeg from source?

comment:8 by Carl Eugen Hoyos, 10 years ago

Just rebuild current FFmpeg git head with ./configure && make, this will also fix your crash (that should not be FFmpeg-related, FFmpeg is by default always compiled with SIMD support but still works in older CPUs).

in reply to:  8 ; comment:9 by gouessej, 10 years ago

Replying to cehoyos:

Just rebuild current FFmpeg git head with ./configure && make, this will also fix your crash (that should not be FFmpeg-related, FFmpeg is by default always compiled with SIMD support but still works in older CPUs).

I tried to do that, it built everything except ffplay. yasm was missing, I installed it, I'm going to run configure and make anew. Do I have to do anything else to build ffplay?

in reply to:  9 comment:10 by Carl Eugen Hoyos, 10 years ago

Replying to gouessej:

Do I have to do anything else to build ffplay?

libsdl libraries and headers, the necessary package may be called libsdl-dev or libsdl-devel.

In case you are just reporting a performance issue: ffplay is more a test program than a media player and it is known not to provide the best possible performance, MPlayer allows you to use some tricks (-vo xv, -vo gl_nosw, -speed 0.95) to playback clips that ffplay does not play in realtime.

Generally, newer ffplay is of course believed to be faster than older ffplay.

comment:11 by gouessej, 10 years ago

It works with mplayer as is:
[gouessej@localhost ~]$ mplayer Images/2014/0524/Video20140524_152907_remuxed.mp4
MPlayer SVN-3.r36361.1.mga4.tainted-4.8.2 (C) 2000-2013 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing Images/2014/0524/Video20140524_152907_remuxed.mp4.
libavformat version 55.12.100 (external)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang eng
VIDEO: [H264] 1920x1080 24bpp 30.083 fps 17016.3 kbps (2077.2 kbyte/s)
Clip info:

major_brand: isom
minor_version: 512
compatible_brands: isomiso2avc1mp41
encoder: Lavf54.59.106

Load subtitles in Images/2014/0524/
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 55.18.102 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Trying to force audio codec driver family libmad...
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, floatle, 123.1 kbit/4.01% (ratio: 15389->384000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] 48000Hz 2ch floatle (4 bytes per sample)
Starting playback...
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 1920x1080 => 1920x1080 Planar YV12 [zoom]
A: 11.4 V: 1.7 A-V: 9.675 ct: 0.037 0/ 0 604% 71% 72.2% 50 0


Your system is too SLOW to play this!

Possible reasons, problems, workarounds:

  • Most common: broken/buggy _audio_ driver
    • Try -ao sdl or use the OSS emulation of ALSA.
    • Experiment with different values for -autosync, 30 is a good start.
  • Slow video output
    • Try a different -vo driver (-vo help for a list) or try -framedrop!
  • Slow CPU
    • Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts, e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.
  • Broken file
    • Try various combinations of -nobps -ni -forceidx -mc 0.
  • Slow media (NFS/SMB mounts, DVD, VCD etc)
    • Try -cache 8192.
  • Are you using -cache to play a non-interleaved AVI file?
    • Try -nocache.

Read DOCS/HTML/en/video.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.

A: 18.4 V: 2.9 A-V: 15.485 ct: 0.037 0/ 0 547% 65% 67.9% 86 0

Too many video packets in the buffer: (474 in 33587900 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
A: 18.4 V: 3.6 A-V: 14.771 ct: 0.110 0/ 0 538% 63% 54.7% 86 0

Exiting... (Quit)

in reply to:  11 ; comment:12 by Carl Eugen Hoyos, 10 years ago

Resolution: invalid
Status: newclosed
Version: 2.0.4unspecified

Replying to gouessej:

A: 18.4 V: 2.9 A-V: 15.485 ct: 0.037 0/ 0 547% 65% 67.9% 86 0

"547%" means that you would need (at least) six cores of your cpu to decode this video in realtime. There is really nothing that we can change about this.

Consider reencoding your video:
$ ffmpeg -i input -vcodec mpeg1video -qscale 2 -acodec copy out.mp4
The output file has the same visual quality than your input file but playback should succeed in realtime.

comment:13 by gouessej, 10 years ago

I was playing this video while compiling ffmpeg. Please wait for a moment before closing this bug report.

in reply to:  12 comment:14 by gouessej, 10 years ago

BRANCH: master (772d46d)

$ ./ffplay ~/Images/2014/0524/Video20140524_152907_remuxed.mp4
ffplay version N-63596-g772d46d Copyright (c) 2003-2014 the FFmpeg developers

built on May 30 2014 15:12:42 with gcc 4.8.2 (GCC)
configuration:
libavutil 52. 87.100 / 52. 87.100
libavcodec 55. 65.100 / 55. 65.100
libavformat 55. 42.100 / 55. 42.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/gouessej/Images/2014/0524/Video20140524_152907_remuxed.mp4':

Metadata
0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf54.59.106 Duration: 00:00:28.98, start: 0.000000, bitrate: 17146 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 17016 kb/s, 30.02 fps, 30.08 tbr, 90k tbn, 180k tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s (default) Metadata: handler_name : SoundHandler 11.30 A-V: -3.966 fd= 114 aq= 0KB vq=15376KB sq= 0B f=0/0

comment:15 by gouessej, 10 years ago

Resolution: invalid
Status: closedreopened
Version: unspecifiedgit-master

I followed your advice:
ffmpeg -i Images/2014/0524/Video20140524_152907_remuxed.mp4 -vcodec mpeg1video -qscale 2 -acodec copy out.mp4

and I get the same result:
$ ./ffplay ~/out.mp4
ffplay version N-63596-g772d46d Copyright (c) 2003-2014 the FFmpeg developers

built on May 30 2014 15:12:42 with gcc 4.8.2 (GCC)
configuration:
libavutil 52. 87.100 / 52. 87.100
libavcodec 55. 65.100 / 55. 65.100
libavformat 55. 42.100 / 55. 42.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/gouessej/out.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf55.12.100

Duration: 00:00:29.03, start: 0.000000, bitrate: 70256 kb/s

Stream #0:0(eng): Video: mpeg1video (mp4v / 0x7634706D), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 104857 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (default)
Metadata:

handler_name : VideoHandler

Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s (default)
Metadata:

handler_name : SoundHandler

6.65 A-V: -1.402 fd= 128 aq= 0KB vq=15548KB sq= 0B f=0/0

comment:16 by Carl Eugen Hoyos, 10 years ago

How does MPlayer output looks like?

comment:17 by gouessej, 10 years ago

It works more or less, the video is glitchy and the sound stops every 10 seconds, it resumes later and so on. It works steadily with VLC, the sound is OK but tons of frames are glitchy. Actually, I have to admit that remultiplexing with another container (mpeg1video) improves the situation except with ffplay.

comment:18 by Carl Eugen Hoyos, 10 years ago

Resolution: invalid
Status: reopenedclosed

Now please test if this is all just pulse-related by switching to alsa. If this doesn't help you will have to reduce the output resolution when reencoding.

In any case (I would expect that this is just a pulse issue since >500% CPU usage may be too much even for your Sempron), this is not a bug in FFmpeg and this is a bug tracker, not a support forum, sorry.

in reply to:  18 comment:19 by gouessej, 10 years ago

Replying to cehoyos:

Now please test if this is all just pulse-related by switching to alsa. If this doesn't help you will have to reduce the output resolution when reencoding.

In any case (I would expect that this is just a pulse issue since >500% CPU usage may be too much even for your Sempron), this is not a bug in FFmpeg and this is a bug tracker, not a support forum, sorry.

When I bought my phone last year, I could play the videos almost flawlessly, just with a few glitches. It began freezing in February 2014. That's why I didn't imagine that it was just a performance problem and I suspected that something was broken in ffmpeg. Before filing this bug report, I remuxed some videos with the same container and with another one as it was a known workaround for Samsung Galaxy phones but it didn't help. The only way to work around this "limitation" consists in using mpeg1video as a container as a first step before converting it into another format. Moreover, even the videos I made before February were affected, that's why I suspected that it didn't come from an Android update. I have never thought that this place is a support forum, I asked for help on the IRC channel first, the workaround is far from being obvious and I'm not sure it will help me to put my videos onto Mediagoblin anew. As I use ffmpeg to convert my videos into WebM before uploading them, I suspected that the problem came from it. Sorry for the annoyance.

comment:20 by Carl Eugen Hoyos, 10 years ago

As said: Please provide MPlayer output, it tells us about the CPU usage.

Note: See TracTickets for help on using tickets.