CasparCG Conformer

#1
Hi all,

There is a new project in the source code repository: CasparCG Conformer, which can be used for transcoding video files from one format to another. Use the specification.xml file to specify format and FFmpeg flags. The transcoder will also re-interleave frame packages which will speedup the read operation in CasparCG Server.

You can see the difference in the graph below. The right yellow FFmpeg curve is a litte choppy. The left corresponding graph is much smoother which indicates better read performance. This can be useful when you must read a lot of HD material from disk.
Disk Performance.png
Disk Performance.png (169.11 KiB) Viewed 18695 times
By default the application will use the number of cores to determind the max number of simultaneous files to transcode. You can override this by changing the MaxThreadOffset in the config file. The machine can be quite busy when transcoding so be careful with this setting.
TaskManagerConformer.png
TaskManagerConformer.png (58.35 KiB) Viewed 18695 times
In the future I will add support for multiple outputs and possibility to run it as a service.

We'll package this up and provide a compiled version soon, but please try it out in the mean-time!
Former CasparCG Client Lead Developer
Feel free to contact me if you need any CasparCG related support, development or other consulting.

Re: CasparCG Conformer

#4
Pretty coool,

If "Conformer Tool" is meant to "conform" that a specific media file is going to be played by the server correctly
"by transcoding it to a specific encoding format" , I'd like to suggest parsing output file name , like omitting 'space character' or any other character considered as "escape" one by the server . Or may be replacing it with "_" .

e.g: Input file: "Clip 715.avi" Output file: "Clip_715.avi"
Mohamed Hefny
DVB Engineer
m.hefny@nilesat.com.eg

Re: CasparCG Conformer

#6
Hi,

I can't get it to work, output file is filesize 0 byte. Is a special version of ffmpeg? I used the latest I font online.

"Specification.xml" is like this:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<Targets>
    <Target extension=".mp4" command="-vcodec qtrle -acodec copy" />
</Targets>
here is the log from Conformer:

Code: Select all

ffmpeg version N-40126-ga4b58fd Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr 26 2012 03:33:03 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 47.100 / 51. 47.100
  libavcodec     54. 15.100 / 54. 15.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.100 /  2. 72.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Input/AMB.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf53.3.0
  Duration: 00:01:04.00, start: 0.000000, bitrate: 342 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 339 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
[buffer @ 0000000001e02e20] w:720 h:576 pixfmt:yuv420p tb:1/1000000 sar:64/45 sws_param:flags=2
[buffersink @ 0000000001e0ee10] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'
[scale @ 0000000001e0f000] w:720 h:576 fmt:yuv420p sar:64/45 -> w:720 h:576 fmt:rgb24 sar:64/45 flags:0x4
[mp4 @ 0000000001e02240] track 0: could not find tag, codec not currently supported in container
Output #0, mp4, to 'Output/AMB.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf54.3.100
    Stream #0:0(eng): Video: qtrle, rgb24, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> qtrle)
Could not write header for output file #0 (incorrect codec parameters ?)
What did I do wrong?

Re: CasparCG Conformer

#7
could not find tag, codec not currently supported in container Output #0, mp4
You cannot put a qtrle stream into a .mp4 container, try .mov instead.
CasparCG Integrator, Developer and Consultant
Former CasparCG Lead Developer
Feel free to contact me (ronag@live.com) if you need any CasparCG related support, development or other consulting.

Re: CasparCG Conformer

#8
OK, I try a .mov

I ask since I have problems with audio/video sync on some .mp4 (these are all 1280x720, fps 23.9760). mp4 in 25 fps works fine. Is there any way to convert/transcode a .mp4?

I run 1080p5000 with a screen consumer

Re: CasparCG Conformer

#10
Robert Nagy wrote:Something along the lines of:

Code: Select all

-vcodec copy -acodec copy -r 25
Works on .mov but it looks like it only copy the file... On .mp4 ffmpeg crashes.


Is there some what to get Caspar to play the video with audio/video in sync, any flags on the PLAY/LOAD command? Like the PLAY 1-1 DECKLINK DEVICE 1 FORMAT 720p5000 for Decklink?

Re: CasparCG Conformer

#11
Ken this is more of a ffmpeg problem, you can get better help at the ffmpeg user mailing list https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/.

You can try to use libav.org instead of ffmpeg, which maybe doesn't crash. If it's only one small file I can transcode it for you if you wish.

The current CasparCG release can only play 25 fps or 50 fps files. Though future versions will probably be able to play any framerate.
CasparCG Integrator, Developer and Consultant
Former CasparCG Lead Developer
Feel free to contact me (ronag@live.com) if you need any CasparCG related support, development or other consulting.

Re: CasparCG Conformer

#12
Robert Nagy wrote: You can try to use libav.org instead of ffmpeg, which maybe doesn't crash. If it's only one small file I can transcode it for you if you wish.
That ffmpeg version don't crash on mp4, but the video is still 23.9760 fps, and the convert takes only a second (on my Intel i7 laptop, Win7 x64), is it really that fast?

Code: Select all

<Targets>
    <Target extension=".mp4" command="-vcodec copy -acodec copy -r 25" />
</Targets>
Thanks for the offer on transcoding, but it's a few hundred music videos ;-)

Re: CasparCG Conformer

#17
Robert Nagy wrote:The following works for me

Code: Select all

-i vtest.mp4 -vcodec libx264 -r 25 -tune fastdecode -crf 5 -acodec copy vtest2.mp4
Thanks,

I got it working with "64-bit Builds (Shared)" from http://ffmpeg.zeranoe.com

But ffmpeg still crashes on some mp4 files, like on "CG1080i50.mp4" but "CG1080i50_A.mp4" works (the files from CasparCG install)

Code: Select all

<Targets>
    <Target extension=".mp4" command="-vcodec libx264 -r 25  -tune fastdecode -crf 5 -acodec copy" />
</Targets>
This is mush faster conversion

Code: Select all

<Targets>
    <Target extension=".mp4" command="-vcodec libx264 -r 25 -preset superfast -tune fastdecode -crf 5 -acodec copy" />
</Targets>
Do I loose mush quality in my video by doing this conversion?

Re: CasparCG Conformer

#18
Ken wrote:Do I loose mush quality in my video by doing this conversion?
Some. You can set -crf to an even lower value if it is a problem. I don't see why you need to set superfast, I assume you are doing this conversion offline?
CasparCG Integrator, Developer and Consultant
Former CasparCG Lead Developer
Feel free to contact me (ronag@live.com) if you need any CasparCG related support, development or other consulting.

Re: CasparCG Conformer

#19
Peter Karlsson wrote: We'll package this up and provide a compiled version soon, but please try it out in the mean-time!
Hi,s

It's there any update on the compiled version? It looks very interesting but I can't test it cause I don't have how to compile it.

Best regard

Re: CasparCG Conformer

#22
siconova: You would need SSD drives to use qtrle.

There are quite a few options for video playback, here are some, what is best depends on your needs and hardware.

Here is a few alternatives:
  • qtrle (lossless w/ alpha) - Horrible compression. This option is most tested and used by SVT.
  • huffyuv (lossless w/ alpha) - Better compression than qtrle.
  • libx264 (lossy w/o alpha) - Very good compression, use the -tune fastdecode parameter.
  • 2x libx264 (lossy w/ alpha) - Two h264 files, one for fill one for alpha.
  • vp6 (lossy w/ alpha) - Good compression. Unfortunately some encoders can't encode to a bitrate above 10Mbit/s.
CasparCG Integrator, Developer and Consultant
Former CasparCG Lead Developer
Feel free to contact me (ronag@live.com) if you need any CasparCG related support, development or other consulting.

Re: CasparCG Conformer

#23
Hi Robert,

I tested RLE, DNxHD, huffyuv, ffvhuff, mjpeg, lagarith and ffv1 codecs and the winer was QT animation (ffvhuff is really nice).. CasparCG server works like a charm and I´m amazed how low power requires from the hardware.. I´m playing lots of logos, stingers, flash templates and full hd videos at the same time on an intel 7i (8 cores), 6gb ram with a nvidia gtx 550 ti and I´m only using 25% of processor.

Thanks a lot for this fantastic tool!!!

Re: CasparCG Conformer

#24
Hi everybody

I have modified the code of caspar conformer for two things

1.- Now can you pass a file with spaces or another symbol with problem and the file output is the same
2.- Now can you pass the extension for the file in the xml and now can you convert for example the avi to mp4 or mov to avi or ... to ...

This is the change for xml

<Target extension=".avi" command="-s 480x360 -aspect 4:3 -r 25 -vcodec libx264 -async 1 -g 25 -acodec libmp3lame -ab 64k -ar 48000 -ac 2 -threads 4 -vpre libx264-medium -b 550k" result=".mp4"/>
Attachments
CasparCG.Conformer.Core.rar
(2.38 KiB) Downloaded 560 times

Who is online

Users browsing this forum: No registered users and 2 guests

cron