Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No video stream detected in VideoSource #6

Open
sofian opened this issue Dec 28, 2012 · 4 comments
Open

No video stream detected in VideoSource #6

sofian opened this issue Dec 28, 2012 · 4 comments

Comments

@sofian
Copy link
Owner

sofian commented Dec 28, 2012

I got this weird bug today. When trying to play a video file with VideoSource I get a "no video stream" warning from Drone and nothing plays.

The error seems to be coming from the fact that _formatContext->nb_streams = 0 in Gear_VideoSource.cpp (see below). What is weird is that the av_dump_format call at line 125 outputs finely:

opening movie : /home/tats/Documents/workspace/drone-0.3/GOPR1063-h264.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/tats/Documents/workspace/drone-0.3/GOPR1063-h264.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2012-12-04 06:01:59
    encoder         : HandBrake 0.9.8 2012071800
  Duration: 00:00:18.81, start: 0.000000, bitrate: 1508 kb/s
    Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 720x400 [PAR 80:81 DAR 16:9], 1122 kb/s, 29,86 fps, 29,97 tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 2012-12-04 06:01:59
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 160 kb/s
    Metadata:
      creation_time   : 2012-12-04 06:01:59
    Stream #0.2(eng): Audio: ac3, 48000 Hz, stereo, s16, 224 kb/s
    Metadata:
      creation_time   : 2012-12-04 06:01:59

Also weird is that it was working before with the exact same code! I tried to rerun the same example using the first version I was able to compile a few weeks back and it worked fine.

I tried the following withough success:

  • compiling in release mode (didn't work, actually, it made Drone crash)
  • re-running the whole recompilation/reinstallation of x264/libvpx/ffmpeg as described in the install section of the wiki
  • compiling different branches and tags
  • running valgrind (didn't show anything special)

Here's the relevant lines (125-139) in Gear_VideoSource.cpp:

  av_dump_format(_formatContext, 0, filename.c_str(), 0);

  _videoStreamIndex=-1;
  for (int i=0; i<_formatContext->nb_streams; i++)
    if (_formatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
    {
      _videoStreamIndex=i;
      break;
    }

  if (_videoStreamIndex<0)
  {
    std::cout << "no video stream!" << std::endl;
    return false;
  }
@sofian
Copy link
Owner Author

sofian commented Dec 28, 2012

I tried to run a simple example from an ffmpeg tutorial (see tutorial01.c). It has more or less the same code and it runs perfectly. I am starting to believe in more of a memory management error (especially since the "release" version seems to crash). It would help if someone else could reproduce the error under Linux.

@sofian
Copy link
Owner Author

sofian commented Dec 28, 2012

This is so weird: now I'm trying to run my old exec of drone (which was working about an hour ago and which I made a backup of) and it doesn't work anymore (same problem).

@jukea
Copy link
Collaborator

jukea commented Dec 28, 2012

hey,could it have to do with the fact that we're using ffmpeg 0.8 instead
of 0.7 (which was the version at the time ?)

On Thu, Dec 27, 2012 at 7:31 PM, sofian [email protected] wrote:

This is so weird: now I'm trying to run my old exec of drone (which was
working about an hour ago and which I made a backup of) and it doesn't work
anymore (same problem).


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-11722298.

julien keable, ingénieur projets web | espresso communication & design
| 514.286.9696

@sofian
Copy link
Owner Author

sofian commented Dec 28, 2012

Sorry, I understand this was confusing: when I talk about "my old exec of drone" I talk about the version I compiled a few weeks ago (see tag 2012-12-14--tats-linux-drone-revival). Anyway, it doesn't work anymore.

I tried again by including in the gears folder only StringSource, VideoSource and VideoOutput to reduce the chances of error due to mem allocation but I still got the same problem.

It might be because of conflicting versions of ffmpeg or related libraries. I noticed that a week ago apt-get update updated some av* libs, might be related to that. I still don't understand why the ffmpeg tutorial example works and not VideoSource, but it might be because they are not referring to the same library versions: the main difference between both is that the drone gear is compiled into a shared library whereas the tutorial example is compiled into an exec file: maybe the shared library and the static one for some av lib differ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants