ef868fa4a1 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: misc style fixes  
							
							misc style fixes.
Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com> 
							
						 
						5 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								f30a41a608 
								
							
								 
							
						 
						
							
							
								
								Stop hardcoding align=32 in av_frame_get_buffer() calls.  
							
							Use 0, which selects the alignment automatically. 
							
						 
						8 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								d8de9d46f2 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: convert to new encoding API  
							
							
								
							
							
						 
						5 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								4a51075f4d 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: fix underflow in duration of encoded streams  
							
							Now they are exactly 10 seconds long.
Fixes  #5684 . 
							
						 
						6 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								10bcc41bb4 
								
							
								 
							
						 
						
							
							
								
								examples: Don't call deprecated functions which don't do anything  
							
							
								
							
							
						 
						7 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								7e3e0f87e6 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: re-indent block  
							
							
								
							
							
						 
						8 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								3115550abe 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Fix av_frame_make_writable usage  
							
							This patch moves the av_frame_make_writable() call from fill_yuv_image
to get_video_frame so that its argument can be the actual frame that
will be sent to the encoder.
This fixes data corruption issues in codecs that keep references on
one or several previous frames.
Signed-off-by: Sam Hocevar <sam@hocevar.net>
Reviewed-by: wm4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> 
							
						 
						9 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								0c79c96cf2 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Add support to pass flags to muxer as since codecpar the codec flags are not available to the muxer anymore  
							
							Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> 
							
						 
						9 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								83fc0b9d48 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Fix mixed declaration and code  
							
							Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> 
							
						 
						10 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								1d2410639d 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Use avio_closep() in examples as it avoids leaving stale pointers  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						10 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								f285056810 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: fix "-flags" option  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								c437765be7 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Exchange tmp_frame and frame  
							
							Reduces difference to 56f98e340f 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								d1ce43a3e8 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: mark correct frame as writeable  
							
							Bug found from comparing 56f98e340f 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								fbd46e2f1c 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Always use swr, simplifies code slightly  
							
							Idea-from: 56f98e340f 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								22e9fe06eb 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: add alloc_audio_frame() and use it to simplify code.  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								a98cadef7f 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Move samples_count to OutputStream  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								8b1d54ba40 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: free swr context at the end  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								7cf0865551 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Support setting flags, for example for setting bitexact  
							
							This would allow the example to be used in regression tests
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								5d2cf1ae86 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: select a supported sample rate for the encoder, favor 44100  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								ead22f42f4 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: pick a supported channel layout if stereo isnt supported by the encoder  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								9ccb9c8df2 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: move swr context to OutputStream  
							
							Idea from: 56f98e340f 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								4d3072ada3 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: remove unused variable  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								341639fe80 
								
							
								 
							
						 
						
							
							
								
								doc/examples: remove pathes from doxy examples  
							
							This makes the examples page less cluttered
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								35fe88bb51 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: reindent after previous commit  
							
							
								
							
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								c92d2f98db 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: flush encoders at the end  
							
							
								
							
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								e34ad128a3 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: reduce duration, remove wrong and misleading comment  
							
							Set duration to 10 seconds, after it was increased from 5 to 200 seconds
in 8d80f3cb87 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								9ab8f3738a 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: remove redundant {}  
							
							
								
							
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								b933c72b5e 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: change error checks, from "ret != 0" to "ret < 0"  
							
							More consistent and more future-proof. 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								d72c742d47 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: factorize write_interleave code  
							
							Also log output packet information. 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								d497141b85 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: simplify video PTS setting  
							
							Rely on frame_count. Also more consistent with audio path. 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								23ffc4c70d 
								
							
								 
							
						 
						
							
							
								
								doc/examples/muxing: Fixes frame initialization.  
							
							Fixes use of the example with encoders which use tha AVFrame w/h/pix_fmt fields
FFV1 is one of these codecs
We cannot easily workaround the not set fields in common code because the API
has AVFrame constant for the encoders.
Alternatives would be to fix the API or to duplicate the struct and fill in
missing fields. Or as is to require all user apps to set this correctly and
maybe simplify for that case
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								094c500caf 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: set timestamps in output audio packet  
							
							In particular, fix trac ticket #3231 . 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								8d22d37e54 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: use av_frame_free() in place of av_free()  
							
							
								
							
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								9abe4a10fd 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: reuse global audio frame  
							
							Simplify logic, avoid multiple unnecessary alloc/free operations. 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								80bca6eabe 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: honour distinction between encoder PTS timebase and stream timebase  
							
							Fix PTS set on the frame when encoding, which must be specified in the
encoder timebase or this will confuse the encoder.
When muxing the packet, the PTS/DTS generated by the encoder is then
rescaled to the stream timebase. 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								eadc421259 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: set sample formats from list of codec supported sample formats  
							
							Avoid the need of tweaking, also show how to get list of supported sample
formats. 
							
						 
						11 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								d1b8e01ef1 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: fix memleaks in resampler  
							
							- do not allocate resample dst buffer when resample is off
  - free sample buffers in addition to freeing data pointer arrays
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								7d1d0b3ecf 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: use S16 sample_fmt for resample src regardless of codec sample_fmt  
							
							We generate S16 samples and we should allocate the right buffer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								b6714fa077 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: fix av_frame_free() not called when got_packet is false  
							
							Hi list! Since my last patch (fix 2 memleaks in doc/examples/muxing.c)
I found more problems to fix.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								2aa2b4ac65 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: add support to audio resampling  
							
							Allows to encode to output in case the destination sample format is
different from AV_SAMPLE_FMT_S16. 
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								759dfd5684 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: make more compact audio/video_time computation  
							
							
								
							
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								80b56a7bdd 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: rename audio/video_pts to audio/video_time  
							
							The new name is less confusing, since the variables represent times
rather than timestamps. 
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								3aa57e1582 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: remove useless instruction  
							
							Simpler and less confusing. 
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								4b6cf1ce0e 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: vertically align  
							
							
								
							
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								9b211c43dc 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: fix memory leak.  
							
							Do not re-call avcodec_get_context_defaults3(), it is already
called by avformat_new_stream() and it leaks the codec
priv_data that was already allocated.
Use avformat_free_context() instead of freeing (not)
everything manually.
Fix trac ticket #2322 . 
							
						 
						12 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								e4f14c32b9 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: improve error messages.  
							
							Illustrate the use of return values, av_err2str and
avcodec_get_name. 
							
						 
						13 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								ca28cb5f83 
								
							
								 
							
						 
						
							
							
								
								examples: fix doxy so they appear on the example page  
							
							Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 
							
						 
						13 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								eebde404bc 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: merge add_audio_stream() and add_video_stream()  
							
							Factorize. 
							
						 
						13 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								eda0a52bf1 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: check on frame  
							
							Fix crash in case frame is not defined (e.g. with muxing out.wav). 
							
						 
						13 years ago  
				
					
						
							
							
								 
						
							
							
							
								
							
								d6196d9421 
								
							
								 
							
						 
						
							
							
								
								examples/muxing: fix bogus setting of st->id  
							
							
								
							
							
						 
						13 years ago