Opened 8 years ago

Closed 6 years ago

#460 closed defect (fixed)

AttributeError: VideoTranscoder instance has no attribute 'dst_data'

Reported by: Jorge Araya Navarro Owned by:
Priority: major Milestone: 0.8.0
Component: programming Keywords: video, transcoder, VideoTranscoder, AttributeError
Cc: jorgean@… Parent Tickets:

Description

this error happened with two different videos in two different formats (avi and webm)

[2012-06-22 22:22:36,020: INFO/MainProcess] Got task from broker: mediagoblin.processing.task.ProcessMedia[7e73cf15-8594-41c7-93f4-163bcbb662e0]
[2012-06-22 22:23:07,291: INFO/PoolWorker-2] Initializing VideoTranscoder...
[2012-06-22 22:23:29,388: INFO/PoolWorker-2] Discovering...
[2012-06-22 22:23:31,666: INFO/PoolWorker-2] Done
[2012-06-22 22:23:33,999: WARNING/PoolWorker-2] Traceback (most recent call last):
[2012-06-22 22:23:34,229: WARNING/PoolWorker-2] File "/srv/http/mediagoblin/mediagoblin/mediagoblin/media_types/video/transcoders.py", line 441, in __discovered
[2012-06-22 22:23:34,704: WARNING/PoolWorker-2] raise Exception('Could not discover {0}'.format(self.source_path))
[2012-06-22 22:23:34,787: WARNING/PoolWorker-2] Exception
[2012-06-22 22:23:34,804: WARNING/PoolWorker-2] :
[2012-06-22 22:23:34,804: WARNING/PoolWorker-2] Could not discover /srv/http/mediagoblin/mediagoblin/user_dev/media/queue/media_entries/7e73cf15-8594-41c7-93f4-163bcbb662e0/Gurren_Lagann_HD_Creditless_Opening_1.webm
[2012-06-22 22:23:34,880: INFO/PoolWorker-2] Terminating MainLoop
[2012-06-22 22:23:34,880: DEBUG/PoolWorker-2] Saving medium...
[2012-06-22 22:23:35,316: DEBUG/PoolWorker-2] Saved medium
[2012-06-22 22:23:51,120: WARNING/PoolWorker-2] No idea what happened here, but it failed: AttributeError("VideoTranscoder instance has no attribute 'dst_data'",)
[2012-06-22 22:23:55,970: ERROR/MainProcess] Task mediagoblin.processing.task.ProcessMedia[7e73cf15-8594-41c7-93f4-163bcbb662e0] raised exception: AttributeError("VideoTranscoder instance has no attribute 'dst_data'",)
Traceback (most recent call last):
  File "/srv/http/mediagoblin/mediagoblin/lib/python2.7/site-packages/celery-2.5.3-py2.7.egg/celery/execute/trace.py", line 181, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/srv/http/mediagoblin/mediagoblin/mediagoblin/processing/task.py", line 52, in run
    manager['processor'](entry)
  File "/srv/http/mediagoblin/mediagoblin/mediagoblin/media_types/video/processing.py", line 88, in process_video
    width=transcoder.dst_data.videowidth,
AttributeError: VideoTranscoder instance has no attribute 'dst_data'

Subtickets

Attachments (2)

issue_460.patch (2.9 KB) - added by Boris Bobrov 6 years ago.
issue_460_2.patch (3.8 KB) - added by Boris Bobrov 6 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 8 years ago by Christopher Allan Webber

I'm not sure what's going on yet in shackra's environment, but shackra tells me this happened after he reinstalled the entire machine, so I'm guessing it's a case of a missing dependency.

comment:2 Changed 8 years ago by pythonsnake

It seems that your videos' resolutions cannot be detected by gstreamer. I had this issue as well and fixed it by remux'ing all the videos uploaded with ffmpeg (all to mkv for simplicity). That's how I did it (process_video in mediagoblin/mediagoblin/media_types/video/processing.py):

from subprocess import call
from shutil import move
#...
    with tmp_dst:
        # Transcode queued file to a VP8/vorbis file that fits in a 640x640 square
        progress_callback = ProgressCallback(entry)
        transcoder = transcoders.VideoTranscoder()
        # Added that
        temp_vid = '/tmp/{0}.mkv'.format(queued_filepath[1])
        remux_cmd = 'ffmpeg -i {0} -vcodec copy -acodec copy -scodec copy -y {1}'.format(queued_filename, temp_vid)
        call(remux_cmd.split(" "))
        move(temp_vid, queued_filename)
Last edited 8 years ago by pythonsnake (previous) (diff)

comment:3 Changed 8 years ago by pythonsnake

Owner: changed from Jorge Araya Navarro to pythonsnake
Status: newassigned

comment:4 Changed 8 years ago by pythonsnake

It doesn't look like this has been worked on for some time, so I'm claiming it

comment:5 Changed 7 years ago by pythonsnake

Update: Wheezy became Stable, so problem is probably solved. I'll do some tests to make sure.

comment:6 Changed 7 years ago by Christopher Allan Webber

Status: assignedin_progress

Hi! I'm moving this ticket from "assigned" to in_progress per our new workflow. Please update the ticket and let us know if you're still working on this. If you are, super great! If not, we'll remove the claim and move it back to "accepted" in a couple of weeks.

Thanks!

comment:7 Changed 7 years ago by pythonsnake

Nope, it's still there, but today I got a kind of different error message:

File '/home/pythonsnake/mediagoblin/mediagoblin/media_types/video/processing.py', line 94 in process_video
  store_metadata(entry, metadata)
File '/home/pythonsnake/mediagoblin/mediagoblin/media_types/video/processing.py', line 173 in store_metadata
  if key in metadata])
TypeError: argument of type 'NoneType' is not iterable

comment:8 Changed 6 years ago by ayleph

Bump. Just came across this on my instance.

$ bin/gmg reprocess run 2271 initial
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
DEBUG:mediagoblin.processing.task:Processing <MediaEntry 2271: Michelle Jenneke>
ERROR:mediagoblin.media_types.video.transcoders:(<gst.Bus object (bus7) at 0x7f9bdb7346e0>, <gst.Message GstMessageError, gerror=(GError)NULL, debug=(string)"gstfaad.c\(807\):\ gst_faad_handle_frame\ \(\):\ /GstPipeline:VideoTranscoderPipeline/GstDecodeBin2:decoder/GstFaad:faad2:\012decoding\ error:\ Bitstream\ value\ not\ allowed\ by\ specification"; from faad2 at 0x25d2dc0>)
ERROR:mediagoblin.processing.task:An unhandled exception was raised while processing <MediaEntry 2271: Michelle Jenneke>
WARNING:mediagoblin.processing:No idea what happened here, but it failed: AttributeError("'VideoTranscoder' object has no attribute 'dst_data'",)
WARNING:mediagoblin.processing:No idea what happened here, but it failed: AttributeError("'VideoTranscoder' object has no attribute 'dst_data'",)
Traceback (most recent call last):
  File "bin/gmg", line 9, in <module>
    load_entry_point('mediagoblin==0.7.2.dev', 'console_scripts', 'gmg')()
  File "/path/to/mediagoblin/mediagoblin/gmg_commands/__init__.py", line 156, in main_cli
    args.func(args)
  File "/path/to/mediagoblin/mediagoblin/gmg_commands/reprocess.py", line 293, in reprocess
    run(args)
  File "/path/to/mediagoblin/mediagoblin/gmg_commands/reprocess.py", line 205, in run
    reprocess_info=reprocess_request)
  File "/path/to/mediagoblin/mediagoblin/submit/lib.py", line 257, in run_process_media
    task_id=entry.queued_task_id)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.16-py2.7.egg/celery/app/task.py", line 547, in apply_async
    link=link, link_error=link_error, **options)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.16-py2.7.egg/celery/app/task.py", line 739, in apply
    request=request, propagate=throw)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.16-py2.7.egg/celery/app/trace.py", line 354, in eager_trace_task
    uuid, args, kwargs, request)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.16-py2.7.egg/celery/app/trace.py", line 253, in trace_task
    I, R, state, retval = on_error(task_request, exc, uuid)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.16-py2.7.egg/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/path/to/mediagoblin/mediagoblin/processing/task.py", line 98, in run
    processor.process(**reprocess_info)
  File "/path/to/mediagoblin/mediagoblin/media_types/video/processing.py", line 350, in process
    vp8_threads=vp8_threads, vorbis_quality=vorbis_quality)
  File "/path/to/mediagoblin/mediagoblin/media_types/video/processing.py", line 240, in transcode
    dst_dimensions = self.transcoder.dst_data.videowidth,\
AttributeError: 'VideoTranscoder' object has no attribute 'dst_data'

comment:9 Changed 6 years ago by ayleph

Still happening with gst-1.0

(mediagoblin-0.8.0) ~/mediagoblin-0.8.0 $ bin/gmg reprocess run 3236 initial
/usr/lib/python2.7/site-packages/gi/module.py:178: Warning: g_array_append_vals: assertion 'array' failed
  g_type = info.get_g_type()
/usr/lib/python2.7/site-packages/gi/module.py:178: Warning: g_hash_table_lookup: assertion 'hash_table != NULL' failed
  g_type = info.get_g_type()
/usr/lib/python2.7/site-packages/gi/module.py:178: Warning: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
  g_type = info.get_g_type()
DEBUG:mediagoblin.processing.task:Processing <MediaEntry 3236: Pourquoi vivre ?>
ERROR:mediagoblin.media_types.video.transcoders:Got error: (GLib.Error('Could not decode stream.', 'gst-stream-error-quark', 7), 'gstfaad.c(831): gst_faad_handle_frame (): /GstPipeline:VideoTranscoderPipeline/GstDecodeBin:decoder/GstFaad:faad2:\ndecoding error: Maximum number of bitstream elements exceeded')
ERROR:mediagoblin.processing.task:An unhandled exception was raised while processing <MediaEntry 3236: Pourquoi vivre ?>
WARNING:mediagoblin.processing:No idea what happened here, but it failed: AttributeError("'VideoTranscoder' object has no attribute 'dst_data'",)
WARNING:mediagoblin.processing:No idea what happened here, but it failed: AttributeError("'VideoTranscoder' object has no attribute 'dst_data'",)
Traceback (most recent call last):
  File "bin/gmg", line 9, in <module>
    load_entry_point('mediagoblin==0.8.1.dev0', 'console_scripts', 'gmg')()
  File "/path/to/mediagoblin/mediagoblin/gmg_commands/__init__.py", line 142, in main_cli
    args.func(args)
  File "/path/to/mediagoblin/mediagoblin/gmg_commands/reprocess.py", line 293, in reprocess
    run(args)
  File "/path/to/mediagoblin/mediagoblin/gmg_commands/reprocess.py", line 205, in run
    reprocess_info=reprocess_request)
  File "/path/to/mediagoblin/mediagoblin/submit/lib.py", line 259, in run_process_media
    task_id=entry.queued_task_id)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.17-py2.7.egg/celery/app/task.py", line 547, in apply_async
    link=link, link_error=link_error, **options)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.17-py2.7.egg/celery/app/task.py", line 739, in apply
    request=request, propagate=throw)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.17-py2.7.egg/celery/app/trace.py", line 355, in eager_trace_task
    uuid, args, kwargs, request)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.17-py2.7.egg/celery/app/trace.py", line 253, in trace_task
    I, R, state, retval = on_error(task_request, exc, uuid)
  File "/path/to/mediagoblin/lib/python2.7/site-packages/celery-3.1.17-py2.7.egg/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/path/to/mediagoblin/mediagoblin/processing/task.py", line 101, in run
    processor.process(**reprocess_info)
  File "/path/to/mediagoblin/mediagoblin/media_types/video/processing.py", line 385, in process
    vp8_threads=vp8_threads, vorbis_quality=vorbis_quality)
  File "/path/to/mediagoblin/mediagoblin/media_types/video/processing.py", line 276, in transcode
    video_info = self.transcoder.dst_data.get_video_streams()[0]
AttributeError: 'VideoTranscoder' object has no attribute 'dst_data'

comment:10 Changed 6 years ago by Boris Bobrov

Milestone: 0.8.0
Owner: changed from pythonsnake to Boris Bobrov

Changed 6 years ago by Boris Bobrov

Attachment: issue_460.patch added

comment:11 Changed 6 years ago by Boris Bobrov

Owner: Boris Bobrov deleted
Status: in_progressreview

comment:12 Changed 6 years ago by ayleph

Status: reviewaccepted

Getting closer, but not quite. This now leads to errors at line 293 because dst_dimensions isn't assigned.

291             # Save the width and height of the transcoded video
292             self.entry.media_data_init(
293                 width=dst_dimensions[0],
294                 height=dst_dimensions[1])

I can push these all the way inside the if self.transcoder.dst_data: condition on line 276, but that might not be desired.

comment:13 Changed 6 years ago by Boris Bobrov

Owner: set to Boris Bobrov
Status: acceptedin_progress

Right. OK, will upload a new one a bit later.

Changed 6 years ago by Boris Bobrov

Attachment: issue_460_2.patch added

comment:14 Changed 6 years ago by Boris Bobrov

what about this one?

comment:15 Changed 6 years ago by Boris Bobrov

Owner: Boris Bobrov deleted
Status: in_progressreview

comment:16 Changed 6 years ago by ayleph

I applied this and tested with a video that previously failed due to missing dst_data. The file did finish processing and was stored to cloudfiles. I got the following error, but it didn't seem to cause any real problems.

ERROR:mediagoblin.media_types.video.transcoders:Got error: (GLib.Error('Could not decode stream.', 'gst-stream-error-quark', 7), 'gstfaad.c(831): gst_faad_handle_frame (): /GstPipeline:VideoTranscoderPipeline/GstDecodeBin:decoder/GstFaad:faad2:\ndecoding error: Maximum number of bitstream elements exceeded')

comment:17 Changed 6 years ago by ayleph

I ran through the rest of my failed uploads and everything looks good.

comment:18 Changed 6 years ago by Boris Bobrov

Resolution: fixed
Status: reviewclosed

fixed by bd50f8bf701d3719b349523fa0822ed4958a9531

Note: See TracTickets for help on using tickets.