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.

How does one convert a video file into a DM355 mpeg4 decoder format?

Other Parts Discussed in Thread: TMS320DM355, MSP430F412

How can I convert video files into a format that the DM355's Mpeg4 decoder can handle? I have seen two related references in the TI web collateral,

(1) The first was an in-depth discussion of how to do it using various open source tools, but I can not find the document again. It was somewhere on the TI website or Davinci/Linux mailing list, but the search tools will not find it.  Can someone point me to this URL or app note.

(2) The second was a reference in theTI wiki about a TI eval version of Arcsoft media converter that will convert audio video files into a format that is compatible with the DM355's restricted Mpeg4 decoder.

( http://wiki.davincidsp.com/index.php?title=DM3xx_Gstreamer_Solution)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

"DM355 can only playback movie clips encoded by DM355 MPEG4 encoder, or transcoded by certain tools.

MediaConverter from ArcSoft is able to convert most of movies to DM355 playable video format. The TI eval version of MediaConverter will converter the audio channel to u-law format. Then mencoder could be used to convert the audio channel to mp3 format."

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The TI DM355 is obviously not on the Arcsoft's drop-down list of supported devices. Can you clarify what version of MediaConverter is being referred to and where it can be obtained?

Thanks ... gary

 

  • I am trying to get some more information internally, but since this is an ArcSoft tool, I would recommend you also try to contact them and see what they say about DM355 support.

  • ok, so I got confirmation from a person that has used this before.  He claims to be using trial version 2.5 of the MediaConverter tool.

  • It may be a little deep, but since I am not that familiar with the Arcsoft tool I can at least suggest what settings you would need to have in the MPEG4 to have it be decodable by the DM355. If you look in your DVSDK install in something like dvsdk_1_30_00_40\dm355_codecs_1_12_000\packages\ti\sdo\codecs\mpeg4dec\dm355\docs you should find release notes for the MPEG4 decoder. These release notes list the limitations of the MPEG4 decoder, and should give you an idea what you need to transcode the stream into to have it playable by the DM355. For example it does not support video packet resynchronization, data partitioning, reversible VLCs, or header extention code. You would need to set up the encoder to not utilize these sorts of MPEG4 features to make the stream compatible with the DM355 decoder (I am assuming the Arcsoft tool has these sorts of settings). There are additional limitations on the size of the stream and such that are also listed in that document, these are not planned to be changed for future codec software releases.

     

  • Additional information along the lines of what Bernie described can also be found in the link below

    http://wiki.davincidsp.com/index.php?title=DM355_Codecs

     

  • Thanks, I have an email question into Arcsoft.

     

    I remember seeing a much more detailed step-by-step instruction application note somewhere in the TI support collateral  that called out specific open source tools to do this as well. I remember looking at it, but I did not download or bookmark it. Has anyone seen this document?

    Is there a company or resource that you re aware of that could convert a supplied sample media clip (other than the supplied Davinci effect) for a proof-of-concept demo?

  • I seem to recall a wiki article (not DM355 specific), but other than that, no other collateral comes to mind.  Is the collateral you are referring to DM355 specific?  For DM355, the only tool to convert a video stream to a format compatible with DM355 MPEG4 decoder is the ArcSoft tool mentioned in your post.

  • If Arcsoft does not work one one clunky way of doing this would be to play the file on some player that can play it (PC or hand held player) and feed the output of that into the DM355 to have the DM355 encode it (the out of the box demo and a composite input could do this easily), though this would potentially mean a loss in quality in the coversion to analog composite video and back again.

    A similar potential method would be to have some PC based software decode all the frames into a raw uncompressed format and than feed that into the DM355 to encode, though I am not sure what PC software would do this and how much you would have to modify the demo code to make it work.

  • Yep, SOMEWHERE, I saw a DM355 specific "how-to" instructions on this. It was not on my "to-do" list at the time and I did not look at the details. I have tripped over it more than once, but can not find it this morning.

    I imgine that it might take Arcsoft some time to get back with me and then I will have to get past the end-consumer support level to find who has knowledge of the "TI-Eval" version. If you have a contact there that could circumvent all the questions, it would be appreciated. The process may surprise me, I will let you know.

    Good idea about using the video encoder, if  the quality loss is not extreme. I will give it a shot this afternoon.

     

     

  • Unfortunately, I do not have an ArcSoft contact; hopefully, you are successful implementing Bernie's idea.  If you run into problems, please feel free to post questions and we will do our best to assist you.

  • I would like to see the how to instructions myself, I would not be suprised if this was done somewhere before, but I have never seen them. You are not the first person to ask how to make a file playable by the DM355, and will probably not be the last so hopefully someone somewhere has these how to steps (if so it will probably make a good wiki.davinicdsp.com article).

  • I agree, if you ever do run into this collateral again, please post it here.  I have been working with this platform since it came out and do not recall such collateral, but would definitely be interested in seeing it.

  • I found what I was thinking about. Unfortunately it about creating elementary streams for the DM6446, not the DM355:

    http://wiki.davincidsp.com/index.php?title=Encoding_and_decoding_DVEVM_clips

     

  • I did recall this one, but as I suspected, it was not DM355 specific.  It appears that MediaConverter is the way to go (proven solution), unluess you want to encode the video stream using DM355 as Bernie suggested (probably easier).

  • I may have some good news; we might be able to provide you the proper MediaConverter tool directly so long as we collect some minor information (e.g. company name, contact info) as required per ArcSoft.  We are ironing out a simple process to do this, so please stay tuned...

  • To get the MediaConverter software directly from TI, please send your request via www.ti.com/support to the attention of Juan Gonzales; due to export control restrictions, we will need to double check your information before providing the software.

  • Encoding the stream using the DM355 encoder ws an obvious and easy way to do it for a prototype demo. It worked like a charm .... Thanks for the idea.

    -------

    Does the Arcsoft decoder create elementary streams? I assume that  a Framework such as Gstreamer is still needed to demux the AVI created by Arcsoft?

    - gary

  • I have never used the ArcSoft tool but based on the little information I can find on the web, it appears to produce MPEG4 AVI file; therefore, you will probably need a demux toll such as GStreamer.  Perhaps someone that has used this tool will jump in and comment.

  • Hi,

    I have got the mediaconverter 2.5 from arcsoft. But it encodes to formats like Mpeg4 AVI. And so none of these formats are decoded by the TMS320DM355. Is there any other way out of it?

  • My first thought on this is the same as Juan's, you may have to use some demuxing software like GStreamer to allow the DM355 to play the .avi file, there is a good article on using GStreamer with the DM355 at the wiki site here. Unfortunately I have not had a chance to use the Arcsoft software myself so I am not sure if there is an easier way (i.e. if the Arcsoft tool is capible of producing elementary streams that the DM355 demo could take directly).

  • I have no idea about Gstreamer.

    Can anyone help me getting started with it.

    Cheers

  • I am looking into getting the GStreamer software from the Wiki available to you.

    I also wanted to mention that there is another project going on to make a more generalized GStreamer port for our products that should be made available in the coming weeks, so you may want to migrate to that when it comes available.

  • I attached the GStreamer software mentioned in the Wiki article to this post, the link should be right above this, titled dm355-gst-ti-0.2.3.tar.bz2.

    Please keep in mind this software is given as is, there is no guarantee it will work or that it will not cause unexpected problems, use at your own risk.

    dm355-gst-ti-0.2.3.tar.bz2
  • Thanks for the software Bernie.

    But please tell me how to install it in the host machine....

  • Hey guys ... I am waiting for someone to test and give a green flag that it works..anyone?

  • The below link is to the Wiki site for GStreamer on the DM3xx devices.

    http://wiki.davincidsp.com/index.php?title=DM3xx_Gstreamer_Solution

    There are instructions on installation, building and running.

  • So guys just want to confirm....

    There is no way that we can play any format on the DM355 and the only way to encode any video file is to play it via a composite in or s-video in?

    But yeh GStreamer as discussed above can encode and decode mpeg4 avi files.

  • The DM355 out of the box does not handle any containerized formats (i.e. *.avi, *.mov, *.mp4, etc.), it can only handle a raw elementary stream similar to what is generated by its own encoder. Using the GStreamer software allows the use of containerized formats and gives more 'media player' like AV abilities to the DM355.

    Note that the DM355 can only play back certain MPEG4 streams, the stream must meet the requirements of the decode codec which is what the Arcsoft software does for you by transcoding into a MPEG4 stream that is compatible with the DM355 decode codec. However the Arcsoft software seems to output an AVI file that cannot be interpreted directly by the DM355 out of the box demo software, so you would need the GStreamer software to open up the container and allow the DM355 decode codec to play the MPEG4 stream.

    You can encode a video file easily by playing it in through the analog video input (i.e. composite), though theoretically you could have it encoding anything that you can provide to the DM355 in a uncompressed digital format (YCbCr 4:2:2) though that would require some more software work to get the uncompressed frames into the device and passed to the MPEG4 encode codec.

     

     

  • I do not believe Gstreamer can encode mpeg4 files, only decode.  Underneath, Gstreamer is stripping out the container file information and passing on elementary streams to the corresponding audio/video codecs for decoding.

  • GStreamer itself can handle containerizing, so it should be able to generate an avi file for you, though the current DM355 release/port discussed on the wiki only does decoding, this functionality may be added in a future GStreamer port.

  • Hi All,

    I think I'm one step to converting video to DM355 playable format:

    1. on host pc: mencoder <myfile>.avi -ovc raw -nosound -vf scale=640:480,format=UYVY -o <myfile>.yuv

    2. on dm355: venc <myfile>.yuv <myfile>.mpeg4 #venc is demo app from <dvsdk_1_30_00_40>/examples/dm355/venc

    3.1 on dm355: decode <myfile>.mpeg4

    or

    3.2 on host pc: mplayer <myfile>.mpeg4

    With 3.1 and 3.2 output is: video is OK (even at 720p),

    but the picture climbs off by horizontal axis.

    Note, UYVY is the pixel format I could get viewable output with.

    Hence, a couple of questions, maybe someone has some idea of:

    - Is video artefact I got because UYVY is the closest to 422ILE (YUV<->UYV<->little endian)?

    - I did not help finding 422ILE description on FOURCC, is it some TI internal pixel format? Any ref docs for it?

  • The arcsoft software converts the video file to .avi

    Is there any software within windows OS that can change that .avi to .mpeg4 which can be decoded by DM355?

  • Thank you for the information PhilippS, using the venc application like this with a yuv file should allow a user to encode a DM355 compatible MPEG4 stream without having to pipe the video in through a analog source.

    I am not sure what you mean by 'climbs off by horizontal axis'? If you mean it is shifted than perhaps it is the scaling option? The UYVY sounds about right, if there was byte swapping your image would look very wrong, probably very neon green looking if I remember correctly. As to the format you can call it Y'UV or YCbCr, the terminology can be confusing but typically in the digital domain you would call it YCbCr, the 4:2:2 shows the ratio of Y (luma) to Cb and CR (chroma), essentially this means that the image will have only one pair of chroma values to each luma value so you end up with data that looks like CbYCrYCbYCrYCbYCrY... where each pixel has a Y value and every other pixel has a Cb and Cr value. Internally most of the TI Davinci processors utilize this YCbCr 4:2:2 format at the hardware level.

    As to Saadia's question, though I am not sure if it is possible a utility like mencoder which PhilippS is using is what you would need, you may be able to split out a raw video stream from an avi with mencoder using the '-of rawvideo' option.

  • Please note that the DM355 has registers that allow swapping between the order of the Cb and Cr data, or even swap Y and C (outputs Cb and CR) data buses; this should give you the flexibility you need to correct compatibility issues with other components.  Please see VPBE UG for more details

    http://focus.ti.com/lit/ug/spruf72c/spruf72c.pdf

  • AVI is a container format which should not be too difficult to strip out; FFMPEG and MENCODER are both worth taking a look at.

  • Bernie Thompson said:

    I am not sure what you mean by 'climbs off by horizontal axis'? If you mean it is shifted than perhaps it is the scaling option?

    When the video starts, I see a sort of slideshow, each slide displaying video, slites slowly moving from left to right.

    Raw video is OK, at least it can be played back with mplayer. So I think it could be some issue with parameters passing to VIDENC so it misses up with video frame size or start of video frame or both.

    Any ideas?

     

     

  • Juan Gonzales said:
    Please note that the DM355 has registers that allow swapping between the order of the Cb and Cr data, or even swap Y and C (outputs Cb and CR) data buses; this should give you the flexibility you need to correct compatibility issues with other components.  Please see VPBE UG for more details

    Note that the YCSWAP is for seperate physical busses in YCC16 mode, not for the standard BT.656 output stream in which case it just routes the whole stream to YOUT or COUT, also that although you can adjust the Cb and CR ordering with YCP, to maintain compatibility with the existing hardware/software it would be advisable to leave this alone and use the default format.

  • Juan Gonzales said:

    AVI is a container format which should not be too difficult to strip out; FFMPEG and MENCODER are both worth taking a look at.

    FFMPEG does not have 420p->YUYV converter.

  • Bernie Thompson said:

    I am not sure what you mean by 'climbs off by horizontal axis'? If you mean it is shifted than perhaps it is the scaling option?

    Scaling seems to be OK, at least I am able to play raw video on host PC with mplayer and it reports exactly the frame size/rate I

    specified with mencoder.

    I think it could be some issue with VIDENC so it misses up with video frame size or start of video frame or both.

    Any ideas?

  • So you are seeing a slide show, the moving images shifting from left to right, I assume the colors and all at least look correct? If this is the case than it may be an issue with the formatting of the raw output file from mencoder, or at least that the output is not 100% compatible with the DM355 software. Shifting horizontally sounds like your width may not be exactly what the DM355 is expecting, if your YUV file had frames that were slightly wider than the DM355 expected than you would see the images shifting to the right (each line being slightly longer than expected means each line is pushed to the right slightly as the end of the prior line is pushed to the beginning of the next line). At least this sounds like a possible explanation, my understanding of the YUV file that mencoder is making is that it is just a continuous list of pixel values, so the only thing that should go wrong would be a size mismatch.

  • Bernie,

    I did not see any references to BT.656 on this thread, and since 720p was mentioned, I thought it was safe to assume YCC16.  In this case the swaping is totally valid.

  • This is true, if using custom hardware and the less common 270MHz DM355 than the YCC16 would make sense, though most customers are not using this capability, my comment is more for your average user who is considering the usage of the YCSWAP bit, I just wanted to be clear on the functionality for the rest of the audience.

  • PhilippS,

    PhilippS said:

    FFMPEG does not have 420p->YUYV converter.

    Thank you for sharing this.  I am sure others will find this helpful and not go down the wrong path.

  • PhilippS said:

    When the video starts, I see a sort of slideshow, each slide displaying video, slites slowly moving from left to right.

    This sounds like a mismatch between the frame size in memory and the frame size defined by the video timing registers.

  • Can anyone help me and explain me how to extract elementry mpeg4 streams from avi files using mencoder or ffmpeg?

  • PhilippS said:

    Hi All,

    I think I'm one step to converting video to DM355 playable format:

    1. on host pc: mencoder <myfile>.avi -ovc raw -nosound -vf scale=640:480,format=UYVY -o <myfile>.yuv

    2. on dm355: venc <myfile>.yuv <myfile>.mpeg4 #venc is demo app from <dvsdk_1_30_00_40>/examples/dm355/venc

    3.1 on dm355: decode <myfile>.mpeg4

    or

    3.2 on host pc: mplayer <myfile>.mpeg4

    With 3.1 and 3.2 output is: video is OK (even at 720p),

    but the picture climbs off by horizontal axis.

    Note, UYVY is the pixel format I could get viewable output with.

    Hence, a couple of questions, maybe someone has some idea of:

    - Is video artefact I got because UYVY is the closest to 422ILE (YUV<->UYV<->little endian)?

    - I did not help finding 422ILE description on FOURCC, is it some TI internal pixel format? Any ref docs for it?

    Hi,

    When I used mencoder on avi file similar to what ur doing above. I got another .avi file but it is huge size.

    Now i dont know whether is this the output I should expect? Also "venc" as you mentioned above, I cant find it in the eval board? what directory is it in? And is it an encoder for .yuv? I am a bit confised.

  • saadia said:
    When I used mencoder on avi file similar to what ur doing above. I got another .avi file but it is huge size.

    This should be file containing raw video.

    saadia said:
    Also "venc" as you mentioned above, I cant find it in the eval board? what directory is it in?

    It is in dvsdk_1_30_00_40/examples/dm355/venc folder. AFAIK, it is not installed by default - you have to copy it to rootfs manually.

    saadia said:
    And is it an encoder for .yuv?

    It is a simple demo app that reads raw video file and encodes it with dm355 encoder into TI-specific mpeg4 format.

  • I think I am gone mad...cant find venc anywhere....are you sure its in the file system in the evm boad?

  • saadia said:

    I think I am gone mad...cant find venc anywhere....are you sure its in the file system in the evm boad?

    It is not in the file system on the EVM board by default, it is in your DVSDK install. This being said to use it you would want to set up your board to NFS mount as discussed in the GSG and then copy dvsdk_1_30_00_40\examples\dm355\venc (or at least the binary) somewhere into the directory your board is NFS mounting, something like workdir\filesys\opt.

  • Saadia,

    I am not too familiar with either FFMPEG or MENCODER, but the following wiki article might help. 

    http://wiki.davincidsp.com/index.php?title=Encoding_and_decoding_DVEVM_clips

    It was written from a DM6446 point of view, but given that you already have the AVI file containing the MPEG4 elementary stream for DM355, it should work.

  • So, Have a definitive way to convert any video format to playable TI DM355 format? And about the TI tools that Bernie said? When will be available?

    Are anybody converting any video to playable TI DM355 format using any way?

    I got the eval version of MediaConverter through support@ti.com but the output file isn't playable in my DM355 board.

    Thanks.