This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM355 MPEG4 output stream is not compatible with ffmpeg

I am having trouble reading an MPEG4 output stream with ffmpeg. I am using dvsdk_2_00_00_22 and the venc example. The output stream it produces is not readable by ffmpeg.

 

This is what ffprobe says about the output file:

C:\_dump>ffprobe -show_streams out.m4v
FFprobe version SVN-r25862, Copyright (c) 2007-2010 the FFmpeg developers
  built on Dec  3 2010 04:07:09 with gcc 4.4.2
  configuration: --enable-gpl --enable-version3 --enable-libgsm --enable-pthread
s --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --
enable-libopenjpeg --enable-libschroedinger --enable-libopencore_amrwb --enable-
libopencore_amrnb --enable-libvpx --disable-decoder=libvpx --arch=x86 --enable-r
untime-cpudetect --enable-libxvid --enable-libx264 --extra-libs='-lx264 -lpthrea
d' --enable-librtmp --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm' --target-o
s=mingw32 --enable-avisynth --cross-prefix=i686-mingw32- --cc='ccache i686-mingw
32-gcc' --enable-memalign-hack
  libavutil     50.33. 0 / 50.33. 0
  libavcore      0.14. 0 /  0.14. 0
  libavcodec    52.97. 2 / 52.97. 2
  libavformat   52.87. 1 / 52.87. 1
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.67. 0 /  1.67. 0
  libswscale     0.12. 0 /  0.12. 0
[m4v @ 01c38070] Estimating duration from bitrate, this may be inaccurate
Input #0, m4v, from 'out.m4v':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: mpeg4, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 21k tbr, 12
00k tbn, 21k tbc
[STREAM]
index=0
codec_name=mpeg4
codec_long_name=MPEG-4 part 2
codec_type=video
codec_time_base=1/21000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1280
height=720
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
r_frame_rate=21000/1
avg_frame_rate=0/0
time_base=1/1200000
start_time=N/A
duration=N/A
[/STREAM]

 

When I try

ffmpeg -i out.m4v img%03d.bmp

I get the following messages

C:\_dump>ffmpeg -i out.m4v img%03d.bmp
FFmpeg version SVN-r25862, Copyright (c) 2000-2010 the FFmpeg developers
  built on Dec  3 2010 04:07:09 with gcc 4.4.2
  configuration: --enable-gpl --enable-version3 --enable-libgsm --enable-pthread
s --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --
enable-libopenjpeg --enable-libschroedinger --enable-libopencore_amrwb --enable-
libopencore_amrnb --enable-libvpx --disable-decoder=libvpx --arch=x86 --enable-r
untime-cpudetect --enable-libxvid --enable-libx264 --extra-libs='-lx264 -lpthrea
d' --enable-librtmp --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm' --target-o
s=mingw32 --enable-avisynth --cross-prefix=i686-mingw32- --cc='ccache i686-mingw
32-gcc' --enable-memalign-hack
  libavutil     50.33. 0 / 50.33. 0
  libavcore      0.14. 0 /  0.14. 0
  libavcodec    52.97. 2 / 52.97. 2
  libavformat   52.87. 1 / 52.87. 1
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.67. 0 /  1.67. 0
  libswscale     0.12. 0 /  0.12. 0
[m4v @ 01b6d130] Estimating duration from bitrate, this may be inaccurate
Input #0, m4v, from 'out.m4v':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: mpeg4, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 21k tbr, 12
00k tbn, 21k tbc
[swscaler @ 01ca83d0] No accelerated colorspace conversion found from yuv420p to
 bgr24.
[buffer @ 01c62f90] w:1280 h:720 pixfmt:yuv420p
[ffsink @ 01c86e70] auto-inserting filter 'auto-inserted scaler 0' between the f
ilter 'src' and the filter 'out'
[scale @ 01c764f0] w:1280 h:720 fmt:yuv420p -> w:1280 h:720 fmt:bgr24 flags:0x4
[swscaler @ 01caf5f0] No accelerated colorspace conversion found from yuv420p to
 bgr24.
Output #0, image2, to 'img%03d.bmp':
  Metadata:
    encoder         : Lavf52.87.1
    Stream #0.0: Video: bmp, bgr24, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/
s, 90k tbn, 21k tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=    3 fps=  0 q=0.0 Lsize=      -0kB time=0.01 bitrate= -17.6kbits/s dup=0
 drop=5
video:8100kB audio:0kB global headers:0kB muxing overhead -100.000265%

 

ffmpeg outputs three frames, but when venc ran it encoded 8 frames. I have my system setup so I have captured hundreds of MB of data. VLC will play it back, but I need to split the MPEG 4 steam into indivdual files. We also would like to edit the videos with a non-linear video editing suite, but nothing can import these files. It appears to me that the DM355 does not generate true MPEG 4 compliant video streams. Has anyone else had any luck with the MPEG4 encoder on the DM355?

 

I'm going to try and attach a small clip that I took.5481.outsmall.m4v

 

Thanks.

  • Hi Nick,

    I had a look at your attachment and it has 50 frames intact, with the 51st being truncated mid-way. ffmpeg could dump all 51 frames as yuv as well as bmp but the 51st frame has a glitch -- looks like ffmpeg's error concealment at work. This could perhaps be because the application is not flushing out the buffer before terminating. It can be checked by correlating the bytesGenerated field from outArgs with the actual output.

    Can you attach the 8 frame file that you mentioned?

    As far as MPEG-4 compliance is concerned, I don't think it should be a problem. 

     

    Regards,

    Akshay

  •  

    outsmall.m4v was truncated from a 250 MB file. I didn't want to upload that large a file, so I just split the first 1 MB from the beginning of the file. When I run ffmpeg on the file I get the following error:

     

    C:\_dump>ffmpeg -i outsmall.m4v images\img%03d.jpg
    FFmpeg version SVN-r25862, Copyright (c) 2000-2010 the FFmpeg developers
      built on Dec  3 2010 04:07:09 with gcc 4.4.2
      configuration: --enable-gpl --enable-version3 --enable-libgsm --enable-pthread
    s --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --
    enable-libopenjpeg --enable-libschroedinger --enable-libopencore_amrwb --enable-
    libopencore_amrnb --enable-libvpx --disable-decoder=libvpx --arch=x86 --enable-r
    untime-cpudetect --enable-libxvid --enable-libx264 --extra-libs='-lx264 -lpthrea
    d' --enable-librtmp --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm' --target-o
    s=mingw32 --enable-avisynth --cross-prefix=i686-mingw32- --cc='ccache i686-mingw
    32-gcc' --enable-memalign-hack
      libavutil     50.33. 0 / 50.33. 0
      libavcore      0.14. 0 /  0.14. 0
      libavcodec    52.97. 2 / 52.97. 2
      libavformat   52.87. 1 / 52.87. 1
      libavdevice   52. 2. 2 / 52. 2. 2
      libavfilter    1.67. 0 /  1.67. 0
      libswscale     0.12. 0 /  0.12. 0
    [m4v @ 01b6d130] Estimating duration from bitrate, this may be inaccurate
    Input #0, m4v, from 'outsmall.m4v':
      Duration: N/A, bitrate: N/A
        Stream #0.0: Video: mpeg4, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 24k tbr, 12
    00k tbn, 24k tbc
    [buffer @ 01b6ffa0] w:1280 h:720 pixfmt:yuv420p
    [ffsink @ 01c55590] auto-inserting filter 'auto-inserted scaler 0' between the f
    ilter 'src' and the filter 'out'
    [scale @ 01d76c50] w:1280 h:720 fmt:yuv420p -> w:1280 h:720 fmt:yuvj420p flags:0
    x4
    Output #0, image2, to 'images\img%03d.jpg':
      Metadata:
        encoder         : Lavf52.87.1
        Stream #0.0: Video: mjpeg, yuvj420p, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 20
    0 kb/s, 90k tbn, 24k tbc
    Stream mapping:
      Stream #0.0 -> #0.0
    Press [q] to stop encoding
    frame=    2 fps=  0 q=3.8 size=      -0kB time=0.01 bitrate= -17.6kbits/s dup=0
    [mpeg4 @ 01b6fa10] ac-tex damaged at 22 16
    [mpeg4 @ 01b6fa10] Error at MB: 1318
    [mpeg4 @ 01b6fa10] concealing 2356 DC, 2356 AC, 2356 MV errors
    frame=    3 fps=  0 q=6.1 Lsize=      -0kB time=0.01 bitrate= -17.6kbits/s dup=0
     drop=48
    video:67kB audio:0kB global headers:0kB muxing overhead -100.032062%dio:0kB global headers:0kB muxing overhead -100.000265%

     

    ffmpeg outputs the following three files.

     

     

    Second image

     

    Third image

  • Can I ask how you analyzed the file?

  • Hi,

     

    So with the same stream that you attached previously, you are getting only 3 frames?

    Surprising. I am getting all 51 frames. And the all-black frames are the 1st 5 frames.

     

  • the IPNC has a avi_save program, it seems to use the ffmpeg to save as a AVI file. but i don't know how it work:(

  • Yes, IPNC has avi_save, you can use it to save the Mpeg4 or h264 encoded bitstream as avi file.

     

    Regards,

     

    Raghu

     

  • Here is what I found works.

     

    mencoder -ovc copy -of lavf -o output.mp4 input.ts

     

    That wraps the MPEG4 Transport Stream in an ISO container. After that I can manipulate the data with ffmpeg.

     

    Thanks everyone for your help.