Log in

View Full Version : Cannot playback mpeg-2 encoded video


EEdcom
21st November 2015, 13:06
Hello all,

I have difficulties, when I am trying to playback mpeg-2 encoded video. I am able to see only first frame of encoded video. Video size is 5.2MB, so there sould be more than one frame. Am I using wrong video encoder parameters (wrong .PAR file)? Or maybe something is wrong with uncompressed .YUV data stream? I am purposely using original (almost 20 years old) MPEG2 encoder, because I am diving into MPEG-2 Part2 standard.

Resulting output video and statics file can be found here:
https://www.dropbox.com/sh/vvxuxfzbrz7pkmp/AABR43WIL4XStRnz1vFLlMGia?dl=0

The produced video should follow the PAL system standard and be displayed on computer screen.

My display specification is following:

xrandr
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 8192 x 8192
VGA-0 disconnected (normal left inverted right x axis y axis)
LVDS connected primary 1680x1050+0+0 (normal left inverted right x axis y axis) 365mm x 228mm
1680x1050 58.79*+
1400x1050 59.98
1280x1024 59.89
...
S-video disconnected (normal left inverted right x axis y axis)
DVI-0 disconnected (normal left inverted right x axis y axis)


Here is the setup which I used in the experimets:

Source video: uncompressed .YUV file, including in total 200 "Big Buck Bunny" .png images.
Link: http://media.xiph.org/BBB/BBB-360-png/

Following command was used in converting:

png2yuv -j big_buck_bunny_%05d.png -f 24 -I p -b 13000 -n 200 > result.yuv


Used encoder: Original MPEG-2 Encoder / Decoder, Version 1.2, July 19, 1996, MPEG Software Simulation Group,
Link: http://rpm.pbone.net/index.php3/stat/4/idpl/19491459/dir/pld/com/mpeg2vidcodec-1.2-5.i386.rpm.html

Used (.PAR) parameter file:

MPEG-2 Test Sequence, 24 frames/sec
result /* name of source files */
- /* name of reconstructed images ("-": don't store) */
- /* name of intra quant matrix file ("-": default matrix) */
- /* name of non intra quant matrix file ("-": default matrix) */
stat.out /* name of statistics file ("-": stdout ) */
1 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */
200 /* number of frames */
0 /* number of first frame */
00:00:00:00 /* timecode of first frame */
12 /* N (# of frames in GOP) */
3 /* M (I/P frame distance) */
0 /* ISO/IEC 11172-2 stream */
0 /* 0:frame pictures, 1:field pictures */
640 /* horizontal_size */
360 /* vertical_size */
1 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */
2 /* frame_rate_code 1=23.976, 2=24, 3=25, 4=29.97, 5=30 frames/sec. */
5000000.0 /* bit_rate (bits/s) */
112 /* vbv_buffer_size (in multiples of 16 kbit) */
0 /* low_delay */
0 /* constrained_parameters_flag */
4 /* Profile ID: Simple = 5, Main = 4, SNR = 3, Spatial = 2, High = 1 */
8 /* Level ID: Low = 10, Main = 8, High 1440 = 6, High = 4 */
0 /* progressive_sequence */
1 /* chroma_format: 1=4:2:0, 2=4:2:2, 3=4:4:4 */
1 /* video_format: 0=comp., 1=PAL, 2=NTSC, 3=SECAM, 4=MAC, 5=unspec. */
5 /* color_primaries */
5 /* transfer_characteristics */
5 /* matrix_coefficients */
704 /* display_horizontal_size */
576 /* display_vertical_size */
0 /* intra_dc_precision (0: 8 bit, 1: 9 bit, 2: 10 bit, 3: 11 bit */
1 /* top_field_first */
0 0 0 /* frame_pred_frame_dct (I P B) */
0 0 0 /* concealment_motion_vectors (I P B) */
1 1 1 /* q_scale_type (I P B) */
1 0 0 /* intra_vlc_format (I P B)*/
0 0 0 /* alternate_scan (I P B) */
0 /* repeat_first_field */
0 /* progressive_frame */
0 /* P distance between complete intra slice refresh */
0 /* rate control: r (reaction parameter) */
0 /* rate control: avg_act (initial average activity) */
0 /* rate control: Xi (initial I frame global complexity measure) */
0 /* rate control: Xp (initial P frame global complexity measure) */
0 /* rate control: Xb (initial B frame global complexity measure) */
0 /* rate control: d0i (initial I frame virtual buffer fullness) */
0 /* rate control: d0p (initial P frame virtual buffer fullness) */
0 /* rate control: d0b (initial B frame virtual buffer fullness) */
2 2 11 11 /* P: forw_hor_f_code forw_vert_f_code search_width/height */
1 1 3 3 /* B1: forw_hor_f_code forw_vert_f_code search_width/height */
1 1 7 7 /* B1: back_hor_f_code back_vert_f_code search_width/height */
1 1 7 7 /* B2: forw_hor_f_code forw_vert_f_code search_width/height */
1 1 3 3 /* B2: back_hor_f_code back_vert_f_code search_width/height */


mplayer console output is following:

mplayer out.m2v
MPlayer SVN-r37379 (C) 2000-2015 MPlayer Team
210 audio & 441 video codecs
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing out.m2v.
libavformat version 56.25.101 (internal)
MPEG-ES file format detected.
VIDEO: MPEG2 640x360 (aspect 1) 24.000 fps 5000.0 kbps (625.0 kbyte/s)
Load subtitles in ./
Failed to open VDPAU backend libvdpau_r300.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 56.26.100 (internal)
Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
==========================================================================
Audio: no sound
Starting playback...
The selected video_out device is incompatible with this codec.
Try appending the scale filter to your filter list,
e.g. -vf spp,scale instead of -vf spp.
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 640x360 => 640x360 Planar YV12
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 640x360 => 640x360 Planar YV12
V: 0.2 4/ 4 ??% ??% ??,?% 0 0
[VD_FFMPEG] DRI failure.
V: 8.3 200/200 7% 0% 0.0% 0 0
Exiting... (End of file)


Do anybody knows, what am I doing wrong?

hank315
22nd November 2015, 17:17
The result.yuv seems to be OK, plays well in VLC.
The encoded clip (out.m2v) has 200 frames only it is 200 times the same frame: the first frame from result.yuv.
I don't know enough about the used encoder to help you with that.

EEdcom
22nd November 2015, 19:03
The result.yuv seems to be OK, plays well in VLC.
The encoded clip (out.m2v) has 200 frames only it is 200 times the same frame: the first frame from result.yuv.
I don't know enough about the used encoder to help you with that.

Actually, the problem was with the raw .yuv data file. Old mpeg2-encoder didn't support RAW I420 coded video. I solved the problem by converting video stream into the separate .Y .U .V data files (200 in total).

I am interested to know, if somebody can suggest .yuv video format which is also supported by the old mpeg2-encoder..

pandy
23rd November 2015, 14:50
I am interested to know, if somebody can suggest .yuv video format which is also supported by the old mpeg2-encoder..

AFAIR - just copy (concatenate) binary Y+U+V - i use this encoder in 2003 or somewhere around 2003.
Planar should work...