سؤال

I have created a server system based on Xuggle to encode an incoming file to H264 and segment it. However, when playing the video back in Quicktime it almost works (with a small hiccup in the audio sometimes) but when changing fro one quality stream to another the image gets lost.

So I ran the 'mediastreamvalidator'and got the following error:

ERROR: (-1) Unknown video codec: 1836069494 (program 0, track 0) ERROR: (-1) failed to parse segment as either an MPEG-2 TS or an ES

So I used FFMPEG to get some info on the codex: The result of my Xuggler encoding:

Input #0, mpegts, from 'segment_0.ts':
  Duration: 00:00:09.40, start: 0.000000, bitrate: 3618 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0.0[0x100]: Video: mpeg2video (Main), yuv420p, 960x540 [PAR 1:1 DAR 16:9], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x101]: Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s

The result of a file created by Compressor:

Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 25.00 (25/1)
Input #0, mpegts, from 'fileSequence1.ts':
  Duration: 00:00:09.97, start: 19.984578, bitrate: 5308 kb/s
  Program 1 
    Stream #0.0[0x101]: Video: h264 (Main), yuv420p, 960x540, 25 tbr, 90k tbn, 180k tbc
    Stream #0.1[0x102]: Audio: aac, 22050 Hz, stereo, s16, 32 kb/s

The main difference seems to me that for the Xuggler encoded file it says Video: mpeg2video instead of h264. However, while encoding I did specifically set the Coder to ICodec.ID.CODEC_ID_H264.

How can I force it to use h264. The same with audio. I specified AAC and get MP2.

I subsequent used FFMPEG directly and that results in:

Input #0, mpegts, from 'encoded.ts':
  Duration: 00:00:24.16, start: 1.400000, bitrate: 360 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0.0[0x100]: Video: h264 (Main), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x101](eng): Audio: aac, 48000 Hz, stereo, s16, 57 kb/s

That looks better. I could use FFMPEG directly, but by using Xuggler I can segment the file while easier keep track of progress of the process.

هل كانت مفيدة؟

المحلول

I moved away form Xuggle for the moment and use FFMPEG for the encoding and the segmenting and only use it to get encoding info etc. Currently two processes needed (first encode, then segment with FFMPEG), but hopefully soon FFMPEG will allow to segment on the fly while encoding

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top