Data-flow diagram of the deadlock: avidemux feeds a video queue into jpegdec and x264enc, and an audio queue into the AAC encoder; both meet in mp4mux. The audio queue is marked full at its 1-second default, the muxer waits for the first video buffer, and x264enc is still holding about 50 frames of lookahead.
Video

gst-launch transcoding an AVI to MP4 hangs forever with a 0-byte file — x264’s lookahead fills the default audio queue

avidemux → x264enc + aac → mp4mux stalls silently: the 1 s default audio queue fills before x264 emits a frame. Unbounded queues fix it in 3 s.