Resizing video problem

Archived from the Transloadit support forum. Originally posted on July 27, 2011; details may be outdated, see our docs for current behavior. Original thread

Hello!
My template is:
{ “steps”: {

"flash_encode": {
     "robot": "/video/encode",
     "preset": "flash",
     "realtime":true,
     "width":320,
     "height":240,

“result”: true

},
"thumbs":{
        "use":"flash_encode",
        "robot": "/video/thumbs",
        "count": 1,

“result”: true

 }

} }

Result video must be 320x240 but… that may result below. Thumbnails all right. What I done wrong?

Result Details:
Array
(

[ok] => ASSEMBLY_COMPLETED
[message] => The assembly was successfully completed.
[assembly_id] => REDACTED
[assembly_url] => http://api2.trudy.transloadit.com/assemblies/REDACTED
[bytes_received] => 2732702
[bytes_expected] => 2732702
[client_agent] => Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 FirePHP/0.5
[client_ip] => 46.118.214.105
[client_referer] => http://transloadit.com/templates/test/REDACTED
[start_date] => 2011/07/27 10:43:22 GMT
[upload_duration] => 12.896
[execution_duration] => 1.805
[fields] => Array
    (
    )

[uploads] => Array
    (
        [0] => Array
            (
                [id] => REDACTED
                [name] => video-3.flv
                [basename] => video-3
                [ext] => flv
                [size] => 2731879
                [mime] => video/x-flv
                [type] => video
                [field] => test_file
                [original_id] => REDACTED
                [url] => http://tmp.trudy.transloadit.com/upload/REDACTED.flv
                [meta] => Array
                    (
                        [duration] => 30.792
                        [width] => 640
                        [height] => 360
                        [framerate] => 24
                        [video_bitrate] => 641051.44193297
                        [video_codec] => ffh264
                        [audio_bitrate] => 63416
                        [audio_samplerate] => 22050
                        [audio_channels] => 2
                        [audio_codec] => ffaac
                        [seekable] => 1
                        [date_recorded] => 
                        [date_file_created] => 
                        [date_file_modified] => 2011/07/27 10:43:35 GMT
                        [device_vendor] => 
                        [device_name] => 
                        [device_software] => 
                        [latitude] => 
                        [longitude] => 
                        [rotation] => 
                    )

            )

    )

[last_seq] => 3
[results] => Array
    (
        [flash_encode] => Array
            (
                [0] => Array
                    (
                        [id] => REDACTED
                        [name] => video-3.flv
                        [basename] => video-3
                        [ext] => flv
                        [size] => 2278154
                        [mime] => video/x-flv
                        [type] => video
                        [field] => test_file
                        [original_id] => REDACTED
                        [url] => http://tmp.trudy.transloadit.com/scratch/REDACTED
                        [meta] => Array
                            (
                                [duration] => 31
                                [width] => 640
                                [height] => 360
                                [framerate] => 25
                                [video_bitrate] => 641000
                                [video_codec] => ffflv
                                [audio_bitrate] => 64000
                                [audio_samplerate] => 44100
                                [audio_channels] => 2
                                [audio_codec] => mp3
                                [seekable] => 1
                                [date_recorded] => 
                                [date_file_created] => 
                                [date_file_modified] => 2011/07/27 10:43:35 GMT
                                [device_vendor] => 
                                [device_name] => 
                                [device_software] => 
                                [latitude] => 
                                [longitude] => 
                                [rotation] => 
                            )

                        [bytesReceived] => 1129962
                        [ended] => 
                    )

            )

        [thumbs] => Array
            (
                [0] => Array
                    (
                        [id] => REDACTED
                        [name] => video-3.jpg
                        [basename] => video-3
                        [ext] => jpg
                        [size] => 8100
                        [mime] => image/jpeg
                        [type] => image
                        [field] => test_file
                        [original_id] => REDACTED
                        [url] => http://tmp.transloadit.com.s3.amazonaws.com/REDACTED
                        [meta] => Array
                            (
                                [duration] => 31
                                [width] => 320
                                [height] => 240
                                [framerate] => 25
                                [video_bitrate] => 641000
                                [video_codec] => ffflv
                                [audio_bitrate] => 64000
                                [audio_samplerate] => 44100
                                [audio_channels] => 2
                                [audio_codec] => mp3
                                [seekable] => 1
                                [date_recorded] => 
                                [date_file_created] => 
                                [date_file_modified] => 2011/07/27 10:43:35 GMT
                                [device_vendor] => 
                                [device_name] => 
                                [device_software] => 
                                [latitude] => 
                                [longitude] => 
                                [rotation] => 
                                [thumb_index] => 0
                                [thumb_offset] => 15.5
                                [title] => 
                                [description] => 
                                [location] => 
                                [city] => 
                                [state] => 
                                [country] => 
                                [country_code] => 
                                [keywords] => 
                                [aperture] => 
                                [exposure_compensation] => 
                                [exposure_mode] => 
                                [exposure_time] => 
                                [flash] => 
                                [focal_length] => 
                                [f_number] => 
                                [iso] => 
                                [light_value] => 
                                [metering_mode] => 
                                [shutter_speed] => 
                                [white_balance] => 
                                [orientation] => 
                                [frame_count] => 
                            )

                        [bytesReceived] => 1129962
                        [ended] => 
                    )

            )

    )

)

Hey Evgeny,

I have debugged this and it’s definitely a problem with ffmpeg, which I need more time to solve.

Could you maybe encode this file first into a format different from flash (without resizing it) and then encoding it using your above template into flash again?

Will let you know as soon as I know more about this.

Kind regards,
Tim

Closing this for now.