Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Sur d’autres sites (18)

  • Uploading video to Twitter sometimes doesn't work

    22 juillet 2021, par K-s S-k

    I have a very difficult situation. I've already spent 2 days and couldn't find a solution. Project on Laravel. I want to upload videos to Twitter using the Twitter API endpoints. But sometimes I am getting this error :

    


    


    file is currently unsupported

    


    


    I did everything as recommended in the official documentation Video specifications and recommendations. I get an error when I set an audio codec is aac in my video file, despite the fact that it is recommended in the official documentation, but when I set the audio codec to mp3, the video is uploaded, but the sound quality is very poor, and sometimes there is no sound at all. Please forgive me if this is awkward to read, but I want to provide all of my code. Because I don't know how to solve this anymore and I think it might help.

    


    <?php

namespace App\Jobs;

use App\Models\PublishedContent;
use Atymic\Twitter\Facades\Twitter;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Bus\Queueable;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\File;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Str;


class PublishToTwitter implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * @var
     */
    protected $publishingData;

    /**
     * Create a new job instance.
     *
     * @param $publishingData
     */
    public function __construct($publishingData)
    {
        $this->publishingData = $publishingData;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $publishingData = $this->publishingData;

        if (is_array($publishingData)) {
            $publishingResult = $this->publishing(...array_values($publishingData));
            sendNotification($publishingResult['message'], $publishingResult['status'], 'Twitter', $publishingResult['link'], $publishingData['post_name'], $publishingData['user']);
        } else {
            $scheduledData = processingScheduledPost($publishingData);
            $postName = $scheduledData['scheduleData']['post_name'];
            $postContent = $scheduledData['scheduleData']['post_content'];
            $userToken = json_decode($publishingData->user_token,true);
            $requestToken = [
                'token'  => $userToken['oauth_token'],
                'secret' => $userToken['oauth_token_secret'],
            ];
            $publishingResult = $this->publishing($scheduledData['file'], $postName, $postContent, $requestToken);
            $publishingResult['status'] && PublishedContent::add($scheduledData['craft'], $scheduledData['file'], "twitter_share");
            sendResultToUser($publishingData, $scheduledData['user'], $publishingResult['message'], $postName, $publishingResult['link'], $publishingResult['publishing_status'], $scheduledData['social_media']);
            sendNotification($publishingResult['message'], $publishingResult['status'], 'Twitter', $publishingResult['link'], $postName, $scheduledData['user']);
        }
    }

    /**
     * @param $file
     * @param $postName
     * @param $postContent
     * @param $requestToken
     * @return array
     */
    private function publishing($file, $postName, $postContent, $requestToken): array
    {
        $result = [
            'status' => false,
            'link' => null,
            'message' => 'Your content can\'t successfully published on Twitter. This file is not supported for publishing.',
            'publishing_status' => 'error'
        ];

        if ((($file->refe_type !== 'text') || $file->refe_file_path) && !checkIfFileExist($file->refe_file_path)) {
            $result['message'] = 'Missing or invalid file.';
            return $result;
        }

        $filePath = $file->refe_file_path;
        $fileSize = $file->content_length;
        $tempFileName = 'temp-' . $file->refe_file_name;
        $ext = $file->file_type;
        $mediaCategory = 'tweet_' . $file->refe_type;
        $mediaType = $file->refe_type . '/' . $ext;
        $remoteFile = file_get_contents($filePath);
        $tempFolder = public_path('/storage/uploads/temp');

        if (!file_exists($tempFolder)) {
            mkdir($tempFolder, 0777, true);
        }

        $tempFile = public_path('/storage/uploads/temp/' . $tempFileName);
        File::put($tempFile, $remoteFile);
        $convertedFileName = 'converted-' . $file->refe_file_name;
        $convertedFile = public_path('/storage/uploads/temp/' . $convertedFileName);
        $command = 'ffmpeg -y -i '.$tempFile.' -b:v 5000k -b:a 380k -c:a aac -profile:a aac_low -threads 1 '.$convertedFile.'';
        exec($command);
        @File::delete($tempFile);

        try {
            $twitter = Twitter::usingCredentials($requestToken['token'], $requestToken['secret']);
            if ($file->refe_type === 'text') {
                $twitter->postTweet([
                    'status' => urldecode($postContent),
                    'format' => 'json',
                ]);

                $result['link'] = 'https://twitter.com/home';
                $result['status'] = true;
                $result['message'] = 'Your content successfully published on Twitter. You can visit to Twitter and check it.';
                $result['publishing_status'] = 'done';
            } else if ($file->refe_type === 'video' || $file->refe_type === 'image') {
                if ($file->refe_type === 'video') {
                    $duration = getVideoDuration($file->refe_file_path);

                    if ($duration > config('constant.sharing_configs.max_video_duration.twitter')) {
                        throw new \Exception('The duration of the video file must not exceed 140 seconds.');
                    }
                }

                $isFileTypeSupported = checkPublishedFileType('twitter', $file->refe_type, strtolower($ext));
                $isFileSizeSupported = checkPublishedFileSize('twitter', $file->refe_type, $fileSize, strtolower($ext));

                if (!$isFileTypeSupported) {
                    throw new \Exception('Your content can\'t successfully published on Twitter. This file type is not supported for publishing.');
                }

                if (!$isFileSizeSupported) {
                    throw new \Exception('Your content can\'t successfully published on Twitter. The file size is exceeded.');
                }

                if ($file->refe_type === 'video') $fileSize = filesize($convertedFile);

                if (strtolower($ext) === 'gif') {
                    $initMedia = $twitter->uploadMedia([
                        'command' => 'INIT',
                        'total_bytes' => (int)$fileSize
                    ]);
                } else {
                    $initMedia = $twitter->uploadMedia([
                        'command' => 'INIT',
                        'media_type' => $mediaType,
                        'media_category' => $mediaCategory,
                        'total_bytes' => (int)$fileSize
                    ]);
                }

                $mediaId = (int)$initMedia->media_id_string;

                $fp = fopen($convertedFile, 'r');
                $segmentId = 0;

                while (!feof($fp)) {
                    $chunk = fread($fp, 1048576);

                    $twitter->uploadMedia([
                        'media_data' => base64_encode($chunk),
                        'command' => 'APPEND',
                        'segment_index' => $segmentId,
                        'media_id' => $mediaId
                    ]);

                    $segmentId++;
                }

                fclose($fp);

                $twitter->uploadMedia([
                    'command' => 'FINALIZE',
                    'media_id' => $mediaId
                ]);

                if ($file->refe_type === 'video') {
                    $waits = 0;

                    while ($waits <= 4) {
                        // Authorizing header for Twitter API
                        $oauth = [
                            'command' => 'STATUS',
                            'media_id' => $mediaId,
                            'oauth_consumer_key' => config('twitter.consumer_key'),
                            'oauth_nonce' => Str::random(42),
                            'oauth_signature_method' => 'HMAC-SHA1',
                            'oauth_timestamp' => time(),
                            'oauth_token' => $requestToken['token'],
                            'oauth_version' => '1.0'
                        ];

                        // Generate an OAuth 1.0a HMAC-SHA1 signature for an HTTP request
                        $baseInfo = $this->buildBaseString('https://upload.twitter.com/1.1/media/upload.json', 'GET', $oauth);
                        // Getting a signing key
                        $compositeKey = rawurlencode(config('twitter.consumer_secret')) . '&' . rawurlencode($requestToken['secret']);
                        // Calculating the signature
                        $oauthSignature = base64_encode(hash_hmac('sha1', $baseInfo, $compositeKey, true));
                        $oauth['oauth_signature'] = $oauthSignature;
                        $headers['Authorization'] = $this->buildAuthorizationHeader($oauth);

                        try {
                            $guzzle = new GuzzleClient([
                                'headers' => $headers
                            ]);
                            $response = $guzzle->request( 'GET', 'https://upload.twitter.com/1.1/media/upload.json?command=STATUS&media_id=' . $mediaId);
                            $uploadStatus = json_decode($response->getBody()->getContents());
                        } catch (\Exception | GuzzleException $e) {
                            dd($e->getMessage(), $e->getLine(), $e->getFile());
                        }

                        if (isset($uploadStatus->processing_info->state)) {
                            switch ($uploadStatus->processing_info->state) {
                                case 'succeeded':
                                    $waits = 5; // break out of the while loop
                                    break;
                                case 'failed':
                                    File::delete($tempFile);
                                    Log::error('File processing failed: ' . $uploadStatus->processing_info->error->message);
                                    throw new \Exception('File processing failed: ' . $uploadStatus->processing_info->error->message);
                                default:
                                    sleep($uploadStatus->processing_info->check_after_secs);
                                    $waits++;
                            }
                        } else {
                            throw new \Exception('There was an unknown error uploading your file');
                        }
                    }
                }

                $twitter->postTweet(['status' => urldecode($postContent), 'media_ids' => $initMedia->media_id_string]);
                @File::delete($convertedFile);
                $result['link'] = 'https://twitter.com/home';
                $result['status'] = true;
                $result['message'] = 'Your content successfully published on Twitter. You can visit to Twitter and check it.';
                $result['publishing_status'] = 'done';
            }
        } catch (\Exception $e) {
            dd($e->getMessage());
            $result['message'] = $e->getMessage();
            return $result;
        }

        return $result;
    }

    /**
     * @param $baseURI
     * @param $method
     * @param $params
     * @return string
     *
     * Creating the signature base string
     */
    protected function buildBaseString($baseURI, $method, $params): string
    {
        $r = array();
        ksort($params);
        foreach($params as $key=>$value){
            $r[] = "$key=" . rawurlencode($value);
        }
        return $method . "&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r));
    }

    /**
     * @param $oauth
     * @return string
     *
     * Collecting parameters
     */
    protected function buildAuthorizationHeader($oauth): string
    {
        $r = 'OAuth ';
        $values = array();
        foreach($oauth as $key=>$value)
            $values[] = "$key=\"" . rawurlencode($value) . "\"";
        $r .= implode(', ', $values);
        return $r;
    }
}



    


    I would be very grateful if someone would help me.

    


  • The screen recorder utility has failed to store the actual screen recording iOS

    31 mai 2023, par manoj

    I am getting the below issue when I run my code to record the screen on failure.

    


    An unknown server-side error occurred while processing the command. Original error : The screen recorder utility has failed to store the actual screen recording at '/var/folders/js/h2_7h9bj1fj8cn19tqcm8hnw0000gn/T/202341-30610-87cfav.bsg2u/appium_3f7703.mp4'

    


    Note : This issue is occurring during the tearDown.

    


    the code is showing stop recording is failing and this issue is occurring for only one test class

    


    public static File screenRecording(String prefix) throws IOException {
        File classpathRoot = new File(System.getProperty("user.dir"));
        String screenRec = ((CanRecordScreen) driver).stopRecordingScreen();
        byte[] screenRecord = Base64.decodeBase64(screenRec);
        String destinationPath = classpathRoot.getAbsolutePath() + "/screenRecordings/" + driver.getPlatformName()
                + " Video " + prefix + " " + new Date() + ".mp4";
        Path filePath = Paths.get(destinationPath);
        Files.write(filePath, screenRecord);
        File recordedFile = FileUtils.getFile(String.valueOf(filePath));
        return recordedFile;
    }


    


    The same thing when I run it successfully is passing in other test

    


    This is the thread that I was reffering

    


    Appium stack

    


    [ INFO ] 2023-05-26 13:38:51.636 [TestHelpers.PropertiesHelper.getRestartDeviceProperty(PropertiesHelper.java:181)] - Loading the 'RestartDevice' Property from the 'appiumTests.properties' file
[ INFO ] 2023-05-26 13:38:51.641 [TestFixtures.BaseTestFixture.globalSetup(BaseTestFixture.java:81)] - Building Appium Server...
[ INFO ] 2023-05-26 13:38:51.733 [TestFixtures.BaseTestFixture.globalSetup(BaseTestFixture.java:88)] - Appium server is built.
[ INFO ] 2023-05-26 13:38:51.733 [TestFixtures.BaseTestFixture.globalSetup(BaseTestFixture.java:89)] - Starting appium server...
[Appium] Welcome to Appium v1.22.2
[Appium] Non-default server args:
[Appium]   port: 3022
[Appium]   logFile: /Users/subh/IdeaProjects/tile_mobile_automation/logs/appium.log
[Appium]   loglevel: info
[Appium]   relaxedSecurityEnabled: true
[Appium] Appium REST http interface listener started on 0.0.0.0:3022
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[HTTP] <-- GET /wd/hub/status 200 5 ms - 68
[HTTP] 
[ INFO ] 2023-05-26 13:38:53.069 [TestFixtures.BaseTestFixture.globalSetup(BaseTestFixture.java:91)] - Appium server started.

[ffmpeg] Output #0, mp4, to '/var/folders/js/h2_7h9bj1fj8cn19tqcm8hnw0000gn/T/2023426-9341-y22m7g.0jfd/appium_eca508.mp4':
[ffmpeg]   Metadata:
[ffmpeg]     encoder         : Lavf59.27.100
[ffmpeg]   Stream #0:0: Video: h264 (avc1 / 0x31637661), yuvj420p(pc, bt470bg/unknown/unknown, progressive), 720x1280 [SAR 520:633 DAR 195:422], q=2-31, 25 fps, 12800 tbn
[ffmpeg]     Metadata:
[ffmpeg]       encoder         : Lavc59.37.100 libx264
[ffmpeg] 
[ffmpeg]     Side data:
[ffmpeg]       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
[ffmpeg] 
[XCUITest] Starting screen capture on the device 'xxxxxxxx-xxxxxxxxxxxxxxxx' with command: 'ffmpeg -f mjpeg -i http://127.0.0.1:9100 -vf scale=720:1280 -vcodec h264 -y /var/folders/js/h2_7h9bj1fj8cn19tqcm8hnw0000gn/T/2023426-9341-y22m7g.0jfd/appium_eca508.mp4'. Will timeout in 1800000ms
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/start_recording_screen 200 621 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/device/terminate_app
[HTTP] {"bundleId":"com.apple.Preferences"}
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/device/terminate_app 200 6 ms - 15
[HTTP] 
[ INFO ] 2023-05-26 13:39:15.082 [TestFixtures.BaseTestFixture.setUp(BaseTestFixture.java:200)] - App Version is 2.115.0(7936)
<-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element 200 208 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/CC010000-0000-0000-1709-000000000000/click
[HTTP] {"id":"CC010000-0000-0000-1709-000000000000"}
[W3C (9a4d93a9)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Replacing sessionId 643ECEF8-D0E3-47D0-AE3D-3FC884C69235 with 9a4d93a9-b723-4e2e-abad-db859e5efeed
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/CC010000-0000-0000-1709-000000000000/click 200 805 ms - 65
[HTTP] 
[HTTP] --> GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/context
[HTTP] {}
[HTTP] <-- GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/context 200 1 ms - 22
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element
[HTTP] {"using":"id","value":"OK"}
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element 200 309 ms - 137
[HTTP] 
[HTTP] --> GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/39020000-0000-0000-1709-000000000000/displayed
[HTTP] {}
[W3C (9a4d93a9)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Replacing sessionId 643ECEF8-D0E3-47D0-AE3D-3FC884C69235 with 9a4d93a9-b723-4e2e-abad-db859e5efeed
[HTTP] <-- GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/39020000-0000-0000-1709-000000000000/displayed 200 134 ms - 65
[HTTP] 
[HTTP] --> GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/context
[HTTP] {}
[HTTP] <-- GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/context 200 1 ms - 22
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element
[HTTP] {"using":"id","value":"OK"}
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element 200 253 ms - 137
[HTTP] 
[HTTP] --> GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/39020000-0000-0000-1709-000000000000/text
[HTTP] {}
[W3C (9a4d93a9)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Replacing sessionId 643ECEF8-D0E3-47D0-AE3D-3FC884C69235 with 9a4d93a9-b723-4e2e-abad-db859e5efeed
[HTTP] <-- GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/39020000-0000-0000-1709-000000000000/text 200 117 ms - 65
[HTTP] 
[HTTP] --> GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/context
[HTTP] {}
[HTTP] <-- GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/context 200 1 ms - 22
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element
[HTTP] {"using":"id","value":"OK"}
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element 200 247 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/39020000-0000-0000-1709-000000000000/click
[HTTP] {"id":"39020000-0000-0000-1709-000000000000"}
[W3C (9a4d93a9)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Replacing sessionId 643ECEF8-D0E3-47D0-AE3D-3FC884C69235 with 9a4d93a9-b723-4e2e-abad-db859e5efeed
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/39020000-0000-0000-1709-000000000000/click 200 778 ms - 65
[HTTP] 
[HTTP] --> GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/context
[HTTP] {}
[HTTP] <-- GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/context 200 1 ms - 22
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element
[HTTP] {"using":"id","value":"btn_add_tile"}
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element 200 285 ms - 137
[HTTP] 
[HTTP] --> GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/06010000-0000-0000-1709-000000000000/displayed
[HTTP] {}
[W3C (9a4d93a9)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Replacing sessionId 643ECEF8-D0E3-47D0-AE3D-3FC884C69235 with 9a4d93a9-b723-4e2e-abad-db859e5efeed
[HTTP] <-- GET /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/element/06010000-0000-0000-1709-000000000000/displayed 200 133 ms - 65
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/app/reset
[HTTP] {}
[DevCon Factory] Releasing connections for xxxxxxxx-xxxxxxxxxxxxxxxx device on 9100 port number
[DevCon Factory] No cached connections have been found
[DevCon Factory] Releasing connections for xxxxxxxx-xxxxxxxxxxxxxxxx device on any port number
[DevCon Factory] Found cached connections to release: ["00008110-0004150236E8401E:8100"]
[DevCon Factory] Releasing the listener for 'xxxxxxxx-xxxxxxxxxxxxxxxx:8100'
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver]   appPushTimeout
[BaseDriver]   app
[BaseDriver]   automationName
[BaseDriver]   deviceName
[BaseDriver]   fullReset
[BaseDriver]   newCommandTimeout
[BaseDriver]   noReset
[BaseDriver]   platformVersion
[BaseDriver]   processArguments
[BaseDriver]   showXcodeLog
[BaseDriver]   udid
[BaseDriver]   xcodeOrgId
[BaseDriver]   xcodeSigningId
[BaseDriver] Session created with session id: 7950b9ef-eac2-4169-a035-2d183deacf68
[XCUITest] Determining device to run tests on: udid: 'xxxxxxxx-xxxxxxxxxxxxxxxx', real device: true
[XCUITest] Normalized platformVersion capability value '16.4.1' to '16.4'
[BaseDriver] Using local app '/Users/subh/IdeaProjects/tile_mobile_automation/apps/tile_appstore_adhoc.ipa'
[BaseDriver] Will reuse previously cached application at '/var/folders/js/h2_7h9bj1fj8cn19tqcm8hnw0000gn/T/2023426-9341-af6qqi.jfr2v/tile.app'
[WebDriverAgent] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent'
[WebDriverAgent] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
[XCUITest] Setting up real device
[XCUITest] App installation succeeded after 14402ms
[DevCon Factory] Requesting connection for device xxxxxxxx-xxxxxxxxxxxxxxxx on local port 8100, device port 8100
[DevCon Factory] Successfully requested the connection for xxxxxxxx-xxxxxxxxxxxxxxxx:8100
[WebDriverAgent] Will reuse previously cached WDA instance at 'http://127.0.0.1:8100/' with 'com.facebook.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior.
[WebDriverAgent] Using provided WebdriverAgent at 'http://127.0.0.1:8100/'
[WD Proxy] Determined the downstream protocol as 'W3C'
[XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior.
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/app/reset 200 18735 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/device/terminate_app
[HTTP] {"bundleId":"com.apple.Preferences"}
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/device/terminate_app 200 1046 ms - 14
INFO: Loading the 'SaveVideoOnSuccess' Property from the 'appiumTests.properties' file
[HTTP] 
[HTTP] --> POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/stop_recording_screen
[HTTP] {}
[DevCon Factory] Releasing connections for xxxxxxxx-xxxxxxxxxxxxxxxx device on 9100 port number
[DevCon Factory] No cached connections have been found
[XCUITest] The screen recorder utility has failed to store the actual screen recording at '/var/folders/js/h2_7h9bj1fj8cn19tqcm8hnw0000gn/T/2023426-9341-y22m7g.0jfd/appium_eca508.mp4'
[DevCon Factory] Releasing connections for xxxxxxxx-xxxxxxxxxxxxxxxx device on 9100 port number
[DevCon Factory] No cached connections have been found
[HTTP] <-- POST /wd/hub/session/9a4d93a9-b723-4e2e-abad-db859e5efeed/appium/stop_recording_screen 500 14 ms - 841
[HTTP] 

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The screen recorder utility has failed to store the actual screen recording at '/var/folders/js/h2_7h9bj1fj8cn19tqcm8hnw0000gn/T/2023426-9341-y22m7g.0jfd/appium_eca508.mp4'
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'localhost', ip: 'fe80:0:0:0:8c8:c2c0:abb2:3b1a%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '11.2', java.version: '11.0.11'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/subh/IdeaProjects/ti..., appPushTimeout: 50000, automationName: XCUITest, browserName: , databaseEnabled: false, deviceName: Tile DEV QA?s iPhone, fullReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, newCommandTimeout: 30, noReset: false, platform: MAC, platformName: ios, platformVersion: 16.4.1, processArguments: {arguments: -com.apple.CoreData.Concurr...}, showXcodeLog: true, takesScreenshot: true, udid: xxxxxxxx-xxxxxxxxxxxxxxxx, webStorageEnabled: false, xcodeOrgId: XK64B7G5HB, xcodeSigningId: iPhone Developer}
Session ID: 9a4d93a9-b723-4e2e-abad-db859e5efeed

  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
  at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
  at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
  at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
  at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
  at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:250)
  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
  at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:45)
  at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
  at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
  at io.appium.java_client.screenrecording.CanRecordScreen.stopRecordingScreen(CanRecordScreen.java:72)
  at TestFixtures.BaseTestFixture.tearDown(BaseTestFixture.java:253)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135)
  at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:65)
  at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:381)
  at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:319)
  at org.testng.internal.invokers.TestInvoker.runConfigMethods(TestInvoker.java:803)
  at org.testng.internal.invokers.TestInvoker.runAfterConfigurations(TestInvoker.java:772)
  at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:748)
  at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:220)
  at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
  at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:945)
  at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:193)
  at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
  at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
  at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
  at org.testng.TestRunner.privateRun(TestRunner.java:808)
  at org.testng.TestRunner.run(TestRunner.java:603)
  at org.testng.SuiteRunner.runTest(SuiteRunner.java:429)
  at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:423)
  at org.testng.SuiteRunner.privateRun(SuiteRunner.java:383)
  at org.testng.SuiteRunner.run(SuiteRunner.java:326)
  at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
  at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
  at org.testng.TestNG.runSuitesSequentially(TestNG.java:1249)
  at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
  at org.testng.TestNG.runSuites(TestNG.java:1092)
  at org.testng.TestNG.run(TestNG.java:1060)
  at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
  at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)




    


  • Alfresco Content transformation from .avi to *.flv using ffmpeg

    25 octobre 2011, par Masanchez

    I'm trying to transform diferents video formats into .flv in Alfresco
    I'm using 'ffmpeg' tool to transform content.
    My code :
    avi2flv-transform-context.xml

    <?xml version='1.0' encoding='UTF-8'?>

    <beans>
       <bean class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
           <property>
               <ref bean="mimetypeService"></ref>
           </property>
           <property>
               <bean class="org.alfresco.util.exec.RuntimeExec">
                   <property>
                       <map>
                           <entry key=".*">
                               <list>
                                   <value>ffmpeg</value>
                                   <value>-version</value>
                               </list>
                           </entry>
                       </map>
                   </property>
                   <property>
                       <value>1</value>
                   </property>
               </bean>
           </property>
           <property>
               <bean class="org.alfresco.util.exec.RuntimeExec">
                   <property>
                       <map>
                           <entry key="Linux">
                               <value>ffmpeg -i &#39;${target}&#39; ${flv.encoder.params} &#39;${source}&#39;</value>
                           </entry>
                       </map>
                   </property>
                   <property>
                       <value>1,2</value>
                   </property>
                   <property>
                       <value>true</value>
                   </property>
                   <property>
                       <props>
                           <prop key="flv.encoder.params">-vcodec flv</prop>
                       </props>
                   </property>
               </bean>
           </property>
           <property>
               <list>
    <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/avi</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-msvideo</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/mpeg</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/mp4</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/mpeg2</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-sgi-movie</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/quicktime</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-ms-asf</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-ms-wmv</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/x-rad-screenplay</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
                   <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
                       <property>
                           <value>video/ogg</value>
                       </property>
                       <property>
                           <value>video/x-flv</value>
                       </property>
                   </bean>
               </list>
           </property>
       </bean>
       <bean class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
           <property>
               <ref bean="transformer.ffmpeg.avi.worker"></ref>
           </property>
       </bean>
    </beans>

    webservice :

    if(getFile(folderVIDEO, field.filename) == null)
    {
                               if(file_test_node=folderVIDEO.createFile(nombrefichero+field.filename)){
                                   model.mensajes.push(&#39;Se ha creado el fichero &#39;+nombrefichero+field.filename);
                               }else
                                   model.mensajes.push(&#39;Ha ocurrido un error cuando se intentaba crear el fichero &#39;+nombrefichero+field.filename);
                               file_test_node.properties.content.write(field.content);
                               folderVIDEO = getFolder(search.findNode("workspace://SpacesStore/"+fondoid),nameFolderVIDEO);
                               var action = actions.create("transform");
                               // Store the transformed version in the same folder as the source
                               action.parameters["destination-folder"] = file_test_node.parent;
                               action.parameters["assoc-type"] = "{http://www.alfresco.org/model/content/1.0}contains";
                               action.parameters["assoc-name"] = file_test_node.name + "transformed";
                               action.parameters["mime-type"] = "video/x-flv";
                               // Execute
                               action.execute(file_test_node);
                           }

    The error

    The Web Script /alfresco/s/gcd/fondo has responded with a status of 500 - Internal Error.

    500 Description:     An error inside the HTTP server which prevented it from fulfilling the request.

    Message:    09180016 Wrapped Exception (with status template): 09180029 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/creado.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09180028 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/18/20/56/65b3457f-c37c-4404-b4b7-9abac30f018d.bin, mimetype=video/x-msvideo, size=1614694, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/18/20/56/e92d00e2-7bd8-4bdd-8d50-b61fe4bac903.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@745ce55


    Exception:  org.alfresco.service.cmr.repository.ContentIOException - 09180027 Transformation failed - status indicates an error: Execution result: os: Linux command: [ffmpeg, -i, &#39;/home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_target_3008293789769608319.flv&#39;, -vcodec flv, &#39;/home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_source_5021918644492976031.avi&#39;] succeeded: false exit code: 1 out: err: FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --extra-version=4:0.5.1-1ubuntu1.2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --e



    org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker.transform(RuntimeExecutableContentTransformerWorker.java:272)

    org.alfresco.repo.content.transform.ProxyContentTransformer.transformInternal(ProxyContentTransformer.java:68)

    org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:161)

    org.alfresco.repo.content.ContentServiceImpl.transform(ContentServiceImpl.java:555)

    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    java.lang.reflect.Method.invoke(Method.java:597)

    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)

    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:125)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:160)

    org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:137)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

    $Proxy42.transform(Unknown Source)

    org.alfresco.repo.action.executer.TransformActionExecuter.doTransform(TransformActionExecuter.java:305)

    org.alfresco.repo.action.executer.TransformActionExecuter.executeImpl(TransformActionExecuter.java:270)

    org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:133)

    org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:749)

    org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:675)

    org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:540)

    org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:526)

    org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:758)

    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    java.lang.reflect.Method.invoke(Method.java:597)

    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)

    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:217)

    org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:184)

    org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:137)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)

    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

    $Proxy34.executeAction(Unknown Source)

    org.alfresco.repo.jscript.ScriptAction.executeImpl(ScriptAction.java:147)

    org.alfresco.repo.jscript.ScriptAction.execute(ScriptAction.java:136)

    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    java.lang.reflect.Method.invoke(Method.java:597)

    org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)

    org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)

    org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)

    org.mozilla.javascript.gen.c59._c9(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js:459)

    org.mozilla.javascript.gen.c59.call(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js)

    org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)

    org.mozilla.javascript.gen.c59._c0(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js:271)

    org.mozilla.javascript.gen.c59.call(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js)

    org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)

    org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)

    org.mozilla.javascript.gen.c59.call(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js)

    org.mozilla.javascript.gen.c59.exec(workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/com/inventiaplus/gcd/fondo/creado.post.js)

    org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:472)

    org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:190)

    org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:282)

    org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)

    org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:981)

    org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)

    org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:383)

    org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)

    org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)

    org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)

    org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)

    org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)

    org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)

    org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)

    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

    java.lang.Thread.run(Thread.java:619)


    Exception:  org.alfresco.service.cmr.repository.ContentIOException - 09180028 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/18/20/56/65b3457f-c37c-4404-b4b7-9abac30f018d.bin, mimetype=video/x-msvideo, size=1614694, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/18/20/56/e92d00e2-7bd8-4bdd-8d50-b61fe4bac903.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@745ce55



    org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:177)


    Exception:  org.alfresco.scripts.ScriptException - 09180029 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/creado.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09180028 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/18/20/56/65b3457f-c37c-4404-b4b7-9abac30f018d.bin, mimetype=video/x-msvideo, size=1614694, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/18/20/56/e92d00e2-7bd8-4bdd-8d50-b61fe4bac903.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@745ce55



    org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:194)


    Exception:  org.springframework.extensions.webscripts.WebScriptException - 09180016 Wrapped Exception (with status template): 09180029 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/creado.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09180028 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/18/20/56/65b3457f-c37c-4404-b4b7-9abac30f018d.bin, mimetype=video/x-msvideo, size=1614694, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/18/20/56/e92d00e2-7bd8-4bdd-8d50-b61fe4bac903.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@745ce55



    org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:758)


    Server: Community v3.4.0 (c 3335) schema 4,113
    Time:   Oct 18, 2011 8:56:51 PM


    Diagnostics:    Inspect Web Script (com/inventiaplus/gcd/fondo/creado.post)

    I don't know where is the problem
    Somebody can help me ?

    I did some changes...

    avi2flv-transform-context.xml :

    <entry key="Linux">
           <value>ffmpeg -y -i &#39;${target}&#39; ${flv.encoder.params} &#39;${source}&#39;</value>
    </entry>

    Source <-> Target

    <props>
       <prop key="flv.encoder.params">-threads 2 -s 320x240 -r 29.97 -threads 1 -pix_fmt yuv420p -g 300 -qmin 3 -b 512k -async 50 -ar 44100 -ac 2 -ab 128k</prop>
    </props>

    change parameters

    error :

    The Web Script /alfresco/s/gcd/fondo/9fe0bf90-1875-4f51-9f75-7c35f6d0802c has responded with a status of 500 - Internal Error.

    500 Description:    An error inside the HTTP server which prevented it from fulfilling the request.

    Message:    09250001 Wrapped Exception (with status template): 09250004 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/guardar.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09250003 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/25/8/27/efff7050-3a67-492d-9e5b-507c03bd0a80.bin, mimetype=video/x-msvideo, size=256362496, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/25/8/28/cb81b7f2-3c72-4266-afd7-0d1a3fb9f420.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@18c4074f

    Exception:  org.alfresco.service.cmr.repository.ContentIOException - 09250002 Transformation failed - status indicates an error: Execution result: os: Linux command: [ffmpeg, -y, -i, &#39;/home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_target_4598080275234396407.flv&#39;, -threads 2 -s 320x240 -r 29.97 -threads 1 -pix_fmt yuv420p -g 300 -qmin 3 -b 512k -async 50 -ar 44100 -ac 2 -ab 128k, &#39;/home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_source_6538382831295915428.avi&#39;] succeeded: false exit code: 1 out: err: FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --extra-version=4:0.5.1-1ubuntu1.2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --e

       ...

    Exception:  org.alfresco.service.cmr.repository.ContentIOException - 09250003 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/25/8/27/efff7050-3a67-492d-9e5b-507c03bd0a80.bin, mimetype=video/x-msvideo, size=256362496, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/25/8/28/cb81b7f2-3c72-4266-afd7-0d1a3fb9f420.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@18c4074f

       org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:177)

    Exception:  org.alfresco.scripts.ScriptException - 09250004 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/guardar.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09250003 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/25/8/27/efff7050-3a67-492d-9e5b-507c03bd0a80.bin, mimetype=video/x-msvideo, size=256362496, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/25/8/28/cb81b7f2-3c72-4266-afd7-0d1a3fb9f420.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@18c4074f

       org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:194)

    Exception:  org.springframework.extensions.webscripts.WebScriptException - 09250001 Wrapped Exception (with status template): 09250004 Failed to execute script &#39;/com/inventiaplus/gcd/fondo/guardar.post.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)&#39;: 09250003 Content conversion failed: reader: ContentAccessor[ contentUrl=store://2011/10/25/8/27/efff7050-3a67-492d-9e5b-507c03bd0a80.bin, mimetype=video/x-msvideo, size=256362496, encoding=null, locale=es_ES] writer: ContentAccessor[ contentUrl=store://2011/10/25/8/28/cb81b7f2-3c72-4266-afd7-0d1a3fb9f420.bin, mimetype=video/x-flv, size=0, encoding=null, locale=es_ES] options: org.alfresco.service.cmr.repository.TransformationOptions@18c4074f

       org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:758)

    Server: Community v3.4.0 (c 3335) schema 4,113
    Time:   Oct 25, 2011 8:28:29 AM

    I use command line

    ffmpeg -y -i /home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_source_6538382831295915428.avi -threads 2 -s 320x240 -r 29.97 -threads 1 -pix_fmt yuv420p -g 300 -qmin 3 -b 512k -async 50 -ar 44100 -ac 2 -ab 128k /home/inventiaplus/alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformerWorker_target_4598080275234396407.flv

    and It works