Newest 'x264' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/x264

Les articles publiés sur le site

  • Why the audio of my mp4 file is going out of async

    16 juillet 2018, par Dop

    I am having a problem converting a wmv file to mp4. I am using x264.exe this command to get the video stream

    x264 --output temporal.264 --fps 25 --preset slow --bitrate 2048 --vbv-maxrate 2048 --vbv-bufsize 9600 --min-keyint 48 --keyint 48 --scenecut 0 --no-scenecut --pass 1 --video-filter "resize:width=640,height=480" Original.wmv

    Then I use ffmpeg.exe to extract the audio stream with this line:

    ffmpeg -i .wmv -acodec libfdk_aac -b:a 32000 temporal.aac

    finally I use MP4Box to merges each stream with this line:

    MP4Box -add temporal.264 Final.mp4 MP4Box -add temporal.aac Final.mp4

    The problem is that the final.mp4 audio is out of sync. It starts good but with time it goes out of sync with time.

    I run this command:

    MP4Box -info 010004470063PE-10022017083824-2_MultiMedia--1.mp4

    and I discover that the estimated time of both streams are different:

    output of command

    * Movie Info * Timescale 600 - 2 tracks Computed Duration 01:00:03.643 - Indicated Duration 01:00:03.643 Fragmented File: no File suitable for progressive download (moov before mdat) File Brand isom - version 1 Compatible brands: isom avc1 Created: GMT Wed Jun 27 16:31:44 2018 Modified: GMT Wed Jun 27 16:31:44 2018 File has root IOD (9 bytes) Scene PL 0xff - Graphics PL 0xff - OD PL 0xff Visual PL: AVC/H264 Profile (0x7f) Audio PL: AAC Profile @ Level 2 (0x29) No streams included in root OD Track # 1 Info - TrackID 1 - TimeScale 25000 Media Duration 00:59:57.520 - Indicated Duration 00:59:57.520 Track has 1 edit lists: track duration is 00:59:57.320 Media Info: Language "Undetermined (und)" - Type "vide:avc1" - 89938 samples Visual Track layout: x=0 y=0 width=640 height=480 MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21 AVC/H264 Video - Visual Size 640 x 480 AVC Info: 1 SPS - 1 PPS - Profile Main @ Level 3 NAL Unit length bits: 32 Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8 SPS#1 hash: 41EE779BEF2AA71A7131EAFD3C77C7E3BC95FD8E PPS#1 hash: 086E1D72A40A0E8CF35D102F34A9DF6CD44D6CEF Self-synchronized RFC6381 Codec Parameters: avc1.4D401E Average GOP length: 250 samples Track # 2 Info - TrackID 2 - TimeScale 44100 Media Duration 01:00:03.644 - Indicated Duration 01:00:03.644 Media Info: Language "Undetermined (und)" - Type "soun:mp4a" - 155196 samples MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40 MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 44100 Synchronized on stream 1 RFC6381 Codec Parameters: mp4a.40.2 All samples are sync

    I am not shore why this is happening, becar the original wmv is perfectly synchronize. Any help?

  • Why is the library built for armv7 even though I set -march=armv6 ?

    13 juillet 2018, par Luca Carlon

    I'm trying to build libx264 for armv6, but what I get seems to be built for armv7. I'm using this configure line:

    ./configure --host=arm-linux-gnueabihf --enable-static --cross-prefix=${CCPREFIX} --prefix=... --extra-cflags='-march=armv6' --extra-ldflags='-march=armv6' --extra-asflags='-march=armv6'
    

    which results in an output like this:

    [...]
    arm-linux-gnueabihf-gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math  -Wall -I. -I. -march=armv6 -std=gnu99 -D_GNU_SOURCE -fomit-frame-pointer -fno-tree-vectorize   -c -o common/opencl.o common/opencl.c
    arm-linux-gnueabihf-gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math  -Wall -I. -I. -march=armv6 -std=gnu99 -D_GNU_SOURCE -fomit-frame-pointer -fno-tree-vectorize   -c -o encoder/slicetype-cl.o encoder/slicetype-cl.c
    arm-linux-gnueabihf-gcc -I. -I. -march=armv6 -c -DSTACK_ALIGNMENT=4 -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/cpu-a.o common/arm/cpu-a.S
    [...]
    

    now this is what I see:

    $ readelf -A x264
    Attribute Section: aeabi
    File Attributes
      Tag_CPU_name: "7-A"
      Tag_CPU_arch: v7
      Tag_CPU_arch_profile: Application
      Tag_ARM_ISA_use: Yes
      Tag_THUMB_ISA_use: Thumb-2
      Tag_FP_arch: VFPv3
      Tag_Advanced_SIMD_arch: NEONv1
      Tag_ABI_PCS_wchar_t: 4
      Tag_ABI_FP_denormal: Needed
      Tag_ABI_FP_exceptions: Needed
      Tag_ABI_FP_number_model: IEEE 754
      Tag_ABI_align_needed: 8-byte
      Tag_ABI_enum_size: int
      Tag_ABI_HardFP_use: Deprecated
      Tag_ABI_VFP_args: VFP registers
      Tag_CPU_unaligned_access: v6
      Tag_DIV_use: Not allowed
    

    also I see this:

    $ readelf -A encoder/slicetype-cl.o
    Attribute Section: aeabi
    File Attributes
      Tag_CPU_name: "6"
      Tag_CPU_arch: v6
      Tag_ARM_ISA_use: Yes
      Tag_THUMB_ISA_use: Thumb-1
      Tag_FP_arch: VFPv2
      Tag_ABI_PCS_wchar_t: 4
      Tag_ABI_FP_number_model: Finite
      Tag_ABI_align_needed: 8-byte
      Tag_ABI_align_preserved: 8-byte, except leaf SP
      Tag_ABI_enum_size: int
      Tag_ABI_HardFP_use: Deprecated
      Tag_ABI_VFP_args: VFP registers
      Tag_ABI_optimization_goals: Aggressive Speed
      Tag_CPU_unaligned_access: v6
    

    but:

    $ readelf -A common/arm/cpu-a.o
    Attribute Section: aeabi
    File Attributes
      Tag_CPU_name: "7-A"
      Tag_CPU_arch: v7
      Tag_CPU_arch_profile: Application
      Tag_ARM_ISA_use: Yes
      Tag_THUMB_ISA_use: Thumb-2
      Tag_FP_arch: VFPv3
      Tag_Advanced_SIMD_arch: NEONv1
    

    Can someone explain why those commands seem to output an armv6 binary once but an armv7 binary in the other case? May that be the reason why the resulting binary is marked as armv7? Thank you for any explanation.

  • in x264, mp4 [error] : failed to append a video frame

    13 juin 2018, par MSD Paul

    while using x264 encoder to encode a set of frames, its showing an error message of

    "mp4 [error]: failed to append a video frame."

    I am trying to write each and every P-frame in a different file and the I frame is another file.

    encode_frame()
    //I added this small piece of code
    hnd_t hout1;
    if (pic_out->i_type == 3)
    {
       change_outputfilename();
       cli_output.open_file(modified_outputvideofile, &hout1, &output_opt)
       cli_output.write_frame(with the modified hout1 handler);
    }
    else
    {
          cli_output.write_frame(previous_handler)
    }
    

    I am getting the error while I am trying to write the P frame into a video file.

    Can anyone please tell me why this error is coming and how to get rid of this error?

  • How to write a code that will call x264 encoder with required settings repeatedly

    11 juin 2018, par MSD Paul

    how to write a sample code that will call the x264 encoder with its required settings repeatedly changing the input frames and also changing the output video where it is writing the encoded frames. As example,

    x264 --crf 23 --tune fastdecode --fps 64 --keyint 1 --min-keyint 1 --no-scenecut --input-res 4096*2048 --bframes 0 -o v1.mp4 C:/vv_folder/vv_%3d.png

    x264 --crf 23 --tune fastdecode --fps 64 --keyint 1 --min-keyint 1 --no-scenecut --input-res 4096*2048 --bframes 0 -o v2.mp4 C:/vv_folder_1/vv_1_%3d.png

    and so on.

    At each time, different sets of frames will be encoded into one mp4 file.

    How to write this external code?

  • How to encode frames selectively and write in different video files as per required

    10 juin 2018, par MSD Paul

    suppose, for example, I have 10 frames, I want to encode 1,2,3 in one video, 4,5,6 in another video and rest in another video. How to achieve this without encoding each of them differently by us. (as that solution will not be scalable) How to change in the code while writing encoded frames into the video file?

    How to make the write to happen into multiple video files.

    and how to change the sequence of encoding i.e. after 1 how can I possibly encode 4,5 skipping 2,3 after 4,5 done then encode 2,3. How to do this?