Quantcast
Channel: MediaSPIP
Viewing all 117701 articles
Browse latest View live

Fail to decode a video with ffmpeg, but it can be played by video player

$
0
0

i have a video witch can be played by players. But, I failed to decode it using ffmpeg 3.4. Actually, it failed on the ffmpeg libs compiled by myself, but success on a common ffmpeg-3.4 lib of my company.

My compilation seems success, as i can use it to decode most of my videos.

Whats wrong with my lib? If i should enable some special options when compiling? Anything special on this video?

error message:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x31b7120] STSC entry 1 is invalid (first=12 count=0 id=1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x31b7120] stream 0, contradictionary STSC and STCO
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x31b7120] error reading header

video info dumped when i use libs of my company

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'aaa': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42isom creation_time : 2019-08-06T16:42:23.000000Z Duration: 00:00:10.89, start: 0.000000, bitrate: N/A Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 2815 kb/s, 25.66 fps, 25.64 tbr, 1k tbn, 50 tbc (default) Metadata: creation_time : 2019-08-06T16:42:24.000000Z handler_name : encoder : VC Coding
--------------------

Python FFmpeg: Setting VBR and BT.709

$
0
0

I'm using this Python library to programmatically generate a short video using an image (.png) as input. The video needs to match the specifications of another video created by someone else.

The key differences between my output and the other are the following (these are the media attributes I desire to have):

How would I achieve VBR? It was my understanding ProRes 422 HQ natively used unconstrained VBR yet my output specifies CBR.

Secondly, as can be seen from my code, I'm attempting to conform to BT.709. However, my media information output does not specify this. What am I doing incorrectly?

Here's my code:

 image = ffmpeg.input(input_image, t='00:00:10', framerate='24000/1001', loop='1', probesize='42M') output = ffmpeg.output(image, output_video, f='mov', vcodec='prores_ks', vprofile='3', pix_fmt='yuv422p10le', g='48', video_track_timescale='24000', movflags='use_metadata_tags', timecode='00:00:00:00', color_primaries='bt709', color_trc='bt709', colorspace='bt709', qcomp='1', # BT.709 issue solved by adding the bsf option as seen via the line below bsf='prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709', vf='scale=in_range=full:in_color_matrix=bt709:out_range=full:out_color_matrix=bt709') output.run()

Here's the media information produced by my output:

{ "media":{ "@ref":"Redacted", "track":[ { "@type":"General", "VideoCount":"1", "OtherCount":"1", "FileExtension":"mov", "Format":"MPEG-4", "Format_Profile":"QuickTime", "CodecID":"qt ", "CodecID_Version":"0000.02", "CodecID_Compatible":"qt ", "FileSize":"196366623", "Duration":"10.010", "OverallBitRate":"156936362", "FrameRate":"23.976", "FrameCount":"240", "StreamSize":"2463", "HeaderSize":"28", "DataSize":"196364172", "FooterSize":"2423", "IsStreamable":"No", "File_Created_Date":"UTC 2019-12-13 19:26:37.150", "File_Created_Date_Local":"2019-12-13 19:26:37.150", "File_Modified_Date":"UTC 2019-12-13 19:27:20.303", "File_Modified_Date_Local":"2019-12-13 19:27:20.303" }, { "@type":"Video", "StreamOrder":"0", "ID":"1", "Format":"ProRes", "Format_Version":"0", "Format_Profile":"422 HQ", "CodecID":"apch", "Duration":"10.010", "BitRate_Mode":"CBR", "BitRate":"156934237", "Width":"1920", "Height":"1080", "Sampled_Width":"1920", "Sampled_Height":"1080", "PixelAspectRatio":"1.000", "DisplayAspectRatio":"1.778", "Rotation":"0.000", "FrameRate_Mode":"CFR", "FrameRate":"23.976", "FrameCount":"240", "ColorSpace":"YUV", "ChromaSubsampling":"4:2:2", "ScanType":"Progressive", "Delay":"0.000", "StreamSize":"196364160", "Encoded_Library":"Lavc", "colour_description_present":"Yes", "colour_description_present_Source":"Stream", "colour_primaries_Source":"Stream", "transfer_characteristics_Source":"Stream", "matrix_coefficients_Source":"Stream" }, { "@type":"Other", "StreamOrder":"1", "ID":"2", "Type":"Time code", "Format":"QuickTime TC", "Duration":"10.010", "FrameRate":"23.976", "TimeCode_FirstFrame":"00:00:00:00", "TimeCode_Striped":"Yes", "Language":"en", "Default":"No" } ] }
}

Here's the media information spec I'm trying to match:

{ "media":{ "@ref":"Redacted", "track":[ { "@type":"General", "VideoCount":"1", "OtherCount":"1", "FileExtension":"mov", "Format":"MPEG-4", "Format_Profile":"QuickTime", "CodecID":"qt ", "CodecID_Version":"2005.03", "CodecID_Compatible":"qt ", "FileSize":"1397430682", "Duration":"70.737", "OverallBitRate_Mode":"VBR", "OverallBitRate":"158042403", "FrameRate":"23.976", "FrameCount":"1696", "StreamSize":"9898", "HeaderSize":"28", "DataSize":"1397420796", "FooterSize":"9858", "IsStreamable":"No", "Encoded_Date":"UTC 2019-04-29 22:26:32", "Tagged_Date":"UTC 2019-04-29 22:26:32", "File_Created_Date":"UTC 2019-12-12 16:52:57.215", "File_Created_Date_Local":"2019-12-12 16:52:57.215", "File_Modified_Date":"UTC 2019-12-12 17:25:58.903", "File_Modified_Date_Local":"2019-12-12 17:25:58.903", "Encoded_Application":"DVP Factory r561 (2019-04-25), Host: dvp07" }, { "@type":"Video", "StreamOrder":"0", "ID":"1", "Format":"ProRes", "Format_Version":"0", "Format_Profile":"422 HQ", "CodecID":"apch", "Duration":"70.737", "Duration_LastFrame":"-0.000", "BitRate_Mode":"VBR", "BitRate":"158040381", "Width":"1920", "Height":"1080", "Sampled_Width":"1920", "Sampled_Height":"1080", "PixelAspectRatio":"1.000", "DisplayAspectRatio":"1.778", "Rotation":"0.000", "FrameRate_Mode":"CFR", "FrameRate":"23.976", "FrameCount":"1696", "ColorSpace":"YUV", "ChromaSubsampling":"4:2:2", "ScanType":"Progressive", "Delay":"0.000", "StreamSize":"1397420784", "Encoded_Library":"agi0", "Language":"en", "Encoded_Date":"UTC 2019-04-29 22:26:32", "Tagged_Date":"UTC 2019-04-29 22:26:32", "colour_description_present":"Yes", "colour_description_present_Source":"Container / Stream", "colour_primaries":"BT.709", "colour_primaries_Source":"Container", "colour_primaries_Original_Source":"Stream", "transfer_characteristics":"BT.709", "transfer_characteristics_Source":"Container", "transfer_characteristics_Original_Source":"Stream", "matrix_coefficients":"BT.709", "matrix_coefficients_Source":"Container / Stream" }, { "@type":"Other", "StreamOrder":"1", "ID":"2", "Type":"Time code", "Format":"QuickTime TC", "Duration":"70.737", "FrameRate":"23.976", "TimeCode_FirstFrame":"00:00:00:00", "TimeCode_Striped":"Yes", "Language":"en", "extra":{ "Encoded_Date":"UTC 2019-04-29 22:26:32", "Tagged_Date":"UTC 2019-04-29 22:26:32" } } ] }
}
-- using this Python library

How to save the output of an FFmpeg command into a text file

$
0
0

How can I save the output of an ffmpeg process into a text file? I see the stuff I want to save come up in the terminal:

frame=62 fps=0.0 q=-0.0 size=0kB time=00:00:01.06 bitrate=0.3kbit
frame=116 fps=115 q=-0.0 size=0kB time=00:00:01.97 bitrate=0.2kbit
frame=175 fps=116 q=-0.0 size=kB time=00:00:02.92 bitrate=0.1kbit
frame=232 fps=113 q=-0.0 size=0kB time=00:00:03.87 bitrate=0.1kbit

But need to know how this can be saved into a test file or even a csv file

How can make video file from images of 1 image per second using ffmpeg?

$
0
0

we are creaing video from images using ffmpeg on window. The video is created successfully but we are not able to control number of images per second of video. we need 2 images per second in video.

Below is code we used

exec('ffmpeg -y -f image2 -framerate 2 -i C:/inetpub/wwwroot/movie/images/%d.jpg video60.mpg', $output, $exit_status);

Please help us to find solution for above problem.

C script and ffmpeg can't find files

$
0
0

I tryed to use ffmpeg concat with popen command in c but i get "No such file o directory". If i use linux terminal with the same command it works.

ffmpeg -i "concat: audio/1.mp3|audio/2.mp3" -acodec copy output.mp3

What could be the problem?

Anomalie #3620: Token de prévisualisation inconsistant selon que l'article est en cours de rédact...

$
0
0

Constaté sur une url de relecture confiée par t*tue. C'est une 404 qui est affichée.
Une fois logé comme rédacteur sur ce site, le bouton admin "relecture temporaire" apparaît sur cette page, mais il amène également sur une err404 malgré la présence d'un var_previewtoken en plus dans l'url...

Replacing the audio track in the video with ffmpeg

$
0
0
ffmpeg -i source_video.mp4 -i new_audio.aac -c:v copy -map 0:v:0 -map 1:a:0 -shortest new.mp4

I'm a video editor and I often have to replace the audio track in a video file without decoding.

This command replaces the audio track in the video file, but it is necessary to specify the names of the input files exactly.

Please tell me:

  1. Can you tell me how not to write the name of the files by specifying only their extension? To call the same command in a folder with different files.

  2. So that the resulting file has an identical name to the input video file, but with a postfix in the form of date and time, for example, source_video_14.12_14:50.mp4

Thank you!

enter image description here

-- enter image description here

Python running a cmd command(ffmpeg) with subprocess and wait for cmd to close before executing some code

$
0
0

So im using ffmpeg to resize a video, and this takes a little while so before the code continues i have to wait for the cmd to close. I havent been able to find a solution and i hope someone that actually knows their stuff can teach me a way. im probably just doing something retarded... Anyway i have tried multiple things like using subprocess.Propen() and then using pope() to see when it doesnt return "None" also tried stuff like subprocess.run() with subprocess.CompletedProcess() but i just cant get it to work could someone please care to explain if there is a way to do this and that im just doing it wrong? :)

Here is an example of what I tried

p = subprocess.Popen("start ffmpeg -y -i "+DIR+"/post.mp4 -vf scale="+str(nW)+":"+str(nH)+""+DIR+"/post_r.mp4", shell=True) while p.poll() is None: time.sleep(1) print("alive") else: print("cmd exited")

Also whenever i put shell=False it just breaks instantly and I get this error: FileNotFoundError: [WinError 2] The system cannot find the file specified


How to split multiple videos 2.24 seconds before the end

$
0
0

I have a folder with 100 videos, I need to split all videos into 2, the split needs to happen 2 seconds before the end of every video.

I want to keep both parts of the video after the split.

ffmpeg can't find files using C? [closed]

$
0
0

I tried to use ffmpeg concatenation with popen command in C but I get "No such file or directory". If I use Linux terminal with the same command it works.

ffmpeg -i "concat: audio/1.mp3|audio/2.mp3" -acodec copy output.mp3

What could be the problem?

lavu/pixfmt: Cosmetics, remove wrong end-of-comment markers.

$
0
0
lavu/pixfmt: Cosmetics, remove wrong end-of-comment markers.
  • [DH] libavutil/pixfmt.h

Evolution #4412 (Nouveau): Ajout d'un site : récuperer son icone en logo

$
0
0

Lorsqu'on constitue un annuaire de site,
cela pourrait etre bien pratique que le logo (Favicon) soit automatiquement importé comme logo (au moins logo de survol...).

Evolution #4412: Ajout d'un site : récuperer son icone en logo

$
0
0

Ou bien déjà que le logo puisse etre téléchargé par une URL directement depuis Internet (comme pour les autres objets editoriaux).

Use ffmpeg in C language with linux

$
0
0

I tried to use ffmpeg concatenation with popen command in C but I get "No such file or directory". If I use Linux terminal with the same command it works.

C code:

fp=popen("ffmpeg -i \"concat: audio/1.mp3|audio/2.mp3\" -acodec copyoutput.mp3", "r");
pclose(fp);

Error in Linux shell:

audio/1.mp3|audio/2.mp3 No such file of directory found

What could be the problem?

Anomalie #4414 (Nouveau): get_magic_quotes_gpc obsolète en php 7.4

$
0
0

Anomalie #4413 (Nouveau): get_magic_quotes_runtime obsolète en php 7.4

$
0
0

How to call ffmpeg with arguments from C using popen on Linux?

$
0
0

I tried to use ffmpeg concatenation with popen command in C but I get "No such file or directory". If I use Linux terminal with the same command it works.

C code:

fp=popen("ffmpeg -i \"concat: audio/1.mp3|audio/2.mp3\" -acodec copyoutput.mp3", "r");
pclose(fp);

Error in Linux shell:

audio/1.mp3|audio/2.mp3 No such file of directory found

What could be the problem?

avcodec/mp3_header_decompress_bsf: Check sample_rate_index

$
0
0
avcodec/mp3_header_decompress_bsf: Check sample_rate_index Fixes: out of array read
Fixes: 19309/clusterfuzz-testcase-minimized-ffmpeg_BSF_MP3_HEADER_DECOMPRESS_fuzzer-5651002950942720 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
  • [DH] libavcodec/mp3_header_decompress_bsf.c

avcodec/pnm: Check that the header is not truncated

$
0
0
avcodec/pnm: Check that the header is not truncated Fixes: Ticket8430 Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
  • [DH] libavcodec/pnm.c

Remove sequentially duplicate frames when using FFmpeg

$
0
0

Is there any way to detect duplicate frames within the video using ffmpeg?

I tried -vf flag with select=gt(scene\,0.xxx) for scene change. But, it did not work for my case.

Viewing all 117701 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>