Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (90)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (10497)

  • 'Source code does not match byte code' Android Studio

    26 août 2020, par Connoe

    I'm developing an Android video editing app using FFmpeg libraries in Android Studio version 4.01. When I try to debug, the debugger steps into the decompiler and flashes, 'Source code does not match byte code' across multiple steps through the decompiled code. The debugger also seems to be jumping around the decompiled code semi-randomly, for example : here, where logSlowDispatch is false but the debugger steps into the contents of the if statement anyway without checking and flashes 'Source code does not match byte code'. I've looked at alot of posts about this problem and have tried many of the suggested solutions from invalidate cache/restart to a fresh install of Android Studio to no avail. I've read that redundant or outdated gradle dependencies might have something to do with this, but removing some of these dependencies hasn't helped :

    


    apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.example.capstoneapplication"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        ndkVersion "21.3.6528147"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support.constraint:constraint-layout:2.0.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.writingminds:FFmpegAndroid:0.3.2'

    implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'

    implementation 'com.intuit.sdp:sdp-android:1.0.6'
}


    


    My code seems to be running properly and executing the ffmpeg command on the desired video between these jumps to the decompiler, but the video does not save. Here is a snippet from the java class that might be causing this :

    


        @Override
    public boolean onOptionsItemSelected(MenuItem menuItem){
        if(menuItem.getItemId()==R.id.trim){
            final AlertDialog.Builder alertDialog = new AlertDialog.Builder(com.example.capstoneapplication.VideoTrimmer.this);

            LinearLayout linLay = new LinearLayout(com.example.capstoneapplication.VideoTrimmer.this);
            linLay.setOrientation(LinearLayout.VERTICAL);
            LinearLayout.LayoutParams layPar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
            layPar.setMargins(50, 0, 50, 100 );
            final EditText input = new EditText(com.example.capstoneapplication.VideoTrimmer.this);
            input.setLayoutParams(layPar);
            input.setGravity(Gravity.TOP|Gravity.START);
            input.setInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
            linLay.addView(input,layPar);

            alertDialog.setMessage("Enter Video Name");
            alertDialog.setTitle("Change Video Name");
            alertDialog.setView(linLay);
            alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            });
            alertDialog.setPositiveButton("Submit", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    fileName = input.getText().toString();

                    try {
                        snipVideo(videoDurBar.getAbsoluteMinValue().intValue(), videoDurBar.getSelectedMaxValue().intValue(), fileName);
                    } catch ( FFmpegNotSupportedException e) {
                        e.printStackTrace();
                    }


                }
            });
            alertDialog.show();
        }
        return super.onOptionsItemSelected(menuItem);
    }

    private void snipVideo( int min, int max, String fileName) throws FFmpegNotSupportedException {

        File destFolder = new File("storage/emulated/0" + "/EditingApeSnippedVideos");
        if(!destFolder.exists()){
            destFolder.mkdir();
        }
        String fileExtension = ".mp4";
        destination = new File(destFolder, fileName + fileExtension);
        inputVideoPath = getPathFromUri(getApplicationContext(),uri);


        command = new String[]{"-ss", "" + min/1000 , "-y", "-i", inputVideoPath, "-t", ""+ (max-min)/1000 ,"-vcodec", "mpeg4", "-b:v","2097152","-b:a", "48000", "-ac","2","-ar","22050", destination.getAbsolutePath()};

        //testing command
        //command = new String []{"-y", "-i", inputVideoPath, "-ss", "00:00:02" , "-to", "00:00:03", "-c", "copy", destination.getAbsolutePath()};
        final FFmpeg ff = FFmpeg.getInstance(this);
        ff.loadBinary(new FFmpegLoadBinaryResponseHandler() {

            @Override
            public void onStart() {

                Log.i("VideoTrimmer","onStart");
            }

            @Override
            public void onFinish() {
                Log.i("VideoTrimmer","onFinish");
            }

            @Override
            public void onFailure() {
                Log.i("VideoTrimmer","onFailure");
            }

            @Override
            public void onSuccess() {
                Log.i("VideoTrimmer","Success");
                try {
                    ff.execute(command, new ExecuteBinaryResponseHandler());
                } catch (FFmpegCommandAlreadyRunningException e) {
                    Log.i("VideoTrimmer","FFmpegAlreadyRunning Exception");

                }
            }
        });
    }


    


    Has anyone found a solution to this debugger issue ?

    


  • FFmpeg RTSP Recording : Video Timestamp Does not Match With Recorded MP4 File Timestamp [closed]

    26 avril 2024, par lastpeony4

    I'm currently testing by streaming a 30 fps example flv video using a local Happy-Time RTSP server.

    


    This is the flv file i am streaming with RTSP :

    


    enter image description here

    


    I recorded the video with below ffmpeg command :

    


    ffmpeg -i rtsp://127.0.0.1:6555/test30fps.flv -c copy test30fps.mp4


    


    The resulting video appears visually satisfactory, yet there's a discrepancy between the displayed time on the video and the actual duration of the video file. Although the MP4 file duration is correct (endRecordingTimeMs-startRecordingTimeMs= mp4 file duration), the time displayed within the video does not synchronize precisely with the file's time. Notably, this disparity escalates as the video progresses.

    


    I anticipate the time text overlaid on the video and the file's time to align seamlessly. However, a few seconds of divergence are noticeable, gradually expanding over the video's duration.

    


    enter image description here

    


    Why does this occur and is there any way to fix this ?

    


  • how to improve edge interpolation of rotation in moviepy

    15 juillet 2021, par OneWorld

    I tried changing the interpolation method of rotation from 'bilinear' to 'bicubic' in the below, but it didn't seem to improve the edge interpolation. (it still looks a little bit jagged)

    


    I was wondering what I need to do to improve this ?

    


    import moviepy.editor as mped
import sys
import numpy as np

bgrd_width = 200
bgrd_height = 200
sunset = mped.ImageClip("sunset200x100.jpg", duration=1).set_position((1, 1))
bgrd = mped.ColorClip(size=(bgrd_width, bgrd_height), color=np.array([200, 200, 200]).astype(np.uint8), duration=3).set_position((0, 0))

angle = 56
interpolation = 'bicubic'

rotated_sunset = sunset.add_mask().rotate(angle, unit='deg', expand=True, resample=interpolation).set_duration(3)
stacked_clips = mped.CompositeVideoClip([bgrd, rotated_sunset], size=[bgrd_width, bgrd_height])

stacked_clips.write_videofile(f'sunset_rotated_{angle}_{interpolation}.mp4', fps=5)



    


    See attached comparison image of bilinear and bicubic interpolation.
enter image description here

    


    Adding to this, I have seen now that the inside of the image does improve in quality with cubic, compared with nearest neighbour.

    


    enter image description here

    


    The reason for the smooth inside, and jagged asset edge is because there's no pixel to sample from outside the boundary of the image, when interpolation is applied.

    


    I wrote some moviepy code, which adds a black margin (which actually turns transparent) and mask and then rotates. With bicubic interpolation it creates course, black lines, with a strange blend. However, with bilinear interpolation, the lines are much less apparent.

    


    # Add margin, add mask, rotate with interpolation of transparent 2 pixel border.
original_clip = mped.ImageClip("sunset200x100.jpg")
opaque_color = np.array([255, 255, 255]).astype(np.uint8)
margin_color = np.array([0, 0, 0]).astype(np.uint8)
margin_added_clip = original_clip.margin(2, color=margin_color)  # adds 2 pixel black border.
color_mask = mped.ColorClip(size=(original_clip.size), color=opaque_color).margin(2, color=margin_color)
mask = color_mask.to_mask()  # converts to grayscale with values between 0 and 1
masked_clip = margin_added_clip.set_mask(mask)  # adds the float mask to the clip
rotated_sunset = masked_clip.rotate(56, unit='deg', expand=True, resample="bicubic")
rotated_sunset.save_frame("sunset_rotated_56_degrees_moviepy_with_2px_mask.png")  # uses imageio to save the frame.


    


    enter image description here

    


    However,

    


    If you switch from bicubic to bilinear, it looks a lot better :-

    


    enter image description here